0

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 Answers2

0

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

Mike Lischke
  • 48,925
  • 16
  • 119
  • 181
  • thank u, could you elaborate? Sometimes two identical SQL statements are not highlighted – jasmine-song Feb 24 '22 at 02:44
  • https://i.stack.imgur.com/P7QzN.jpg Sorry, I don't understand the logic or laws of language active, I feel the same language is randomly highlighted – jasmine-song Mar 15 '22 at 08:24
0

You may need to configure this to highlight

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

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

Link
  • 73
  • 5