Decodetalkers / csharpls-extended-lsp.nvim

decompile for csharp_ls
MIT License
48 stars 6 forks source link

Doesn't work with telescope #7

Open searleser97 opened 10 months ago

searleser97 commented 10 months ago

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 commented 8 months ago

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

Spycemyster commented 7 months ago

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 commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

https://github.com/nvim-telescope/telescope.nvim/pull/2770

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

Spycemyster commented 5 months ago

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