aboutsummaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/init.lua b/init.lua
index 6d9568c..b8986a4 100644
--- a/init.lua
+++ b/init.lua
@@ -708,7 +708,7 @@ function LanguageServer:call_text_document_method(method, params, win, ctx)
end
local function lspc_handle_goto_method_response(req, result)
- if not result or next(result) == nil then
+ if not result or type(result) ~= 'table' or next(result) == nil then
lspc:warn(req.method .. ' found no results')
return
end
@@ -755,7 +755,7 @@ local function lspc_handle_goto_method_response(req, result)
end
local function lspc_handle_completion_method_response(win, result, old_pos)
- if not result or not result.items then
+ if not result or type(result) ~= 'table' or not result.items then
lspc:warn('no completion available')
return
end
@@ -843,7 +843,7 @@ local function lspc_handle_completion_method_response(win, result, old_pos)
end
local function lspc_handle_hover_method_response(win, result, old_pos)
- if not result or not result.contents then
+ if not result or type(result) ~= 'table' or not result.contents then
lspc:warn('no hover available')
return
end
@@ -877,7 +877,7 @@ local function lspc_handle_hover_method_response(win, result, old_pos)
end
local function lspc_handle_signature_help_method_response(win, result, call_pos)
- if not result or not result.signatures or #result.signatures == 0 then
+ if not result or type(result) ~= 'table' or not result.signatures or #result.signatures == 0 then
lspc:warn('no signature help available')
return
end