Back to the catalog

csharp-roslyn-lsp

C# language server using Microsoft's official roslyn-language-server — the same LSP engine that powers VS Code's C# extension. Provides go-t

Open source Open in the app JSON README (API)

About

C# language server using Microsoft's official roslyn-language-server — the same LSP engine that powers VS Code's C# extension. Provides go-to-definition, find-references, call hierarchy, and real-time diagnostics for C# codebases.

Details

Kind
Plugins
Topic
Developer tools
Publisher
burhancetinkaya
Origin
marketplace
Category
ferramentas
Stars
2
Forks
1
Last push
2026-03-28T13:51:00Z
Repository state
ativo
License
MIT
Added
2026-08-30 01:48:58
Updated
2026-08-30 01:48:58
Origin id
burhancetinkaya/csharp-roslyn-lsp/csharp-roslyn-lsp

README

# csharp-roslyn-lsp

A Claude Code plugin that integrates Microsoft's official **roslyn-language-server** — the same C# language server that powers the VS Code C# extension and C# Dev Kit.

This gives Claude Code semantic understanding of your C# codebase: go-to-definition, find-references, call hierarchy, and real-time diagnostics — instead of relying on grep.

## Why this plugin?

The official Claude Code marketplace ships a `csharp-lsp` plugin based on the community `csharp-ls` server, but it has [packaging issues](https://github.com/anthropics/claude-code/issues/15359) and [missing LSP handler support](https://github.com/anthropics/claude-code/issues/16360). This plugin uses Microsoft's **roslyn-language-server** which is more feature-complete and actively maintained as part of the [dotnet/roslyn](https://github.com/dotnet/roslyn) project.

> **Credit:** Based on [jrusbatch's integration guide](https://gist.github.com/jrusbatch/1d2c539ef17476c8703f04a2e9148693), simplified for one-command installation with no absolute paths.

## Prerequisites

| Requirement | Version | Check |
|---|---|---|
| .NET SDK | **10.0+** | `dotnet --version` |
| Claude Code | **2.1.50+** | `claude --version` |

> .NET SDK 10.0 download: https://dotnet.microsoft.com/download

## Quick Start

### 1. Install the language server

```bash
dotnet tool install --global roslyn-language-server --prerelease
```

Verify it's on your PATH:

```bash
# Linux / macOS
which roslyn-language-server

# Windows (PowerShell)
where.exe roslyn-language-server
```

If not found, add the .NET tools directory to your PATH:

```bash
# Linux / macOS — add to ~/.bashrc or ~/.zshrc:
export PATH="$PATH:$HOME/.dotnet/tools"

# Windows — usually added automatically, but verify:
# %USERPROFILE%\.dotnet\tools should be in your PATH
```

### 2. Install the plugin

```bash
# Open Claude Code
claude

# Add this marketplace
/plugin marketplace add burhancetinkaya/csharp-roslyn-lsp
```

Then exit and install:

```bash
claude plugin install -s user csharp-roslyn-lsp
```

### 3. Verify

```bash
claude
```

Run `/plugin` → go to the **Installed** tab. You should see:

```
csharp-roslyn-lsp Plugin · csharp-roslyn-marketplace · ✔ enabled
```

Test it by asking Claude:

```
Run the C# LSP documentSymbol operation on src/MyService.cs
```

You should see output like:

```
● LSP(operation: "documentSymbol", file: "src/MyService.cs")
```

## Supported LSP Operations

These are the operations Claude Code supports as of v2.1.62+:

| Operation | Status | Description |
|---|---|---|
| `documentSymbol` | ✅ Stable | List all classes, methods, properties in a file |
| `workspaceSymbol` | ✅ Stable | Search for symbols by name across the workspace |
| `prepareCallHierarchy` | ✅ Stable | Start a call hierarchy at a position |
| `incomingCalls` | ✅ Stable | Find all callers of a method |
| `outgoingCalls` | ✅ Stable | Find all methods called by a method |
| `goToDefinition` | ⚠️ Partial | Works sometimes, may hang on large solutions |
| `findReferences` | ⚠️ Partial | Works sometimes, may hang on large solutions |
| `hover` | ⚠️ Partial | Works sometimes, may hang on large solutions |
| `goToImplementation` | ⚠️ Partial | Find implementations of interfaces/abstract methods |

> **Why "Partial"?** Claude Code's LSP client doesn't yet implement `workspace/configuration`, `client/registerCapability`, and `window/workDoneProgress/create`. Structural operations (documentSymbol, workspaceSymbol, call hierarchy) work because they don't need full project graph analysis. Semantic operations sometimes hang waiting for responses that never come. Tracked at [#16360](https://github.com/anthropics/claude-code/issues/16360).

## Project Structure

```
csharp-roslyn-lsp/
├── .claude-plugin/
│   └── marketplace.json            ← Marketplace catalog
├── plugins/
│   └── csharp-roslyn-lsp/
│       ├── .claude-plugin/
│       │   └── plugin.json         ← Plugin metadata
│       ├── .lsp.json               ← LSP server config
│       └── README.md
├── LICENSE
└── README.md                       ← You are here
```

## Configuration Notes

**No absolute paths.** Unlike many LSP setups, this plugin uses just `roslyn-language-server` as the command — it resolves from your PATH. No need to hardcode `~/.dotnet/tools/roslyn-language-server.cmd`.

**Startup timeout is 120 seconds.** Roslyn needs to index your solution on first launch. For large solutions (100+ projects) this can take up to 2 minutes. Subsequent startups are faster thanks to caching.

**Log level is set to Warning.** Change to `Information` in both `.claude-plugin/marketplace.json` and `plugins/csharp-roslyn-lsp/.lsp.json` if you need to debug. Keep them in sync.

**Windows users:** The `dotnet tool install` command creates `roslyn-language-server.cmd` on Windows. Claude Code resolves `.cmd` extensions automatically — no changes needed.

## Troubleshooting

**"Executable not found in $PATH"** in `/plugin` Errors tab:
- Run `dotnet tool list -g` and confirm `roslyn-language-server` is listed
- Run `which roslyn-language-server` (or `where.exe` on Windows) to check PATH
- Restart your terminal after adding PATH entries

**LSP operations hang or return empty:**
- This is the known Claude Code client limitation (#16360), not a plugin bug
- `documentSymbol` and `workspaceSymbol` should always work
- If semantic operations hang, Claude will fall back to grep automatically

**"No LSP server available for file type":**
- Make sure you ran `claude plugin install -s user csharp-roslyn-lsp`
- Check `/plugin` → Installed tab shows the plugin as enabled
- Try `/reload-plugins` or restart Claude Code

**Solution not loading:**
- Roslyn needs a `.sln` or `.csproj` file in or above your working directory
- Run Claude Code from the solution root directory

## Related Resources

- [roslyn-language-server on NuGet](https://www.nuget.org/packages/roslyn-language-server)
- [dotnet/roslyn on GitHub](https://github.com/dotnet/roslyn)
- [Claude Code LSP documentation](https://code.claude.com/docs/en/plugins-reference.md)
- [Claude Code plugin marketplace docs](https://code.claude.com/docs/en/plugin-marketplaces)
- [Original integration guide by jrusbatch](https://gist.github.com/jrusbatch/1d2c539ef17476c8703f04a2e9148693)
- [Issue #16360 — missing LSP handlers](https://github.com/anthropics/claude-code/issues/16360)
- [Issue #15359 — broken official csharp-lsp plugin](https://github.com/anthropics/claude-code/issues/15359)

## Contributing

PRs welcome. If you find a workaround for the semantic operation hangs or a better Roslyn configuration, please open an issue or PR.

## License

MIT

More