monaco-editor
monaco-editor copied to clipboard
Is there a way to disable IntelliSense?
In my project, IntelliSense seems to obscure a lot of the code in the editor, similar to what is described in this issue - https://github.com/microsoft/monaco-editor/issues/344#issue-204285250
Can I disable IntelliSense entirely? I went through IEditorOptions in the API, but didn't find anything that I could use.
~~I also looked at the VSCode docs on Customizing IntelliSense, but not sure if/how they relate to Monaco Editor.~~
On further digging - I tried the config from VSCode docs in the Monaco Playground, and it seems like intellisense is turned off -
var editor = monaco.editor.create(document.getElementById("container"), {
value: jsCode,
language: "javascript",
quickSuggestions: {
"other": false,
"comments": false,
"strings": false
},
parameterHints: {
enabled: false
},
ordBasedSuggestions: false,
suggestOnTriggerCharacters: false,
acceptSuggestionOnEnter: "off",
tabCompletion: "off",
wordBasedSuggestions: false
});
I just took the config described in the "Customizing IntelliSense" section to try this out, but is there another command that disables IntelliSense entirely all at once, instead of using individual properties?
In my use case just setting quickSuggestions
to false
is enough to make all of intellisense go away.
@mattgodbolt Thank You. I too thought quickSuggestions
would take care of it, but it only disables the suggestions as you type. If you press .
, you still get suggestions in the dropdown -
There is currently no way to disable suggestions entirely in the AMD distribution. The only possible way would be by using the ESM distribution of the editor and not including the suggest
functionality -- see here.
🤔 features: ["!suggest"]
did not work for me. But, this very upsetting CSS snippet did:
.monaco-editor .editor-widget {
display: none !important;
visibility: hidden !important;
}
(!important
was necessary to override the inline styles added by Monaco)
It'd be swell if ISuggestOptions
could have an enabled?: boolean
added to it.
My use case is pretty common with education platforms where surfacing additional information is surprisingly harmful to the experience of new users. Other example: https://github.com/freeCodeCamp/learn/issues/88
@alexdima Hi. Could you tell a bit more about how to exclude Suggestion functionality via ESM way?
Seems that i could disable default javascript suggestions
const myDiv: HTMLDivElement = this.editorContent.nativeElement;
const editorJS: ICodeEditor = editor.create(myDiv, {
language: 'javascript',
formatOnPaste: true,
model: model,
readOnly: false,
lineNumbers: 'on',
minimap: { enabled: false },
suggest: {
showFields: false,
showFunctions: false
}
});
See all options at ISuggestOptions
interface