Reputation: 11
I am trying to set up my go to definition for omnisharp. I read in the docs that I need to get omnisharp extended for the go to definition functionality to work, however I'm still getting this error. My LSP is working fine. My go to definition works with every other lsp. I'm only having issues here.
Here's my config:
require('mason-lspconfig').setup {
handlers = {
omnisharp = function()
local config = {
['textDocument/definition'] = require('omnisharp_extended').definition_handler,
['textDocument/typeDefinition'] = require('omnisharp_extended').type_definition_handler,
['textDocument/references'] = require('omnisharp_extended').references_handler,
['textDocument/implementation'] = require('omnisharp_extended').implementation_handler,
}
require('lspconfig').omnisharp.setup(config)
end,
function(server_name)
local server = servers[server_name] or {}
-- This handles overriding only values explicitly passed
-- by the server configuration above. Useful when disabling
-- certain features of an LSP (for example, turning off formatting for ts_ls)
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
require('lspconfig')[server_name].setup(server)
end,
},
}
And here is the error that I am getting:
Error executing vim.schedule lua callback: ...ar/neovim/0.10.2/share/nvim/runtime/lua/vim/lsp/util.lua:1142: Curs
or position outside buffer
stack traceback:
[C]: in function 'nvim_win_set_cursor'
...ar/neovim/0.10.2/share/nvim/runtime/lua/vim/lsp/util.lua:1142: in function 'jump_to_location'
...nvim/lazy/telescope.nvim/lua/telescope/builtin/__lsp.lua:187: in function 'handler'
.../neovim/0.10.2/share/nvim/runtime/lua/vim/lsp/client.lua:687: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
Once I hit enter it just takes me to an empty screen. I've already ensured that my Lsp is attached and I've also made sure the omnisharp_extended is installed. Any ideas?
Upvotes: 0
Views: 94
Reputation: 11
For anyone dealing with this problem, make sure you have omnisharp-extended downloaded. Once you do that, whenever omnisharp is attached to your buffers, override the default omnisharp handlers with the omnisharp extended ones. This should fix your issue.
Upvotes: 0