🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

C# LSP

by @leafbird

C# language server providing code intelligence, diagnostics, and navigation for .cs and .csx files. Uses csharp-ls (lightweight Roslyn-based). Requires .sln...

Versionv1.2.0
πŸ’‘ Examples

# Set workspace to the directory containing .sln/.csproj
export LSP_WORKSPACE=/path/to/project

Go to definition

lsp-query definition src/Program.cs 15 8

Find all references

lsp-query references src/Models/User.cs 42 10

Type info / hover

lsp-query hover src/Services/AuthService.cs 30 22

List symbols in a file

lsp-query symbols src/Program.cs

Search symbols across workspace

lsp-query workspace-symbols "UserService"

Compiler diagnostics

lsp-query diagnostics src/Program.cs

Check running servers

lsp-query servers

Shut down daemon

lsp-query shutdown

Line/column numbers are 1-indexed.

βš™οΈ Configuration

Run the one-time setup script (idempotent β€” safe to re-run):

bash {baseDir}/scripts/setup.sh           # setup only
bash {baseDir}/scripts/setup.sh --verify  # setup + verification test

What it does: 1. Checks for .NET SDK 2. Installs csharp-ls via dotnet tool install --global 3. Registers ~/.dotnet/tools in PATH 4. Creates lsp-query symlink 5. Creates cache directory

πŸ“‹ Tips & Best Practices

  • Install fails (DotnetToolSettings.xml): Pin version with dotnet tool install --global csharp-ls --version 0.20.0
  • Empty results: Check that LSP_WORKSPACE points to a directory with .sln or .csproj
  • Slow first query: Normal β€” Roslyn project loading takes 30–60s for large solutions
  • PATH issues: Add export PATH="$PATH:$HOME/.dotnet/tools" to your shell profile
  • Stale daemon: Run lsp-query shutdown and retry
  • View on ClawHub
    TERMINAL
    clawhub install csharp-lsp

    πŸ§ͺ Use this skill with your agent

    Most visitors already have an agent. Pick your environment, install or copy the workflow, then run the smoke-test prompt above.

    πŸ” Can't find the right skill?

    Search 60,000+ AI agent skills β€” free, no login needed.

    Search Skills β†’