Monaco-Editor Some keywords are not highlighted

923 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 best solutions below

2
On

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

1
On

You may need to configure this to highlight

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

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