This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Solstice is a VSCode extension for Solidity that adds debugging and execution tracing capabilities. The project consists of two main components:
- Language Server (Rust): Handles Solidity parsing, analysis, debugging, and runs the DAP server for tracing
- VS Code Extension (TypeScript): Lightweight client that communicates with the language server via LSP and launches DAP sessions
src/lib.rs: Main language server implementation with LSP handlerssrc/debugger/: Debugging infrastructure including DAP server and trace generationsrc/builder.rs: AST analysis and cache building for language featuressrc/symbol_indexer/: Symbol indexing for cross-file referencessrc/forge/: Foundry/Forge integration for building and testingextension/: TypeScript VSCode extension client
- Rust-based language server using
tower-lsp-server - Solang parser (forked version) for Solidity AST parsing
- REVM inspectors for EVM execution tracing
- Foundry/Forge for Solidity compilation and testing
- Debug Adapter Protocol (DAP) for debugging support
# Build the Rust language server
cargo build
# Build the VSCode extension
cd extension && npm run build# Lint Rust code (fails on warnings)
just lint
# Or: cargo clippy -- -D warnings
# Check Rust code formatting
just check-format
# Or: cargo fmt -- --check
# Extension linting
cd extension && npm run lint
# Extension formatting
cd extension && npm run format:check# Run all debugger traces
just trace all
# Run specific trace
just trace <trace_name>
# Fuzz testing for state
just fuzz-state
# Override test traces (updates expected output)
just override-traces# Generate config documentation
just generate-docs
# Validate config documentation is up-to-date
just check-docsUse standard Rust testing:
cargo testFor tracing tests specifically:
cargo test --lib -- debugger::tracer::tests::test_debugger_traces --exact --show-output --nocaptureYou can trace Solidity tests without VS Code:
cargo run -- trace --match-test <test-name> --match-path <path> [--workspace <workspace>] [--dump <output-file>] [--flamegraph <flamegraph-file>] [--pprof <pprof-file>]The language server supports configuration through VSCode settings. Key settings are documented in docs/configuration.md and include:
solstice.inlayHints.closingBraceHints.enable: Display closing brace hints (default: true)solstice.inlayHints.closingBraceHints.minLines: Minimum lines for brace hints (default: 25)solstice.solsticePath: Path to language server directory
- Full Solidity language support (completion, hover, goto definition, references)
- Real-time diagnostics and error reporting
- Code formatting using forge-fmt
- Inlay hints for closing braces
- Code actions (SPDX license insertion, auto-imports)
- Code lens for running/debugging tests
- Dependency graph generation
- The language server uses a forked version of Solang parser
- Debug traces are temporarily stored at
/tmp/debug_trace.json - The DAP server runs on port 50051 for debugging sessions
- Library remappings are auto-discovered from
lib/directory - Tests must have
test_prefix to be recognized by code lens