File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,11 @@ function lsp:has_capability(capability)
16
16
return false
17
17
end
18
18
19
+ --- @param method string
20
+ --- @return boolean Whether at least one LSP client supports ` method`
21
+ --- @private
22
+ function lsp :has_method (method ) return # vim .lsp .get_clients ({ bufnr = 0 , method = method }) > 0 end
23
+
19
24
--- Completion ---
20
25
21
26
function lsp :get_trigger_characters ()
@@ -48,7 +53,7 @@ function lsp:get_completions(context, callback)
48
53
-- TODO: should make separate LSP requests to return results earlier, in the case of slow LSPs
49
54
50
55
-- no providers with completion support
51
- if not self :has_capability (' completionProvider' ) then
56
+ if not self :has_capability (' completionProvider' ) or not self : has_method ( ' textDocument/completion ' ) then
52
57
callback ({ is_incomplete_forward = false , is_incomplete_backward = false , items = {} })
53
58
return function () end
54
59
end
@@ -196,6 +201,12 @@ function lsp:get_signature_help_trigger_characters()
196
201
end
197
202
198
203
function lsp :get_signature_help (context , callback )
204
+ -- no providers with signature help support
205
+ if not self :has_method (' textDocument/signatureHelp' ) then
206
+ callback (nil )
207
+ return function () end
208
+ end
209
+
199
210
local params = vim .lsp .util .make_position_params ()
200
211
params .context = {
201
212
triggerKind = context .trigger .kind ,
You can’t perform that action at this time.
0 commit comments