← Back to list

You’ve Been Using the WRONG LSP for C# in Neovim

More and more .NET developers are starting to notice the advantages of using Neovim as their main code editor. But let’s be honest most of…

Ricardo Serrato (Programming Headache) in .Net Programming · 2025-10-18 19:13 · 1 claps · 1.9 min read paywalled
#neovim #vim #csharp #lsp #roslyn
Open on Medium ↗

You’ve Been Using the WRONG LSP for C# in Neovim

More and more .NET developers are starting to notice the advantages of using Neovim as their main code editor. But let’s be honest most of us don’t want to waste time configuring endless settings. We want the things and we wanted now. I mean, we just want a great editor, an enjoyable coding experience, and maximum efficiency.

That’s why most developers choose the most straightforward way to set up their LSP inside Neovim: Omnisharp LSP.

Although the OmniSharp LSP has been good enough for developing inside Neovim, it has never quite matched the experience of the LSP used by VS Code or Visual Studio. However, things have changed, now you can use Roslyn LSP, which provides the same core functionality offered by VS Code and Visual Studio.

In this article I show you how to install it in just four steps. We’ll need the Lazy package manager and a basic understanding of how to install a plugin, which you can find here:

[embed]🛠️ Installation | lazy.nvim There are multiple ways to install lazy.nvim.lazy.folke.io

1. Install Mason

Mason is a plugin that allows you to easily install the LSPs you need. To install it, you just need to add the plugin:

{
    "mason-org/mason.nvim",
     opts = {}
}

Unfortunately, there is still no official mason register for Roslyn, but there are few non official registers that we can use.

We need to modify the previous code and set it up like this:

{
    "mason-org/mason.nvim",
    config = function()
        require('mason').setup({
            registries = {
                'github:Crashdummyy/mason-registry', -- this contains the register for Roslyn
                'github:mason-org/mason-registry', 
            },
        })
    end
}

2. Install Roslyn LSP

Inside Neovim, you just need to execute this command in normal mode:

:MasonInstall Roslyn

3. Install seblyng/roslyn.nvim plugin

Right now seblying plugin is the best alternative to avoid writting configuration. You just need to add this plugin.

{
    "seblyng/roslyn.nvim",
    enabled = true,
    ft = "cs",
    config = function()
        vim.lsp.config("roslyn", {
            on_attach = function()
                print("This will run when the server attaches!")
            end,
            settings = {
              -- Check settings in https://github.com/seblyng/roslyn.nvim
            },

        })
        local roslyn = require("roslyn");
        roslyn.setup();
    end
}

4. Check your configuration

Lets create a proyect to test the configuration.

dotnet new console --name roslyn

Now enter enter to neovim

nvim roslyn/Program.cs

Check if lsp is enabled running this command

:LspInfo

That’s all. You should see something like

vim.lsp: Active Clients ~
- roslyn (id: 1)
  - Version: ? (no serverInfo.version response)
  - Root directory: ~/roslyn
  - Command: { "roslyn", "--logLevel=Information", "--extensionLogDirectory=/home/ricardo/.local/state/nvim", "--stdio" }
  - Settings: {}
  - Attached buffers: 1

Links

Originally posted on:

https://programmingheadache.com/2025/10/12/must-have-functions-every-repository-pattern-needs/


메타데이터
post_id
bc9404b1f8ea
slug
youve-been-using-the-wrong-lsp-for-c-in-neovim-bc9404b1f8ea
url
https://medium.com/@nosilverbullet/youve-been-using-the-wrong-lsp-for-c-in-neovim-bc9404b1f8ea
canonical_url
https://medium.com/@nosilverbullet/youve-been-using-the-wrong-lsp-for-c-in-neovim-bc9404b1f8ea
author_url
https://medium.com/@nosilverbullet
status
ok
fetched_at
2026-07-16 13:41:57