The setup I have works fine for tsserver but not the csharp_ls
local servers = { 'tsserver', 'csharp_ls' }
local on_attach = function(client, bufnr)
vim.keymap.set('n', 'gd', ":vsplit | wincmd w | lua vim.lsp.buf.definition()<cr>", {buffer=0})
end
local lsp_flags = {
debounce_text_changes = 150,
}
for _, lsp in ipairs(servers) do
nvim_lsp[lsp].setup{
on_attach = on_attach,
flags = lsp_flags
}
end
Log confirms that the project is loading and it is getting initialized.
LSP[csharp_ls][Log] csharp-ls: OK, 1 project files loaded
LSP[csharp_ls][Log] csharp-ls: "initialized" notification received from client
But then I get the following error when trying to navigate to a definition.
Error executing vim.schedule lua callback: ...s\neovim\current\share\nvim\runtime/lua/vim/lsp/util.lua:1735: index out of range stack traceback: [C]: in function '_str_byteindex_enc' ...s\neovim\current\share\nvim\runtime/lua/vim/lsp/util.lua:1735: in function 'locations_to_items' ...ovim\current\share\nvim\runtime/lua/vim/lsp/handlers.lua:352: in function 'handler' ...p\apps\neovim\current\share\nvim\runtime/lua/vim/lsp.lua:1390: in function 'cb' vim/_editor.lua:262: in function <vim/_editor.lua:261>