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

The fastest path is the included dev container. It comes pre-configured with Rust, .NET 10 SDK, Node 20, and all required tooling.

  1. Install Docker and the Dev Containers extension
  2. Open the repository in VS Code
  3. 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.