3

I would like to use Monaco to edit ES6 code and would like syntax coloring. Monarch provides a basic JavaScript tokenizer at https://microsoft.github.io/monaco-editor/monarch.html, but it isn't ES6 compliant. The typescript languages tokenizer is ES6 compliment, but when it comes with a lot of extra features I don't want, like code completion and type hints.

Is it possible to use only the typescript tokenizer, or is there a monarch tokenizer for ES6?

probablyCorey
  • 2,478
  • 2
  • 16
  • 17
  • Does this answer your question? [How to use monaco editor for syntax highlighting?](https://stackoverflow.com/questions/52700307/how-to-use-monaco-editor-for-syntax-highlighting) – Mike Lischke Apr 19 '23 at 06:54

1 Answers1

0

When passing options to an editor instance, you can disable most providers:

const options = {
  value: 'var c=1;',
  hover: false, 
  quickSuggestions: false,
  wordBasedSuggestions: false
};
monaco.editor.create(DOMElement, options);

All possible options are detailed here.

David I. Samudio
  • 2,364
  • 18
  • 21
  • This link https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.ieditoroptions.html doesn't seem to be active any more. – wegry Apr 17 '23 at 19:18