fix lsp_code_action error when no code action available (#243)
the results variable can be nil when there's no code action available, check for nil results before checking the length
This commit is contained in:
@@ -229,7 +229,7 @@ builtin.lsp_code_actions = function(opts)
|
||||
|
||||
local results = (results_lsp[1] or results_lsp[2]).result;
|
||||
|
||||
if #results == 0 then
|
||||
if not results or #results == 0 then
|
||||
print("No code actions available")
|
||||
return
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user