问题
I'm using the Monaco editor to build a JSON editing UI.
It seems if you use any Monaco setup for JSON (e.g. their home page demo, if you set it to JSON: https://microsoft.github.io/monaco-editor) then autocompletion (ctrl-space) always shows a $schema
option.
I'm sure this is useful if you're intending to use JSON schemas, but I'm not. I want to implement my own autocompletion, so I don't want to disable it entirely, but I want to remove $schema
from the options.
Adding a completionProvider seems to only add additional completions, not remove existing ones.
Is there any way to control this behaviour?
回答1:
In your package.json
, you should depend on monaco-editor-core
instead of monaco-editor
. This way you won't get any of the JSON language editing capabilities. I think you'd have to define the syntax highlighting yourself though...
来源:https://stackoverflow.com/questions/50191131/disable-schema-json-autocompletion-with-monaco