Ambitious Solidity extension for VSCode
Solstice is a VSCode extension for Solidity that adds debugging and execution tracing capabilities. It lets you trace and debug the execution of Solidity tests directly in your editor. The extension provides real-time visualization of contract state, memory, storage, and execution flow, making it easier to understand and troubleshoot smart contract behavior.
The language support in Solstice is forked from the Solang VSCode extension. This fork maintains all the language features from Solang while adding specialized debugging tools. Long-term, the plan is to migrate to the Solar parser library when it's production ready.
- Install the VS Code Solstice extension from the marketplace
- Open any Solidity file to automatically activate the extension
- Download the language server - A modal window will appear asking to download the Solstice language server from GitHub releases. Click "Download" to proceed
- You're ready to go! The extension provides full Solidity language support and debugging capabilities
Solstice 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
The extension is essentially a thin wrapper - all Solidity functionality and debugging capabilities live in the Rust language server.
To develop and test Solstice locally, follow these steps:
- Clone the repository
git clone https://github.com/ferranbt/solstice.git
cd solstice
- Build the Rust server
cargo build
- Build the VSCode extension
cd extension
npm run build
- Open
Solstice
in Vscode and Open theRun and Debug
tab. Execute theClient + Server
configuration and open any Solidity project.
Solstice provides two main commands:
$ cargo run -- server
Starts the Rust language server directly. This is what the VS Code extension calls internally to provide language features.
$ cargo run -- trace --match-test <test-name> --match-path <path>
Traces the execution of Solidity tests locally without VS Code. This command is useful for debugging tests outside the editor or in CI environments. It provides detailed execution information, including contract state, memory, and storage at each step of the test execution.
Usage:
workspace
: The root directory of your Solidity projecttest-name
: The name of the test to tracematch-path
: The path to the Solidity file containing the testflamegraph
: Optional flag to generate a flamegraph of the executionpprof
: Optional flag to generate a pprof profile of the execution