Closed scottming closed 1 year ago
diff --git a/lua/lspsaga/definition.lua b/lua/lspsaga/definition.lua
index 2d26f48..a788e2a 100644
--- a/lua/lspsaga/definition.lua
+++ b/lua/lspsaga/definition.lua
@@ -223,10 +223,10 @@ function def:definition_request(method, handler_T, args)
end)
end
-function def:peek_handler(result, context, count)
+function def:peek_handler(res, context, count)
count = count - 1
self.pending_request = false
- if not result or next(result) == nil then
+ if not res or next(res) == nil then
if #self.list == 0 and count == 0 then
vim.notify(
'[lspsaga] response of request method ' .. context.method .. ' is empty',
@@ -235,8 +235,10 @@ function def:peek_handler(result, context, count)
end
return
end
- if result.uri then
- result = { result }
+
+ local result = {}
+ if not vim.tbl_islist(res) then
+ result = { res }
end
local node = {
does this solved ?
does this solved ?
no, I opened a PR for this.
Describe the bug
I just found this commit: https://github.com/nvimdev/lspsaga.nvim/commit/442e63750ddd14f22511dc509e226d71e6c36d5f# broke the
peek_definition
for ElixirIs it because of these lines:
https://github.com/nvimdev/lspsaga.nvim/commit/442e63750ddd14f22511dc509e226d71e6c36d5f#diff-dc22d75dcfeb427a63be2c3167fcecf2a2493423132544dde7d88d8e87981400L229-L231
, as I reported before, according to the spec,
Location
is valid response to return: https://github.com/nvimdev/lspsaga.nvim/issues/934#issuecomment-1455694543Steps to reproduce
the response for lexical LSP is:
Expected behavior
show the peeked window.
Neovim version (nvim -v)
0.9.2
lspsaga commit
442e63750ddd14f22511dc509e226d71e6c36d5f
Terminal name/version
alacritty