Rumoca Modelica
A VS Code extension providing language support for Modelica using the rumoca compiler.
Features
- Syntax highlighting for Modelica files (
.mo)
- Real-time diagnostics - errors and warnings as you type
- Autocomplete for Modelica keywords and built-in functions
- Hover information for keywords and types
- Go to definition for variables and classes
- Document symbols - file outline with classes, components, equations
- Signature help - function parameter hints
- Find references - locate all uses of a symbol
- Code folding - collapse classes, equations, comments
- Formatting - auto-format Modelica code
- Inlay hints - inline parameter names and array dimensions
- Semantic tokens - enhanced syntax highlighting
- Code lens - reference counts and navigation
- Document links - clickable URLs and file paths
Installation
From VS Code Marketplace (recommended):
Search for "Rumoca Modelica" in the VS Code Extensions view (Ctrl+Shift+X / Cmd+Shift+X) and install.
The extension includes a bundled rumoca-lsp language server, so no additional installation is required for most users.
From VSIX file:
- Download the
.vsix file for your platform from GitHub Releases
- In VS Code, open the Command Palette (
Ctrl+Shift+P / Cmd+Shift+P)
- Run "Extensions: Install from VSIX..."
- Select the downloaded
.vsix file
Using a Custom/System Server
If you want to use a different version of rumoca-lsp (e.g., a development build), you have two options:
Option 1: Use System Server
Set rumoca.useSystemServer to true in your VS Code settings. The extension will then search for rumoca-lsp in your PATH or ~/.cargo/bin/.
{
"rumoca.useSystemServer": true
}
Option 2: Specify Custom Path
Set rumoca.serverPath to the full path of your custom rumoca-lsp binary:
{
"rumoca.serverPath": "/path/to/custom/rumoca-lsp"
}
Installing rumoca-lsp Manually
If you need to install rumoca-lsp manually:
# From crates.io
cargo install rumoca
# Or from source
git clone https://github.com/jgoppert/rumoca.git
cd rumoca
cargo install --path .
Configuration
| Setting |
Description |
Default |
rumoca.serverPath |
Path to a custom rumoca-lsp executable |
"" (auto-detect) |
rumoca.useSystemServer |
Use system-installed rumoca-lsp instead of bundled binary |
false |
rumoca.trace.server |
Traces communication with the language server |
"off" |
rumoca.debug |
Enable debug logging for the extension and language server |
false |
Troubleshooting
Extension shows "Using system-installed rumoca-lsp" warning:
This means the bundled binary wasn't found (possibly a platform mismatch). You can:
- Set
rumoca.useSystemServer to true to suppress the warning
- Install
rumoca-lsp manually (see above)
Extension can't find rumoca-lsp:
- The extension will prompt you to install via cargo
- Or set
rumoca.serverPath to the full path of your rumoca-lsp binary
Debug logging:
To see detailed logs, enable debug mode in settings:
{
"rumoca.debug": true
}
Then check the "Rumoca Modelica" output channel in VS Code.
Building the Extension from Source
# Build the LSP server
cargo build --release
# Build the extension
cd editors/vscode
npm install
npm run compile
npx @vscode/vsce package
code --install-extension rumoca-modelica-*.vsix
License
Apache-2.0