truST LSP for VS Code
truST LSP brings IEC 61131-3 Structured Text productivity to VS Code:
- Fast diagnostics and semantic highlighting
- Go to definition/references, rename, and formatting
- Runtime panel with live I/O control
- HMI preview panel with live schema + value updates
- Debugging with breakpoints, step, continue, and runtime values
- ST test workflow with CodeLens + Test Explorer
Quick Start (1 minute)
- Install truST LSP from the Marketplace.
- Open a folder with
.st / .pou files.
- Start editing. Language features start automatically.
Command line install:
code --install-extension trust-platform.trust-lsp
Open the Runtime Panel (super quick)
- Press
Ctrl+Shift+P
- Run
Structured Text: Open Runtime Panel
- Pick Local or External
- Press Start
- Set Inputs and watch Outputs update
What You Can Do
- Catch issues early with IEC-aware diagnostics
- Refactor safely: rename symbols and move namespaces
- Debug real logic with breakpoints + runtime state
- Drive and observe process I/O directly in the panel
- Run ST tests from CodeLens (
TEST_PROGRAM / TEST_FUNCTION_BLOCK) and Test Explorer
Example Projects
examples/ are not bundled inside the Marketplace extension package.
Use the GitHub repo examples instead:
Open it in VS Code:
- Clone the repo
File -> Open Folder...
- Select
trust-platform/examples/filling_line
- Run
Structured Text: Open Runtime Panel
Screenshots
Debug + Runtime in one view

Runtime I/O panel

Rename across files

Commands You’ll Use Most
Structured Text: New Project
Structured Text: Import PLCopen XML
Structured Text: Open Runtime Panel
Structured Text: Open HMI Preview
Structured Text: Start Debugging
Structured Text: Attach Debugger
Structured Text: Run All Tests
Structured Text: Run Test
Structured Text: Move Namespace
Structured Text: Create/Select Configuration
PLCopen XML Import (UI Flow)
Use this when you want to create a truST project from an existing PLCopen XML file.
- Press
Ctrl+Shift+P.
- Run
Structured Text: Import PLCopen XML.
- Pick the input XML file.
- Pick the target project folder.
- Confirm overwrite when importing into a non-empty folder.
The command runs trust-runtime plcopen import --json in the background and
lets you open the imported project and migration report after completion.
Advanced Setup (optional)
Set custom binary paths if needed:
trust-lsp.server.path
trust-lsp.debug.adapter.path
trust-lsp.runtime.cli.path
Full docs: https://github.com/johannesPettersson80/trust-platform/tree/main/docs
| |