CSharpLspAdapter 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global CSharpLspAdapter --version 1.0.1
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local CSharpLspAdapter --version 1.0.1
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=CSharpLspAdapter&version=1.0.1
                    
nuke :add-package CSharpLspAdapter --version 1.0.1
                    

CSharpLspAdapter

LSP adapter for csharp-ls that enables compatibility with Claude Code.

Why?

Claude Code's LSP client doesn't support several protocol methods that csharp-ls requires:

  • workspace/configuration — server requests workspace settings
  • client/registerCapability — dynamic capability registration
  • window/workDoneProgress/create — progress reporting

Without this adapter, csharp-ls hangs waiting for responses that never come.

Architecture

Claude Code  ←→  csharp-ls-adapter  ←→  csharp-ls
                      ↓
               Intercepts and handles:
               - workspace/configuration
               - client/registerCapability
               - window/workDoneProgress/create

Installation

Prerequisites

  • .NET SDK 8.0 or later
  • csharp-ls language server
# Install csharp-ls
dotnet tool install --global csharp-ls

# Install the adapter
dotnet tool install --global CSharpLspAdapter

Configure Claude Code

Add to your ~/.claude/settings.json:

{
  "lspServers": {
    "csharp": {
      "command": "csharp-ls-adapter",
      "languages": ["csharp"]
    }
  }
}

Or with environment variables:

{
  "lspServers": {
    "csharp": {
      "command": "csharp-ls-adapter",
      "languages": ["csharp"],
      "env": {
        "LSP_SOLUTION_PATH": "/path/to/your/Solution.sln",
        "LSP_ADAPTER_DEBUG": "1"
      }
    }
  }
}

Configuration

Environment Variable Description
LSP_SOLUTION_PATH Path to .sln file (optional, auto-detected if not set)
LSP_ADAPTER_DEBUG Set to 1 to enable debug logging to csharp-lsp-adapter.log in system temp directory

Supported LSP Features

  • Go to Definition
  • Find References
  • Hover Documentation
  • Document Symbols
  • Workspace Symbols
  • Diagnostics
  • Code Actions
  • Signature Help
  • Completion

Building from Source

git clone https://github.com/agasper/CSharpLspAdapter.git
cd CSharpLspAdapter
dotnet pack -c Release
dotnet tool install --global --add-source ./bin/Release CSharpLspAdapter

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.0.2 127 1/25/2026
1.0.1 82 1/24/2026
1.0.0 74 1/24/2026