We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I would like go to definition to work properly with C#, needs https://github.com/Decodetalkers/csharpls-extended-lsp.nvim.
Doing :lua require('csharpls_extended').lsp_definitions() on a symbol makes it go to the decompiled version.
:lua require('csharpls_extended').lsp_definitions()
Go to definition will work for non-project code in C#.
I have tried setting it up to override the textDocument/definition lsp_handler like so:
textDocument/definition
{ "Decodetalkers/csharpls-extended-lsp.nvim", lazy = false, dependencies = { "AstroNvim/astrolsp", opts = { config = { csharp_ls = { handlers = { ["textDocument/definition"] = function(...) require("csharpls_extended").handler(...) end, ["textDocument/typeDefinition"] = function(...) require("csharpls_extended").handler(...) end, }, }, }, }, }, },
However this isn't working. I've also tried this with no success:
opts = function(_, opts) if not opts.lsp_handlers then opts.lsp_handlers = {} end local definition_event = "textDocument/definition" local definition_event_original = opts.lsp_handlers[definition_event] or vim.lsp.handlers[definition_event] opts.lsp_handlers[definition_event] = function(err, result, ctx, config) print("Definition handler") local client = vim.lsp.get_client_by_id(ctx.client_id) if client and vim.tbl_contains({ "csharp_ls", }, client.name) then require("csharpls_extended").handler(err, result, ctx, config) end definition_event_original(err, result, ctx, config) end local type_definition_event = "textDocument/typeDefinition" local type_definition_event_original = opts.lsp_handlers[type_definition_event] or vim.lsp.handlers[type_definition_event] opts.lsp_handlers[type_definition_event] = function(err, result, ctx, config) print("TypeDefinition handler") local client = vim.lsp.get_client_by_id(ctx.client_id) if client and vim.tbl_contains({ "csharp_ls", }, client.name) then require("csharpls_extended").handler(err, result, ctx, config) end type_definition_event_original(err, result, ctx, config) end end,
The text was updated successfully, but these errors were encountered:
csharpls-extended-lsp.nvim
Successfully merging a pull request may close this issue.
Is your feature related to a problem?
I would like go to definition to work properly with C#, needs https://github.com/Decodetalkers/csharpls-extended-lsp.nvim.
Doing
:lua require('csharpls_extended').lsp_definitions()
on a symbol makes it go to the decompiled version.Describe the new feature
Go to definition will work for non-project code in C#.
Additional context
I have tried setting it up to override the
textDocument/definition
lsp_handler like so:However this isn't working. I've also tried this with no success:
The text was updated successfully, but these errors were encountered: