This plugin adds support for the new Roslyn-based C# language server introduced in the vscode C# extension.
Requires Neovim 0.10
You need to install the language server yourself. I did this by installing C#
dev kit on vscode. I then checked htop
and found the .dll file that was ran.
Move the entire directory with all the binaries to
~/.local/share/nvim/roslyn
. The path to the dll that this plugin runs is:
~/.local/share/nvim/roslyn/Microsoft.CodeAnalysis.LanguageServer.dll
Install seblj/roslyn.nvim
using your plugin manager.
require("roslyn").setup({
-- Optional. Will use `vim.lsp.protocol.make_client_capabilities()`,
-- and it will also try to merge that with `nvim-cmp` LSP capabilities
capabilities = nil,
})
- The plugin will look for a
.sln
file in parent directories until it finds one. Make sure to have a.sln
file somewhere in a parent dir. - If it only finds one
.sln
file, it will use that to start the server. If it finds multiple, you have to runCSTarget
to choose which target you want to use. - You'll see two notifications if everything goes well. The first one will say
Roslyn client initialized for target <target>
, which means the server is running, but it will just start indexing yoursln
. The second one will sayRoslyn project initialization complete
, it means that the server indexed yoursln
, only after you see the second notification will thego to definition
and other lsp features be available.
Please note that some features from the vscode extension might not be supported by this plugin.