VS Code Extension
The OPC UA Modeler VS Code extension gives you full IDE intelligence when authoring
.model.yaml files — completions, real-time diagnostics, hover hints, and quick fixes —
powered by the bundled LSP server.
Installation
Option A — Using the CLI (recommended)
If you already have opcua-modeler installed, run:
opcua-modeler install-extension
This installs two extensions in one step:
- The OPC UA Modeler extension — from the Marketplace (or the bundled
.vsixas offline fallback) - The RedHat YAML extension (
redhat.vscode-yaml) — installed automatically as a companion, providing the YAML Language Server that powers schema validation. Skipped gracefully in--offlinemode (you can install it manually in that case).
It also auto-configures opcuaModeler.serverPath in your VS Code settings.json so the
extension finds the CLI without any manual setup.
Available flags: --offline (skip Marketplace, use bundled .vsix), --force
(re-install even if already installed), --editor <code|cursor|codium|code-insiders>.
Option B — VS Code Marketplace
- Open VS Code
- Go to the Extensions panel (
Ctrl+Shift+X) - Search for "OPC UA Modeler" (publisher: Sterfive)
- Click Install
Note: With this method you will need to install the RedHat YAML extension separately.
Option C — Manual .vsix install
code --install-extension opcua-modeler-<version>.vsix
Note: With this method you will also need to install the RedHat YAML extension manually.
Activated file types
The extension activates automatically on any of these file patterns:
| Pattern | Description |
|---|---|
*.nodeset.yaml | Recommended extension for NodeSet YAML files |
*.nodeset.yml | Alternate short extension |
*.model.yaml | Legacy convention |
*.model.yml | Legacy short extension |
model.yaml | Bare filename convention |
model.yml | Bare short filename |
What you get
Once activated, the extension provides:
✅ Real-time diagnostics
Errors and warnings appear inline as you type — no need to run the CLI manually.
- Structural errors (wrong keys, missing required fields, invalid types) appear almost instantly via JSON Schema validation.
- Semantic errors (invalid type references, broken browse paths, duplicate anchors, illegal optionals) appear ~500 ms after you stop typing.
✅ Context-aware completions
Press Space, :, - or / to trigger completions. The server understands the OPC UA address space and offers relevant suggestions for every field:
| Field | What you get |
|---|---|
typeDefinition: | All non-abstract ObjectTypes and VariableTypes in the address space |
subtypeOf: | Types filtered by the enclosing section kind (objectTypes, variableTypes, etc.) |
dataType: | All 23 OPC UA scalar primitives + your custom structure types |
optionals: / promotedToMandatory: | Optional members of the enclosing type |
organizedBy: / componentOf: / propertyOf: | Valid browse paths in the virtual node tree |
initializers: variable: | Initializable variable paths with data types and enum values |
interfaces: | All available InterfaceTypes |
Local document types always appear first in completion lists (sorted with a ! prefix).
✅ Hover documentation
Hover over an initializers: variable: path to see:
- The DataType of that variable
- For enumerations: the list of valid enum values with their numeric codes
✅ Quick-fix code actions
When a organizedBy: (or similar placement) path is invalid, a 💡 lightbulb appears.
Click it to get:
- Replace with
<best-match>— automatically substitutes the closest valid path (Levenshtein distance ≤ 3) - Remove invalid path — deletes the entry
Extension settings
Open VS Code settings (Ctrl+,) and search for opcuaModeler:
| Setting | Default | Description |
|---|---|---|
opcuaModeler.useCli | true | When true, uses opcua-modeler lsp --stdio as the server process. When false, uses the bundled Node IPC server. |
opcuaModeler.serverPath | (auto) | Full path to the opcua-modeler CLI binary. Leave empty to use the binary found in PATH. |
opcuaModeler.trace.server | "off" | LSP trace level: "off" / "messages" / "verbose". Use "verbose" for debugging. |
Status bar
The extension adds a small indicator to the VS Code status bar (bottom-left):
| State | Indicator |
|---|---|
| Starting… | ⟳ OPC UA Modeler |
| Ready | ✓ OPC UA Modeler |
| Error | ✗ OPC UA Modeler (click for details) |
Commands
Open the Command Palette (Ctrl+Shift+P) and search for:
| Command | Description |
|---|---|
OPC UA Modeler: Restart Language Server | Force-restarts the LSP server process. Useful after updating opcua-modeler. |
Troubleshooting
Completions / diagnostics not working?
- Check the status bar indicator — if it shows
✗, click it to open the Output panel. - Make sure
opcua-modeleris installed and accessible in yourPATH:opcua-modeler version - If using a custom binary path, verify
opcuaModeler.serverPathis correct. - Try
OPC UA Modeler: Restart Language Serverfrom the Command Palette. - Set
opcuaModeler.trace.serverto"verbose"and inspect the Output → OPC UA Modeler channel.