format string

I’m building an editor for a specific query language, configured a parser using Lezer. The code comes as a string and contains a function like this:aliasByTags(movingSum(seriesByTag(‘project=EDI’, ‘subproject=Transport’, ‘environment=Staging2’, ‘application=Catalogue_EDI_FtpAvailabilityChecker’, ‘name=FileTransferFailures’), ‘5min’), ‘Host’, ‘Port’, ‘Encryption’, ‘Mode’)
I need the code to be split into tokens and displayed with proper indentation when the page loads, like this:aliasByTags(
How can I achieve this?

Code formatting is not something CodeMirror provides. You’d have to write your own program for that.