Hi, I want to register a customized language like https://microsoft.github.io/monaco-editor/playground.html#extending-language-services-custom-languages.
But whether I got the editor instance via editorDidMount
or this.$refs.editor.getEditor()
, the editor instance did not contain languages
, defineTheme
and so on.
I want to execute the following code.
// Register a new language
monaco.languages.register({ id: 'bind9' })
// Register a tokens provider for the language
monaco.languages.setMonarchTokensProvider('bind9', {
tokenizer: {
root: [
[/IN/, 'record-className'],
[/(SOA|NS|MX|TXT|A|AAAA|CNAME)/, 'record-type'],
],
},
})
// Define a new theme that contains only rules that match this language
monaco.editor.defineTheme('bind9Theme', {
base: 'vs',
inherit: false,
rules: [
{ token: 'record-className', foreground: '808080' },
{ token: 'record-type', foreground: 'ff0000', fontStyle: 'bold' },
],
})
I also reviewed the readme of https://github.com/Microsoft/monaco-editor-webpack-plugin, but still got nothing help.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too