Skip to main content

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

If you already have opcua-modeler installed, run:

opcua-modeler install-extension

This installs two extensions in one step:

  1. The OPC UA Modeler extension — from the Marketplace (or the bundled .vsix as offline fallback)
  2. The RedHat YAML extension (redhat.vscode-yaml) — installed automatically as a companion, providing the YAML Language Server that powers schema validation. Skipped gracefully in --offline mode (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

  1. Open VS Code
  2. Go to the Extensions panel (Ctrl+Shift+X)
  3. Search for "OPC UA Modeler" (publisher: Sterfive)
  4. 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:

PatternDescription
*.nodeset.yamlRecommended extension for NodeSet YAML files
*.nodeset.ymlAlternate short extension
*.model.yamlLegacy convention
*.model.ymlLegacy short extension
model.yamlBare filename convention
model.ymlBare 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:

FieldWhat 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:

SettingDefaultDescription
opcuaModeler.useClitrueWhen 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):

StateIndicator
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:

CommandDescription
OPC UA Modeler: Restart Language ServerForce-restarts the LSP server process. Useful after updating opcua-modeler.

Troubleshooting

Completions / diagnostics not working?

  1. Check the status bar indicator — if it shows , click it to open the Output panel.
  2. Make sure opcua-modeler is installed and accessible in your PATH:
    opcua-modeler version
  3. If using a custom binary path, verify opcuaModeler.serverPath is correct.
  4. Try OPC UA Modeler: Restart Language Server from the Command Palette.
  5. Set opcuaModeler.trace.server to "verbose" and inspect the Output → OPC UA Modeler channel.