Skip to content

Commit efa7eba

Browse files
committed
fix(cs): update csharpls-extended-lsp for Neovim v0.11
1 parent a560129 commit efa7eba

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

lua/astrocommunity/pack/cs/init.lua

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,25 @@ return {
2828
dependencies = {
2929
{
3030
"AstroNvim/astrolsp",
31-
opts = {
32-
config = {
33-
csharp_ls = {
31+
opts = vim.fn.has "nvim-0.11" == 1
32+
and {
3433
handlers = {
35-
["textDocument/definition"] = function(...) require("csharpls_extended").handler(...) end,
36-
["textDocument/typeDefinition"] = function(...) require("csharpls_extended").handler(...) end,
34+
csharp_ls = function(server, opts)
35+
require("lspconfig")[server].setup(opts)
36+
require("csharpls_extended").buf_read_cmd_bind()
37+
end,
38+
},
39+
}
40+
or { -- TODO: drop when dropping support for Neovim v0.10
41+
config = {
42+
csharp_ls = {
43+
handlers = {
44+
["textDocument/definition"] = function(...) require("csharpls_extended").handler(...) end,
45+
["textDocument/typeDefinition"] = function(...) require("csharpls_extended").handler(...) end,
46+
},
3747
},
3848
},
3949
},
40-
},
4150
},
4251
},
4352
},

0 commit comments

Comments
 (0)