Intellisense suggest not showing items returned by provideCompletionItems

Viewed 107

I have an extension under development, and most of the time provideCompletionItems correctly displays the items returned by provideCompletionItems as suggestions.

  • VSCode Version: 1.45.0
  • OS Version: Mac 10.15.4

However, in some cases, when I am for sure returning items as an array, I see "No suggestions." Screenshot:

image

You can see in the DEBUG CONSOLE I am printing to the debug log an array of length 2 just before I return it as the completion items results. Relevant code here:

https://github.com/kortina/vscode-markdown-notes/blob/ak-bug-reference/src/extension.ts#L146

Is this a bug with VS Code that I should report, or am I misunderstanding the functionality of provideCompletionItems / do I need to do something else to have this reliably show the suggestions I am returning?

1 Answers

I have seen similar behavior and it turned out that I did not specify the range for the suggestion correctly. The engine returned many valid suggestions but the editor decided to show only the "No suggestions" message. So, double check the range in your completion items.

Related