You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Write console. -> cycle through function completions. ~ will only appear once an item has been selected:
fn_completion.mp4
Write console.log(foo -> cycle through auto-import completions. ~ will only appear once an item has been selected:
auto_import.mp4
Expected behavior
Should show ~ upfront in menu
Actual behavior
See "Steps to reproduce"
Additional context
In typescript-language-server you can tell upfront from completionItem.data.entryNames[0].source that there will be an auto-import, but this seems to be their internal convention and not an LSP convention. additionalTextEdits is not populated until completion is resolved.
Similarly, in typescript-language-server, function snippets do not update insertText until completion resolve. But it does set InsertTextFormat.Snippet upfront.
since I assume the indicator is supposed to indicate that you'll get a result which is different from just the label? But IDK how common this even is. The following might be preferable:
FAQ
Announcement
Minimal reproducible full config
Description
See "Steps to reproduce"
Steps to reproduce
In a new directory:
tsconfig.json:{ "compilerOptions": { "paths": { "@/*": ["./*"] } } }foo.ts:In a new file
bar.ts:console.-> cycle through function completions.~will only appear once an item has been selected:fn_completion.mp4
console.log(foo-> cycle through auto-import completions.~will only appear once an item has been selected:auto_import.mp4
Expected behavior
Should show
~upfront in menuActual behavior
See "Steps to reproduce"
Additional context
In
typescript-language-serveryou can tell upfront fromcompletionItem.data.entryNames[0].sourcethat there will be an auto-import, but this seems to be their internal convention and not an LSP convention.additionalTextEditsis not populated until completion is resolved.Similarly, in
typescript-language-server, function snippets do not updateinsertTextuntil completion resolve. But it does setInsertTextFormat.Snippetupfront.So, I would propose that in:
nvim-cmp/lua/cmp/entry.lua
Lines 245 to 246 in c4e491a
the following change be made:
since I assume the indicator is supposed to indicate that you'll get a result which is different from just the label? But IDK how common this even is. The following might be preferable: