π¦ 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...
π‘ Examples
# Set workspace to the directory containing .sln/.csproj
export LSP_WORKSPACE=/path/to/projectGo to definition
lsp-query definition src/Program.cs 15 8Find all references
lsp-query references src/Models/User.cs 42 10Type info / hover
lsp-query hover src/Services/AuthService.cs 30 22List symbols in a file
lsp-query symbols src/Program.csSearch symbols across workspace
lsp-query workspace-symbols "UserService"Compiler diagnostics
lsp-query diagnostics src/Program.csCheck running servers
lsp-query serversShut 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
DotnetToolSettings.xml): Pin version with dotnet tool install --global csharp-ls --version 0.20.0LSP_WORKSPACE points to a directory with .sln or .csprojexport PATH="$PATH:$HOME/.dotnet/tools" to your shell profilelsp-query shutdown and retryTERMINAL
clawhub install csharp-lsp