completion-nvim
completion-nvim copied to clipboard
Support completionItem/resolve for additional text edits
A small change to allow additional text changes from completionItem/resolve.
I think you also want to change https://github.com/nvim-lua/completion-nvim/blob/bd4f21f35e1b6d6f4a79ff4bb8a89d812bd912a0/lua/completion.lua#L110 to
if next(item.additionalTextEdits) then
This handles the subtle case when item.additionalTextEdits
is {}
, because if {} then x else y end
evaluates to x
in lua (rust-analyzer does this when I do a completion and expect to receive an auto-import - it needs to hit the else case added by this PR to get the additionalTextEdit
but doesn't because of this). Note that it is not sufficient to compare item.additionalTextEdits ~= {}
because it's not true that {} == {}
(lua compares these by pointers).