Open paopaol opened 2 years ago
That's your LSP responding with an error, I dont believe thats calltrees error
I'm facing the exact same issue. Also only triggered when I try to expand.
Neovim: 0.8
ray-x/navigator.lua
to start lsp server gopls
won't have this problem.lspconfig
, the error comes back.I'm facing the exact same issue. Also only triggered when I try to expand.
Neovim: 0.8
- Use this plugin
ray-x/navigator.lua
to start lsp servergopls
won't have this problem.- But start lsp server with
lspconfig
, the error comes back.
Solved by keeping only one lsp server.
After tracing the code, the problem is caused by this LSP request function in expand_calltree
function
function M.expand_calltree()
...
lib_lsp.multi_client_request(
ctx.state["calltree"].active_lsp_clients,
direction_map[ctx.state["calltree"].direction].method,
{item = ctx.node.call_hierarchy_item},
handlers.calltree_expand_handler(ctx.node, ctx.cursor, ctx.state["calltree"].direction, ctx.state),
ctx.state["calltree"].buf
)
vim.api.nvim_win_set_cursor(ctx.state["calltree"].win, ctx.cursor)
end
In my use cases, if I enable golangci-lint-ls
and gopls
lsp server at the same time, the request to golangci-lint-ls
will obviously fail to handle the request and it triggers the error msg in the screenshot.
After removing the golangci_lint_ls
setup in lspconfig
, the problem is resolved.
local servers = {
...
-- 'golangci_lint_ls',
'gopls',
...
}
for _, lsp in ipairs(servers) do
local opts = {
on_attach = on_attach,
capabilities = capabilities,
flags = {
-- This will be the default in neovim 0.7+
debounce_text_changes = 150,
}
}
local custom_opts_file = "user.lsp.server-settings." .. lsp
local ok, custom_opts = pcall(require, custom_opts_file)
if ok then
opts = vim.tbl_deep_extend("force", custom_opts, opts)
end
lspconfig[lsp].setup(opts)
end
Any progress on this? It seems https://github.com/ldelossa/litee.nvim/issues/100 seems like the solution but it's a bit annoying that the plugin doesn't work in case of also having a lint LSP server that doesn't support this method.
I think the problem is that https://github.com/neovim/neovim/blob/master/runtime/lua/vim/lsp.lua#L48 doesn't list the incomingCalls and outgoingCalls method but only the prepareCallHierarchy method
I have a PR up for the neovim side: https://github.com/neovim/neovim/pull/22427
when i type
tab
, i got below errormy neovim version is 0.8