File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -113,8 +113,9 @@ function lsp:get_completions(context, callback)
113
113
end
114
114
end
115
115
116
- -- add client_id to the items
116
+ -- add client_id and defaults to the items
117
117
for client_id , response in pairs (responses ) do
118
+ local defaults = response .result and response .result .itemDefaults or {}
118
119
for _ , item in ipairs (response .items ) do
119
120
-- todo: terraform lsp doesn't return a .kind in situations like `toset`, is there a default value we need to grab?
120
121
-- it doesn't seem to return itemDefaults either
@@ -123,6 +124,11 @@ function lsp:get_completions(context, callback)
123
124
124
125
-- todo: make configurable
125
126
if item .deprecated or (item .tags and vim .tbl_contains (item .tags , 1 )) then item .score_offset = - 2 end
127
+
128
+ -- add defaults to the item
129
+ for key , value in pairs (defaults ) do
130
+ item [key ] = value
131
+ end
126
132
end
127
133
end
128
134
You can’t perform that action at this time.
0 commit comments