Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not try to index empty location #221

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lua/sg/lsp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,19 @@ M.get_client_id = function()
-- have an error when we try to navigate synchronously to the location
-- via the normal way LSPs navigate
["textDocument/definition"] = function(_, result, ctx, config_)
-- No location returned, so just quit
if not result then
return
end

if vim.tbl_islist(result) then
-- Don't do anything we have empty results, that's weird
for _, res in ipairs(result) do
if not res then
return
end
end

-- Wait for all to complete
local count = 0
for _, res in ipairs(result) do
Expand Down
Loading