nvimdev / nvimdev/lspsaga.nvim

Unable to jump to definition with denols

Open
#1,440 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Lua
Stars
3.8k
Forks
308
PR merge metrics
No merged PRs in 30d

Description

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

20123469a65b7b8e5a83e9fbd24c5dc7219eaf63

Terminal name/version

wezterm 20240203-110809-5046fc22

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in lua/lspsaga/definition.lua and compare its definition handling with the denols-specific logic in the linked nvim-lspconfig server configuration. Reproduce with :Lspsaga goto_definition() and :lua vim.lsp.buf.definition() on a Deno file, then verify that goto_definition and peek_definition handle denols targetUri values consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.