Contributing & Building from Source
This page is for contributors who want to build SharpLsp from source. If you just want to use SharpLsp, install the VS Code extension β it ships with everything bundled.
Prerequisites
- Rust (stable, latest) β install via rustup
- .NET 10.0 SDK β download
- Node 20 β for the VS Code extension
Recommended: Dev Container
The fastest path is the included dev container. It comes pre-configured with Rust, .NET 10 SDK, Node 20, and all required tooling.
- Install Docker and the Dev Containers extension
- Open the repository in VS Code
- Click Reopen in Container when prompted
Manual Setup
# Build the Rust LSP host
cargo build
# Run clippy lints
cargo clippy
# Run tests
cargo test
# Build the VS Code extension VSIX
cd editors/vscode && npm install && npm run compile
Repository Structure
sharplsp/
βββ src/ # Rust LSP host
βββ sidecars/
β βββ SharpLsp.Sidecar.FSharp/ # F# sidecar (FSharp.Compiler.Service)
β βββ SharpLsp.Sidecar.CSharp/ # C# sidecar (Roslyn)
β βββ SharpLsp.Sidecar.Common/ # Shared sidecar code
βββ editors/
β βββ vscode/ # VS Code extension (TypeScript)
β βββ zed/ # Zed extension (Rust β wasm32-wasip1)
βββ docs/ # Specs and implementation plans
βββ tests/ # E2E tests
βββ website/ # This site
Architecture
Three-tier architecture:
- Tier 1 β Rust LSP Host: LSP connection (JSON-RPC over stdio), VFS, tree-sitter incremental parsing, request routing, sidecar lifecycle
- Tier 2 β C# Sidecar (Roslyn): MSBuildWorkspace, full Roslyn API (completions, diagnostics, refactorings, formatting)
- Tier 3 β F# Sidecar (FCS): FSharp.Compiler.Service, Fantomas, FSharpLint
IPC uses MessagePack over named pipes (Windows) / Unix domain sockets (Linux, macOS).
See Architecture for the full breakdown.