Modelica language support with interactive diagram editing, simulation, and scripting — powered by ModelScript.
ModelScript is a complete Modelica development environment — no external compilers, tools, or configuration required. Everything runs directly in the browser or in VS Code, powered by the ModelScript framework:
- 🔋 Modelica Standard Library bundled and ready — full type resolution out of the box
- 🚀 Zero configuration — install the extension and start writing Modelica immediately
- 🌐 Works everywhere — desktop VS Code, vscode.dev, and the browser-based IDE
Open a visual diagram view for any Modelica model with ModelScript: Open Diagram. Components are rendered as interactive SVG schematics with connection lines, icons, and labels.
- Drag to move — reposition components and the code updates automatically with
Placementannotations - Auto-layout — intelligent automatic placement of components via
ModelScript: Auto Layout - Add components — browse the Modelica library tree and add components directly to the diagram
- Edit connections — create and modify
connectstatements visually - Bidirectional sync — changes in the diagram update the code, and vice versa
Run simulations directly from the editor with ModelScript: Run Simulation:
- ODE/DAE solver with Pantelides index reduction and BLT ordering
- Interactive plots — view simulation results as time-series charts
- Configurable — set start/stop time, solver, and output format
- No external tools — the solver runs entirely in the browser via WebAssembly
Full support for Modelica Script (.mos) files with an integrated interpreter:
- Execute scripts — run
simulate(),plot(),loadModel(), and other scripting commands - REPL-style workflow — evaluate expressions and inspect results interactively
- Flatten models — introspect and debug class hierarchies with
flatten()
Modelica Notebook support (.monb) for literate programming:
- Code cells — write and execute Modelica script blocks
- Rich output — see simulation results, plots, and diagnostic messages inline
- Documentation — mix Modelica code with markdown explanations
- Dot-path completions — type
Modelica.and get sub-packages, classes, and components from the entire standard library - Keyword completions — all Modelica language keywords
- Contextual suggestions — parameters, modifications, and annotations
Hover over any Modelica identifier to see its type, description, and classification (model, connector, component, enumeration literal, etc.).
- Go to Definition — jump to the declaration of any class, component, or type
- Go to Type Definition — navigate to the type of a component
- Find All References — locate every usage of a symbol across the workspace
Safely rename identifiers across files with F2 — the rename provider validates the new name before applying changes.
View function parameter signatures as you type, with documentation for each argument.
Navigate complex Modelica files with the Outline view — classes, components, equations, and algorithms are organized hierarchically.
Find any class or component across the entire workspace with Ctrl+T.
Real-time error detection with 15+ lint rules:
- Parse errors — caught via tree-sitter incremental parsing
- Unresolved references — missing imports, typos, undefined names
- Type mismatches — incompatible types in assignments, equations, and function calls
- Array dimension errors — shape mismatches, index type errors, wrong subscript counts
- Structural errors — circular extends, duplicate modifications, unbalanced models
- Quick fixes — code actions to resolve common issues
Format Modelica files with proper indentation for class definitions, equations, algorithms, and control structures.
Smart indentation and dedentation rules for Modelica keywords like equation, algorithm, end, else, etc. — the editor adjusts indentation as you type.
Full semantic token support — variables, parameters, constants, types, and built-in identifiers are colored distinctly based on their semantic role, not just syntax.
Inline color swatches for Modelica annotation color fields (color, lineColor, fillColor, textColor). Click to use the VS Code color picker.
Fold class definitions, equation and algorithm sections, and control structures for easier navigation of large files.
A dedicated sidebar panel for browsing the Modelica Standard Library:
- Hierarchical tree — navigate packages, models, connectors, and functions
- Class icons — each class kind has a distinct icon (model, connector, block, function, etc.)
- Add to Diagram — insert components directly from the library browser into your model
A browser-local AI chat powered by WebLLM (Qwen3-0.6B):
- Privacy-first — the model runs entirely in your browser, no data leaves your machine
- Modelica-aware — can flatten models, run simulations, and inspect classes via built-in tools
- LaTeX rendering — mathematical equations are rendered as Unicode for readability
- VS Code 1.100.0 or later
- Works in both desktop VS Code and vscode.dev
| Setting | Description | Default |
|---|---|---|
modelscript.trace.server |
Traces communication between VS Code and the language server (off, messages, verbose) |
verbose |
- ModelScript — project homepage
- GitHub — source code and issue tracker
- Morsel — online Modelica editor
- IDE — browser-based VS Code IDE
