Monaco-Editor Some keywords are not highlighted

884 views Asked by At

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

What is the logic of highlighting? I feel the same language is randomly highlighted.

the version is "monaco-editor": "0.18.1", "monaco-editor-webpack-plugin": "1.7.0",

2

There are 2 answers

2
Mike Lischke On

Because the highlighting depends on which syntax highlighter is active, which in turn depends on the currently active language in the document.

1
Link On

You may need to configure this to highlight

monaco.editor.create(document.getElementById('container'), {
   language: 'sql'
});

https://i.stack.imgur.com/Gd93C.png