nvimdev / lspsaga.nvim

improve neovim lsp experience

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to jump to definition with denols

Ttayu opened this issue · comments

commented

Describe the bug

I am unable to jump to definition using :Lspsaga goto_definition() with the denols language server, although :lua vim.lsp.buf.definition() works fine for jumping to function definitions with lspconfig.
This seems to be because the targetUri returned by denols is special, and the standard textDocument/definition is unable to handle it for jumping.
In lspconfig, a special function is implemented specifically for denols to handle this case, as shown in this line

However, lspsaga does not have this special handling (Line) , which is likely why jumping to definition does not work with denols.
I would appreciate if this could be looked into and support for the denols targetUri format could be added to lspsaga for seamless definition jumping.

Steps to reproduce

  1. Install denols.
  2. open deno file (e.g. deps.ts) .
  3. :Lspsaga goto_definition()
  4. :lua vim.lsp.buf_definition()

Expected behavior

it should be able to jump to the definition as well as :lua vim.lsp.buf.definition().
It should also be possible to jump to another method such as peek_definition in the same way.

Neovim version (nvim -v)

v0.10.0-dev-2698+g00e71d3da

lspsaga commit

2012346

Terminal name/version

wezterm 20240203-110809-5046fc22