-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LSP function completion does not insert placeholder for function arguments. #553
Comments
What's the output of |
Duplicate of #479 ? |
I don't think this is a duplicate since in this scenario the resolved_item did contain the snippet placeholder in In this case, I am testing with tsserver, which do support function completion with argument expansion unlike lua_ls in that issue. |
Oh my bad then. Sorry |
I'm trying to diagnose this issue with my limited knowledge of LSP. It seems like the Typescript Language Server expect the client to be able to handle either
I'm not sure if this is out-of-spec or not. Looking at the LSP spec there is no restriction to which property in the CompletionItem returned from LSP the client can handle. My theory as to how Should |
It's out of spec technically but I still think we should merge the two items together, prioritizing the resolved item, for compatibility. See end of this paragraph about not changing values not marked as resolvable: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_completion PR is welcome! |
Make sure you have done the following
blink.cmp
Bug Description
Currently function argument placeholders are not inserted to the completion even though the language server do return a response that tell client to insert a snippet.Here is response of the language server (I got this by adding a
vim.print(resolved_item)
inaccept/init.lua
:The LSP did return
insertTextFormat = 2 (Snippet)
and also the insertText field contains the snippet expression.Below is the switch~ snippet
resolved_item
for comparison:It seems like there is no difference between when it comes to
resolved_item
in both cases but the latter shows the placeholder while the former does not.Relevant configuration
neovim version
v0.10.1
blink.cmp
version: branch, tag, or commitv0.7.6
The text was updated successfully, but these errors were encountered: