0

I am facing a weird issue. I am setting up method through auto suggestion like:

CONCATENATE(n)|

my cursor shows it within parenthesis after n. like

enter image description here

Now i am start typing again by replacing n with some value which also suppose to start dispalying auto-suggestion related to those characters. but it doesn't work until and unless i click in last. then i go back again inside parenthesis and start typing. It starts populating auto-suggestions.

I tried to debug library, and I found change event doesn't work untill i click outside in last.

So, is there any way to handle it or can we add any thing in config to make it work?

monaco.languages.registerCompletionItemProvider(customLanguageConfig.id, {
provideCompletionItems: (model, position) => {
    const word = model.getWordUntilPosition(position);
    const messageId = 'messageId-' + currentMessageId++;
    window.parent.postMessage({
        message: _monacoId + "-provide-completion-items",
        value: {
            messageId: messageId,
            textUntilPosition: model.getValueInRange({
                startLineNumber: 1,
                startColumn: 1,
                endLineNumber: position.lineNumber,
                endColumn: position.column
            }),
            range: {
                startLineNumber: position.lineNumber,
                endLineNumber: position.lineNumber,
                startColumn: word.startColumn,
                endColumn: word.endColumn-1
            }
        }
    }, "*");
    const promise = new Promise((resolve, reject) => {
        mapOfCompletionRequests[messageId] = resolve;
    });
    return promise;
}
});
Avnesh Shakya
  • 3,828
  • 2
  • 23
  • 31
  • Do you ever fulfil the promise you return? – Mike Lischke Mar 16 '21 at 08:50
  • Yes @MikeLischke that works fine. My need is to customise event, if you see https://microsoft.github.io/monaco-editor/playground.html#extending-language-services-completion-provider-example if you start typing "my" then select that you can observe that if we cannot click outside text or in white space last cursor won't hide. but we want to hide that on text click or changing that text. – Avnesh Shakya Mar 16 '21 at 09:50

0 Answers0