hrsh7th / nvim-cmp

A completion plugin for neovim coded in Lua.
MIT License
7.53k stars 377 forks source link

Favor existing values in completion_item over resovled_completion_item #1725

Closed Trildar closed 4 months ago

Trildar commented 9 months ago

Fix/workaround for #1705

"Workaround" because I think ultimately the issue is in the Astro language server or an upstream language server returning wrong ranges for completionItem/resolve requests.

Excuse me if there is a reason this behaviour is undesirable. Since the LSP spec says that properties provided in textDocument/completion "must not be changed during resolve" and VS Code presumably (I don't know where its code for handling completions is) behaves like this, as it's not affected by the above issue, I kind of assume this would be fine.

Also, just out of curiosity, is there a reason this doesn't use vim.tbl_extend()?

phaberest commented 6 months ago

I can confirm this fixes that wrong behaviour, thank you @Trildar (at least I was able to fix my own environment)

hrsh7th commented 4 months ago

I didn't know it was specified in the LSP specification! thank you.