Language Server Protocol implementation for Traverse analysis engine v0.1.4, providing call graph and sequence diagram generation for Solidity smart contracts.
- Automatic Mermaid Chunking: Large sequence diagrams are automatically split into manageable chunks
- Multi-file Analysis: Analyzes entire Solidity workspaces, not just single files
- Background Processing: Diagram generation runs in separate thread to keep UI responsive
- Multiple Output Formats: DOT, Mermaid, and Markdown formats
cargo build --releaseThe binary will be at target/release/traverse-lsp
The LSP server communicates via stdio and operates exclusively at workspace level, analyzing entire Solidity projects rather than individual files. It uses a background worker thread for diagram generation to keep the main LSP message loop responsive.
The server implements the following workspace-level commands via workspace/executeCommand:
| Command | Description | Parameters |
|---|---|---|
traverse.generateCallGraph.workspace |
Generate call graph for all contracts | workspace_folder: string |
traverse.generateSequenceDiagram.workspace |
Create sequence diagrams | workspace_folder: stringno_chunk: boolean (optional, default: false) |
traverse.generateAll.workspace |
Generate all diagram types | workspace_folder: string |
traverse.analyzeStorage.workspace |
Analyze storage layout | workspace_folder: string |
{
"command": "traverse.generateSequenceDiagram.workspace",
"arguments": [{
"workspace_folder": "/path/to/project",
"no_chunk": false
}]
}All diagrams are generated in:
- DOT format for call graphs (GraphViz compatible)
- Mermaid format for sequence diagrams (with automatic chunking for large diagrams)
- Markdown for storage analysis
Large sequence diagrams are automatically split into manageable chunks (default: 400 lines per chunk) to prevent rendering issues. This behavior can be controlled:
- Default: Chunking is enabled automatically for large diagrams
- Disable chunking: Pass
no_chunk: truein command arguments - Output: Chunks are saved to
./traverse-output/sequence-diagrams/chunks/directory with an index file
A fully-featured extension is available at https://github.com/calltrace/traverse-vscode
TODO: Add Neovim LSP configuration example
Any IDE with LSP support can use this server. Configure your IDE to:
- Run
traverse-lspas the language server for Solidity files - Use stdio for communication
- Send workspace commands for diagram generation
Environment variables:
RUST_LOG=debug- Enable debug loggingTRAVERSE_LSP_TRACE=verbose- Trace LSP messages
cargo testMIT