TwinCAT Structured Text support for Visual Studio Code
Overview
This extension brings TwinCAT Structured Text (ST) language support to VS Code. The long-term goal is to enable full editing of ST code directly in VS Code. Currently, the extension provides syntax highlighting, diagnostics and navigation features. Editing is not yet supported, i.e. diagnostics will not be updated on the fly.
Browse and navigate TwinCAT ST codebases with semantic awareness.
No direct editing of TwinCAT XML files (.TcPOU, .TcDUT, .TcGVL, etc).
Conversion required: You must convert your TwinCAT XML sources to .st files before using the language features.
Getting Started
Install the extension from the VS Code Marketplace.
Open your TwinCAT solution in VS Code.
The extension will detect your TwinCAT solution file (e.g., .sln).
Convert TwinCAT XML files:
On first use, you will be prompted to convert all TwinCAT XML source files to .st files.
The language server will now launch and provide navigation for your .st files.
Development
Install dependencies:
npm install
Restart VS Code after install (required for ANTLR modifications).
To edit the TextMate grammar, modify grammars/st.tmLanguage.yaml and convert it: