Skip to main content

First-Class IDE Language Server (LSP) — Autocomplete & Diagnostics

· 3 min read
Etienne Rossignon
CEO sterfive

Describing complex industrial information models in text format is a massive step forward, but writing YAML structures without help can still lead to simple syntax errors or reference typos.

To deliver the ultimate developer experience, we are thrilled to announce first-class IDE Language Server (LSP) Integration for the OPC UA Modeler! This turns your favorite editors (like VS Code, VSCodium, or Monaco) into powerful, fully-loaded OPC UA development environments with instant autocompletion, real-time diagnostics, and inline hover documentation.


What is LSP?

The Language Server Protocol (LSP) is an industry standard that allows compiler backends to communicate directly with modern code editors. Instead of writing separate extensions for every editor, the OPC UA Modeler now bundles a highly optimized, state-of-the-art LSP server directly inside its core toolchain.


Core IDE Capabilities

1. Instant Autocomplete (IntelliSense)

Never guess key names or standard browseNames again! As you type inside your *.model.yaml file, the LSP dynamically parses your namespace context and suggests:

  • Top-level model keywords (namespaces:, objectTypes:, instances:).
  • Standard OPC UA primitive data types (ua:Double, ua:String, ua:DateTime).
  • Registered object types, reference types, and variables from foreign companion namespaces.
  • Segment-by-segment browse paths in the optionals: list!

Autocomplete Demo

2. Real-Time Diagnostics & Squiggles

Make a typo or omit a namespace alias? The editor highlights the error instantly with red squiggly lines:

  • Typo Protection: Warns you if an optional path segment (e.g. di:ParameterSet.robotics:ActualSpeed) does not exist on the type definition.
  • Fuzzy Recommendations: If you write a bare name like ActualSpeed, the diagnostics will output a warning: Optional "ActualSpeed" is not a valid child of "AxisType". Did you mean "di:ParameterSet.robotics:ActualSpeed"?
  • Conformance Auditing: Instant warnings if you miss required properties or set invalid references.

3. Documentation Hover Context

Need to verify the structural blueprint of di:DeviceType or check what a custom type inherits? Simply hover your mouse over any registered type in your YAML file!

The LSP will dynamically render a floating markdown card displaying:

  • The base type hierarchy (e.g., di:DeviceTypedi:ComponentTypeua:BaseObjectType).
  • The description and documentation text fetched directly from the official OPC UA specifications.
  • A list of mandatory and optional components defined on that type.

Quick Setup & Demo

Getting started takes less than 2 minutes:

Step 1: Install the CLI

Ensure you have the latest opcua-modeler installed globally:

$ npm install -g @sterfive/opcua-modeler

Step 2: Install the VS Code Extension

Open VS Code, go to the Extensions Marketplace, and search for OPC UA Modeler. Click Install. The extension will automatically locate your global modler binary and launch the LSP server in the background.

Alternatively, if you are integrating with another editor (like Vim or Emacs), you can launch the LSP server manually:

$ opcua-modeler lsp-command

Step 3: Experience the Flow

Open any file ending in .model.yaml or .model.yml. Under the objectTypes block, type subtypeOf: and hit Ctrl + Space. Watch as standard and imported companion types populate the dropdown instantly!


For deep integration tips and configuring custom JSON schemas, visit our detailed IDE Integration Guide!