You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example I'm tempted to use multiple Python LSP engines (pyright and ruff and pylsp for example).
First, I found that the way I was doing my binds was causing the go to definition to go twice, and this is because two of my LSPs configured had the definition to go to, so technically this wasn't a bug.
I set this bind in a function which is given as on_attach to require('mason-lspconfig').setup_handlers' default handler:
local lsp_attach = function (x, bufnr)
local engine = x.name;
<...>
vim.keymap.set('n', 'gd', function ()
print ("gd called", engine)
telescope_builtin.lsp_definitions({ jump_type = "split" })
end, ext(bufopts, "desc", "Go to Definition(s)"))
(where ext is
local ext = function(table, key, value)
local tbl = table
tbl[key] = value
return tbl
end
)
I haven't quite exactly produced the logs that prove to me that it's doubling up on key binds that was causing the behavior I saw of opening the definition in a split twice, but... well, it did stop doing that once I uninstalled pylsp. Anyway, I think it's fair to say that we do need to get creative in order to cleanly enable multiple LSPs whose functionality overlap. So far I am digging the stacking of diagnostics in Trouble.nvim and stuff like that so I'm leaning towards trying to see if it's possible to dual/triple-wield LSPs.
What are some techniques to do that? Should I just try to use a simple lua table to keep track of the number of LSPs becoming active for a buffer and start assigning some different keymaps so I can choose which LSP server's gotodefinition to use?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
For example I'm tempted to use multiple Python LSP engines (pyright and ruff and pylsp for example).
First, I found that the way I was doing my binds was causing the go to definition to go twice, and this is because two of my LSPs configured had the definition to go to, so technically this wasn't a bug.
I set this bind in a function which is given as
on_attach
torequire('mason-lspconfig').setup_handlers
' default handler:(where
ext
is)
I haven't quite exactly produced the logs that prove to me that it's doubling up on key binds that was causing the behavior I saw of opening the definition in a split twice, but... well, it did stop doing that once I uninstalled pylsp. Anyway, I think it's fair to say that we do need to get creative in order to cleanly enable multiple LSPs whose functionality overlap. So far I am digging the stacking of diagnostics in Trouble.nvim and stuff like that so I'm leaning towards trying to see if it's possible to dual/triple-wield LSPs.
What are some techniques to do that? Should I just try to use a simple lua table to keep track of the number of LSPs becoming active for a buffer and start assigning some different keymaps so I can choose which LSP server's gotodefinition to use?
Beta Was this translation helpful? Give feedback.
All reactions