Rholang for Visual Studio Code
October 31, 2025 ยท View on GitHub
Professional language support for Rholang process calculus
Full-featured IDE support for Rholang via the rholang-language-server, including intelligent code completion, go-to-definition, find references, and more.
โจ Features
Language Server Protocol (LSP) Features
- ๐ Go to Definition - Jump to symbol definitions across files
- ๐ Code Completion - Intelligent completions with fuzzy matching support
- ๐ก Hover Information - Type information and documentation on hover
- โ๏ธ Signature Help - Parameter hints for contract calls
- ๐ Find References - Find all usages of symbols across workspace
- ๐ท๏ธ Document Symbols - Outline view with hierarchical symbols
- ๐ Workspace Symbols - Fast symbol search across all files
- ๐๏ธ Rename - Rename symbols across the workspace
- ๐ Document Highlighting - Highlight all occurrences of symbol under cursor
- ๐จ Semantic Highlighting - Enhanced syntax highlighting for embedded languages
Validation & Diagnostics
- Dual Backend Support:
- Rust Interpreter (default): Fast, embedded validation with no dependencies
- gRPC to RNode: Legacy RChain compatibility
- Real-time Diagnostics - Syntax errors, type errors, unbound variables
- Incremental Validation - Fast re-validation on file changes
Developer Experience
- ๐ 58 Code Snippets - Quick insertion of common patterns (contracts, channels, collections, methods, etc.)
- ๐ One-Click Server Restart - No need to reload VSCode window
- ๐ Status Bar Integration - See backend status and server health at a glance
- โก Quick Server Menu - Fast access to common operations
- ๐ง Comprehensive Configuration - Fine-tune every aspect of the extension
- ๐ Server Information Panel - View all server capabilities and settings
- ๐ Wire-Level Logging - Debug LSP protocol communication
- โ Settings Validation - Helpful warnings for configuration issues
Automatic RNode Management
- Auto-start RNode when using gRPC backend
- Health checking before server startup
- Graceful fallback to parser-only mode if RNode unavailable
- Automatic cleanup on extension deactivation
Requirements
- Rholang LSP Server: The
rholang-language-serverbinary must be available on your PATH or configured viarholang.server.path - RNode (optional): Only required if using the gRPC validator backend. The extension can automatically start RNode if it's available on your PATH.
- VS Code: Version 1.96.2 or later
Installation
- Install the extension via the VS Code Marketplace or a
.vsixfile - Ensure the Rholang LSP server binary (
rholang-language-server) is in your$PATHor set its path in therholang.server.pathconfiguration - (Optional) If using the gRPC validator backend:
- Install RNode and ensure it's on your
$PATH, or - Set the path to RNode in the
rholang.rnode.pathconfiguration - The extension will automatically start RNode when needed (can be disabled
via
rholang.rnode.autoStart)
- Install RNode and ensure it's on your
Configuration
Server Settings
-
rholang.server.path: Path to therholang-language-serverexecutable (default:"rholang-language-server") -
rholang.server.logLevel: Log level for the language server (default:"info")"error": Only log errors"warn": Log warnings and errors"info": Log informational messages, warnings, and errors"debug": Log debug information and above"trace": Log all messages including trace-level details- Note: Changes take effect immediately without restarting the server
-
rholang.server.wireLog: Enable wire-level logging of LSP protocol messages (default:false)- When enabled, logs all inputs and outputs between the client and server
- Passes
--wire-logflag to the language server - Useful for debugging LSP communication issues
- Note: Changes require restarting the language server
-
rholang.server.extraArgs: Additional command-line arguments to pass to the language server (default:[])- Accepts an array of strings representing flags and options
- Arguments are appended after built-in arguments, allowing overrides
- Changes require restarting the language server
- Example:
["--max-threads", "4", "--enable-experimental"]
Validator Backend
rholang.validatorBackend: Choose validation backend"rust"(default): Use the embedded Rust interpreter"grpc": Use gRPC to connect to RNode server
RNode Settings (for gRPC backend)
rholang.rnode.path: Path to thernodeexecutable (default:"rnode")rholang.rnode.autoStart: Automatically start RNode when using gRPC backend (default:true)rholang.grpcAddress: Address of the RNode gRPC server (default:"localhost:40402")
Code Completion Settings
The extension implements workarounds to maximize reliance on the LSP server's completion results, working around VSCode's client-side filtering and sorting limitations:
-
rholang.completion.forceIncomplete(default:true): Forces completion lists to be marked as incomplete, triggering re-queries to the LSP server on each keystroke. This ensures the server has the opportunity to provide contextually relevant completions based on what you've typed. -
rholang.completion.preserveSortText(default:true): EnsuressortTextis set on completion items to help preserve the server's intended ordering. Items withoutsortTextwill use their label as the sort key. -
rholang.completion.ensureFilterText(default:true): EnsuresfilterTextis set on completion items to influence VSCode's client-side filtering. Items withoutfilterTextwill use their label as the filter key.
Important Note: Even with these workarounds enabled, VSCode will still apply its own client-side filtering and sorting based on prefix matching once you start typing. This is hardcoded behavior in VSCode that cannot be fully bypassed. However, these settings maximize the influence of the LSP server's results within VSCode's constraints.
Advanced Debugging
rholang.trace.server: Traces the communication between VSCode and the language server (default:"off")"off": No tracing"messages": Trace all messages sent to/from the server"verbose": Verbose message tracing with additional details- This is a built-in VSCode LSP setting useful for debugging LSP protocol issues
- Note: Different from
rholang.server.wireLogwhich enables server-side wire logging
๐ Quick Start
- Install the extension from the VSCode Marketplace
- Install rholang-language-server:
# Download from releases # https://github.com/F1R3FLY-io/rholang-language-server/releases - Open a
.rhofile - The extension activates automatically - Start coding! - Enjoy full LSP features out of the box
๐ Usage
Basic Workflow
- Open or create a
.rhofile - Start typing - see completions, diagnostics, and hover information
- Use
Ctrl+Spacefor manual completion invocation - Use
F12(Go to Definition),Shift+F12(Find References),F2(Rename)
Using Snippets
Type a snippet prefix and press Tab:
contractโ Contract definitionnewโ New channel declarationforโ Input guard (for comprehension)sendโ Send on channelmatchโ Pattern matchingselectโ Select/choice expressionlist.*/map.*/set.*โ Collection methods- And 50+ more!
Commands
Access via Command Palette (Ctrl+Shift+P or Cmd+Shift+P):
| Command | Description |
|---|---|
Rholang: Restart Language Server | Restart the server without reloading window |
Rholang: Show Server Menu | Quick access to server operations |
Rholang: Show Server Information | View server capabilities and configuration |
Rholang: Show Server Output | Open language server logs |
Rholang: Toggle Wire Logging | Enable/disable LSP protocol logging |
Status Bar
Click the Rholang status bar item (bottom-right) to:
- View current backend (Rust/gRPC)
- Restart the server
- Change validator backend
- Open server logs
โ Troubleshooting
Server Not Starting
- Check server path: Ensure
rholang-language-serveris in PATH or configured correctly - View logs: Run "Rholang: Show Server Output" command
- Restart server: Run "Rholang: Restart Language Server" command
No Completions/IntelliSense
- Check file extension: Must be
.rho - Verify server is running: Check status bar (should show "โ Rholang: Rust" or similar)
- Try manual trigger: Press
Ctrl+Space
RNode Connection Issues
- Verify RNode is running:
curl http://localhost:40403/status - Check gRPC address: Default is
localhost:40402 - Switch to Rust backend: Faster and no dependencies
Wire Logging Not Working
- Wire logging requires server restart after enabling
- Use "Rholang: Toggle Wire Logging" command for easy toggling
For more detailed troubleshooting, see TROUBLESHOOTING.md.
๐ก Tips & Tricks
- Faster validation: Use Rust backend (default) instead of gRPC
- Better completions: Enable all completion middleware options (default)
- Debug LSP issues: Enable wire logging and check server output
- Organize code: Use
// #regionand// #endregionfor code folding - Quick backend switch: Click status bar โ "Change Validator Backend"
๐ค Contributing
Contributions are welcome! Please see the GitHub repository for details.
๐ License
Apache 2.0 - See LICENSE for details.
๐ Links
Building from Source
- Clone the repository
- Install dependencies:
npm install - Compile:
npm run build - Run tests:
npm test - Package:
vsce package
Enjoy coding in Rholang! ๐