Open gbelouze opened 2 weeks ago
This is how otter starts language servers: https://github.com/jmbuhr/otter.nvim/blob/ca9ce67d0399380b659923381b58d174344c9ee7/lua/otter/init.lua#L154-L163
meaning it just calls the autocommand set by lspconfig via the respective setup call. Can you verify that this is indeed called by adding a print in there?
But, I do believe this is indeed currently a bug. What happens is this:
Otter checks that at least one server attached to the otter buffer for the language supports the requested method: https://github.com/jmbuhr/otter.nvim/blob/ca9ce67d0399380b659923381b58d174344c9ee7/lua/otter/lsp/init.lua#L116-L128 So, in your case, do you have other servers configured that have hover enabled?
Because eventually the request is forwarded to the buffer: https://github.com/jmbuhr/otter.nvim/blob/ca9ce67d0399380b659923381b58d174344c9ee7/lua/otter/lsp/init.lua#L156-L159 and it looks like this circumvents the capabilties-check.
Thank you for your quick response. I indeed did not mention that I use pylsp
which has hover capabilities.
This is made a little more complex by the additional layer that mason-lspconfig
brings but I can say that the on_attach
function is not called when opening a .qmd
file (but is when opening .py
files). This might be a me-issue, I'll investigate, although the bug you highlighted still holds in any case.
You can also try it with the buffers.set_filetype
option of otter, in which case otter just set's the filetype of the language buffer instead of manually calling just the lspconfig attach autocommand.
First of all, thanks for this great plugin.
It seems that my LSP configuration is not respected with otter. I use
mason-lsp-config
if this is relevant.Example
With something like
I do not get hover from
ruff_lsp
on normal python files, which is intentional, but I do in python cells of a .qmd file. Note : if I open a python file, thenon_attach
from the above config is called and I not longer getruff_lsp
's hover in the .qmd files.Is there a way LSPs should be configured so that their configuration is taken into account by
otter
?