csharp-language-server icon indicating copy to clipboard operation
csharp-language-server copied to clipboard

Fails to find LSP usages

Open SchnozzleCat opened this issue 2 years ago • 2 comments

If I try to go to the usages of a symbol that has usages outside of the current buffer, I get an exception with the following trace: Error executing vim.schedule lua callback: /usr/share/nvim/runtime/lua/vim/lsp/util.lua:1828: index out of range stack traceback: [C]: in function '_str_byteindex_enc' /usr/share/nvim/runtime/lua/vim/lsp/util.lua:1828: in function 'locations_to_items' /usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:229: in function 'handler' /usr/share/nvim/runtime/lua/vim/lsp.lua:1394: in function '' vim/_editor.lua: in function <vim/_editor.lua:0>

If the symbol is only used in that file it seems to work fine. This is a Unity project in case it matters.

SchnozzleCat avatar Jun 18 '23 17:06 SchnozzleCat

On further investigation, it sometimes does seem to work even if the symbol is outside the current buffer, but then sometimes it will throw the above exception.

I haven't been able to find a consistent pattern with this, but the project uses a lot of source generators due to it using the DOTS stack, so maybe it has something to do with that?

I'll try and find a pattern and update this if I find one.

SchnozzleCat avatar Jun 20 '23 00:06 SchnozzleCat

@SchnozzleCat I am having the same issue without any code generators, but with two csproj's in a single solution.

Joseph-Melberg avatar Mar 17 '24 17:03 Joseph-Melberg