Skip to content

Commit c972730

Browse files
Swap Omnisharp for Roslyn
1 parent 7e2f236 commit c972730

File tree

3 files changed

+7
-34
lines changed

3 files changed

+7
-34
lines changed

nvim/lazy-lock.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
2222
"nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" },
2323
"oil.nvim": { "branch": "master", "commit": "7e1cd7703ff2924d7038476dcbc04b950203b902" },
24-
"omnisharp-extended-lsp.nvim": { "branch": "main", "commit": "a47388e5417e7f1cfa6962cc441a23c4c5fb2151" },
2524
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
25+
"roslyn.nvim": { "branch": "main", "commit": "7deb9bb5b6afcb3c03c70741c6d364ffd8b59bda" },
2626
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
2727
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
2828
"tree-sitter-d2": { "branch": "main", "commit": "ffb66ce4c801a1e37ed145ebd5eca1ea8865e00f" }

nvim/lua/plugins/csharp.lua

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -40,43 +40,12 @@ end
4040

4141
local function install_lsp_and_dap_if_needed()
4242
require("installer").install_if_missing({
43-
"omnisharp", -- LSP
43+
-- "roslyn", -- LSP Needs to be manually installed from the Mason gui?
4444
"netcoredbg", -- DAP
4545
})
4646
end
4747

4848
local function configure_lsp()
49-
local lsp = require("plugins.language-server")
50-
51-
vim.lsp.config("omnisharp", {
52-
cmd = {
53-
vim.fn.executable("OmniSharp") == 1 and "OmniSharp" or "omnisharp",
54-
"-z", -- https://github.com/OmniSharp/omnisharp-vscode/pull/4300
55-
"--hostPID",
56-
tostring(vim.fn.getpid()),
57-
"DotNet:enablePackageRestore=false",
58-
"--encoding",
59-
"utf-8",
60-
"--languageserver",
61-
},
62-
on_attach = function(client, bufnr)
63-
-- https://github.com/OmniSharp/omnisharp-roslyn/issues/2483#issuecomment-1492605642
64-
local tokenModifiers = client.server_capabilities.semanticTokensProvider.legend.tokenModifiers
65-
for i, v in ipairs(tokenModifiers) do
66-
local tmp = string.gsub(v, " ", "_")
67-
tokenModifiers[i] = string.gsub(tmp, "-_", "")
68-
end
69-
local tokenTypes = client.server_capabilities.semanticTokensProvider.legend.tokenTypes
70-
for i, v in ipairs(tokenTypes) do
71-
local tmp = string.gsub(v, " ", "_")
72-
tokenTypes[i] = string.gsub(tmp, "-_", "")
73-
end
74-
lsp.on_attach(client, bufnr)
75-
end,
76-
handlers = {
77-
["textDocument/definition"] = require("omnisharp_extended").handler,
78-
},
79-
})
8049
vim.lsp.enable("omnisharp")
8150
end
8251

@@ -131,6 +100,6 @@ return {
131100
ft = "cs",
132101
virtual = true,
133102
dependencies = {
134-
"hoffs/omnisharp-extended-lsp.nvim", -- improve c# lsp
103+
"seblyng/roslyn.nvim", -- c# lsp
135104
},
136105
}

nvim/lua/plugins/mason.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ local function configure()
1313
ui = {
1414
border = "rounded",
1515
},
16+
registries = {
17+
"github:mason-org/mason-registry",
18+
"github:Crashdummyy/mason-registry", -- For roslyn
19+
},
1620
})
1721

1822
mason_lsp_config.setup({

0 commit comments

Comments
 (0)