Textrude icon indicating copy to clipboard operation
Textrude copied to clipboard

Improve Scriban syntax highlighting in Template editor

Open NeilMacMullen opened this issue 3 years ago • 1 comments

If we move to Monaco for the template window as in #42 it ought to be possible to use Scriban syntax colouring. Technically we could implement this in AvalonEdit as well but it's probably easier in Monaco. There is a VS-Code extension which does this but it is not quite in the same format as the Monaco basic-languages js files. It seems like there ought to be a tool that transforms the extension files into native Monaco js configurations but if there isn't it could be done partially by hand.

It looks like https://github.com/scriban/scriban-vscode/blob/master/language-configuration.json needs to be pasted into a new js file in the exports.conf section. The exports.language section is mostly generic parser rules but things like keyword lists would obviously differ and it's likely some of the regex rules would change.... Plus there is the difficulty of coping with mixes of scriban and text - the vs code highlighter does this by having a number of variants depending on what the target format is.

NeilMacMullen avatar Feb 03 '21 21:02 NeilMacMullen

There is now a scriban.js syntax file that was originally based on the csharp syntax but it really needs extensive work to provide a good experience.

NeilMacMullen avatar Feb 07 '21 16:02 NeilMacMullen