Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with telescope #7

Open
searleser97 opened this issue Nov 13, 2023 · 7 comments
Open

Doesn't work with telescope #7

searleser97 opened this issue Nov 13, 2023 · 7 comments

Comments

@searleser97
Copy link

searleser97 commented Nov 13, 2023

This plugin works correctly when we are not using Telescope to list definitions, but it throws an error when we try to use telescope

image

Error executing vim.schedule lua callback: ...-nightly/current/share/nvim/runtime/lua/vim/lsp/util.lua:1198: Cursor position outside buffer
stack traceback:
        [C]: in function 'nvim_win_set_cursor'
        ...-nightly/current/share/nvim/runtime/lua/vim/lsp/util.lua:1198: in function 'jump_to_location'
        ...anc/forks/telescope.nvim/lua/telescope/builtin/__lsp.lua:210: in function 'handler'
        ...eovim-nightly/current/share/nvim/runtime/lua/vim/lsp.lua:1502: in function 'cb'
        vim/_editor.lua:324: in function <vim/_editor.lua:323>
@Decodetalkers
Copy link
Owner

sorry for have view this issue for so long time. I will take a view recently.. sorry for that

@Spycemyster
Copy link

Is this when looking up class definitions for source-generated classes? I'm getting this issue too on Godot C# scripts when I try to go to a partial class.

@Decodetalkers
Copy link
Owner

Decodetalkers commented Mar 27, 2024

Emm.. I have no cludes to fix it.. can you provide the code in telescope? telescope doesn't come to the handler, and lspsaga do not have problem..

I see, it use another api.. I will do it

@Decodetalkers
Copy link
Owner

I think it is telescope's problem

https://github.com/nvim-telescope/telescope.nvim/blob/master/lua/telescope/builtin/__lsp.lua#L131-L149

it request data directly from neovim, do not from the handlers by nvim-lspconfig.. maybe, it never request from me

@Decodetalkers
Copy link
Owner

find the code in neovim

local function request_with_options(name, params, options)
  local req_handler
  if options then
    req_handler = function(err, result, ctx, config)
      local client = vim.lsp.get_client_by_id(ctx.client_id)
      local handler = client.handlers[name] or vim.lsp.handlers[name]
      handler(err, result, ctx, vim.tbl_extend('force', config or {}, options))
    end
  end
  request(name, params, req_handler)
end

all right, the pr is mime

@Decodetalkers
Copy link
Owner

Decodetalkers commented Mar 30, 2024

nvim-telescope/telescope.nvim#2770

it is the problem of telescope, and there is already a pr for it

@Spycemyster
Copy link

It seems the issue has to do with multiple values being returned when finding a C# partial class that has other source-generated classes. I created a temporary fix for "go to definition" that just chooses the first value returned here https://github.com/Spycemyster/dotnet-goto.nvim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants