Utilizing setMonarchTokensProvider allows me to define tokens, but it has limitations. I am able to create a new language or override existing typescript, however, this does not provide me with access to the rest of the typescript tokens that I still require.
My goal is to introduce a single token that holds significance within the context of this editor and can be colorized, while retaining all typescript functionality.
The code snippet below is what I currently have (adapted from playground examples), but it eliminates the other typescript tokens:
monaco.languages.setMonarchTokensProvider('typescript', {
tokenizer: {
root: [
[/\pvm.*/, "custom-error"]
]
}
});
monaco.editor.defineTheme('myCoolTheme', {
base: 'vs',
inherit: true,
rules: [
{ token: 'custom-error', foreground: 'ff0000', fontStyle: 'bold' }
]
});
(After implementing the myCoolTheme when initializing the editor)