I want to have intellisense for the following code:
const a = {
asd: '123'
};
a[''] // I want the editor to suggest that there's `asd` property here
It works in VS Code:
But it doesn't work in Monaco:
I tried importing TextMate grammar from VSCode to Monaco using monaco-tm, but it seems to have no influence on intellisense.
P.S. intellisense works for dot-properties, i.e. if I type a.
, Monaco suggests me to type asd
.
To trigger it automatically (without pressing 'Ctrl+Space') when you type quotes, you can use code below:
editor.onKeyUp((e) => {
if (e.keyCode === monaco.KeyCode.Quote) {
editor.trigger('', 'editor.action.triggerSuggest', '');
}
});
Thanks to the answer here.