Skip to content

Commit fb9f374

Browse files
committed
fix: default to item when assigning defaults, only use known defaults
closes #151
1 parent ccf02f5 commit fb9f374

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lua/blink/cmp/sources/lsp.lua

+8-1
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,17 @@ function lsp:get_completions(context, callback)
111111
-- convert full response to our internal format
112112
else
113113
local defaults = response.result and response.result.itemDefaults or {}
114+
-- TODO: excluding editRange for now
115+
local known_defaults = {
116+
'commitCharacters',
117+
'insertTextFormat',
118+
'insertTextMode',
119+
'data',
120+
}
114121
for _, item in ipairs(response.result.items) do
115122
-- add defaults to the item
116123
for key, value in pairs(defaults) do
117-
item[key] = value
124+
if vim.tbl_contains(known_defaults, key) then item[key] = item[key] or value end
118125
end
119126
end
120127

0 commit comments

Comments
 (0)