I am looking at the sandbox for Monaco Editor here: https://microsoft.github.io/monaco-editor/playground.html#extending-language-services-custom-languages
I'm trying to support the following case:
"A single line quote"
"But also a slightly weird
multi line quote"
I need to support both because the language I'm working with support both. Now, the rule I set up looks like this:
// Register a tokens provider for the language
monaco.languages.setMonarchTokensProvider('mySpecialLanguage', {
tokenizer: {
root: [
[/"(?:[^"\\]|\\.\n{0,})*"/gi, 'my-string'],
]
}
});
// Define a new theme that contains only rules that match this language
monaco.editor.defineTheme('myCoolTheme', {
base: 'vs',
inherit: false,
rules: [
{ token: 'my-string', foreground: '0000FF' },
]
});
The problem is that the multi-line quote isn't working. I'm suspecting that Monaco parses the text/code line-by-line which causes the problem, but surely I can't be alone with this issue. Is there a flag or something I have to set?