Skip to content

Multiple clients with the same root directory #302

@malansee

Description

@malansee

Description

Issue created in reference to #301

When working with plugins such as fugitive and opening a vertical diff, one fugitive:// scheme buffer and one real file backed buffer are created at the same time. This results in roslyn attaching to 2 active clients (for the same root directory).

To reproduce, run nvim using the minimal config for a dotnet git repo with unstaged .cs changes. Run the Git command (added via fugitive in the minimal config), move the cursor to an unstaged .cs line, and press dv to show the split.

Finally run checkhealth vim.lsp and examine the active clients.

Neovim version

NVIM v0.11.6

Operating system and version

macOS 15.0 (24A335)

Expected behavior

Should only attach a single active client

Actual behavior

Attaches multiple clients with the same root directory (result of checkhealth vim.lsp)

vim.lsp: Active Clients

  • roslyn (id: 1)
    • Version: ? (no serverInfo.version response)
    • Root directory: ~/Developer/TestProjects/FugitiveTest
    • Attached buffers: 6
  • roslyn (id: 2)
    • Version: ? (no serverInfo.version response)
    • Root directory: ~/Developer/TestProjects/FugitiveTest
    • Attached buffers: 7

Minimal config

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
  spec = {
    {
      "mason-org/mason.nvim",
      opts = {
        registries = {
          "github:mason-org/mason-registry",
          "github:crashdummyy/mason-registry",
        },
      },
    },
    {
      "seblyng/roslyn.nvim",
      init = function()
        vim.filetype.add({
          extension = {
            razor = "razor",
            cshtml = "razor",
          },
        })
      end,
    },
    {
      "tpope/vim-fugitive",
      cmd = { "Git" },
    },
  },
})

Roslyn checkhealth

roslyn.nvim: Requirements
- ✅ OK Neovim >= 0.11
- ✅ OK dotnet SDK >= 10 (found 10.0.100)

roslyn.nvim: Roslyn Language Server
- ✅ OK roslyn: found
- ⚠️ WARNING Razor extension not found
  - ADVICE:
    - Razor support will be limited.                                                                                                                  - Install the roslyn package via Mason to get the Razor extension.
- ✅ OK vscode-html-language-server: found
- ⚠️ WARNING html-lsp client not configured
  - ADVICE:
    - Razor HTML support will be limited.
    - Consider configuring the html-lsp client for better Razor support.

roslyn.nvim: File Watching Configuration
- File watching: auto (using Neovim's file watcher)

roslyn.nvim: Solution Detection
- ✅ OK Selected solution

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions