🚀 BooST - Structured Text Language Server Extension
Description
The Structured Text Language Server Extension (BooST) provides modern development tools for the Structured Text (ST) programming language according to IEC 61131-3, specifically designed for use with B&R Automation Studio. This extension enables efficient writing, validation, and navigation of ST code in Visual Studio Code.
How to Use
Install the Extension: Search for "BooST" in the Visual Studio Code marketplace and install it.
Open a Workspace: Open the folder "Logical" of your B&R project in Visual Studio Code.
Add folder to Workspace: Open the folder "Temp\Includes\AS_TempDecl" to support mapp components.
Set file encoding: Open User Settings JSON and set file encoding to windows1252:
"[st]": {
"files.encoding": "windows1252"
}
Supported File Formats
.st – Structured Text files
.var – Variable declarations
.typ – Type declarations
.fun – Function and function block declarations
Features
Syntax Highlighting: Automatic color highlighting for keywords, variables, and comments.
Autocomplete: Smart code completion for variables, functions, and keywords.
Real-Time Error Detection: Early detection of syntax and type errors while coding.
Datatype Range Validation: Validates literal values against the target datatype's value range.
Deprecation Warnings: Mark a function or function block as deprecated with an @deprecated comment placed directly above its declaration (e.g. (*@deprecated since version 2.0*)); usages are flagged in the editor.
Go to Definition: Quickly navigate to variable and function declarations.
Go to Implementation: Quickly navigate to the implementation.
Go to Type Definition: Navigate from a variable to the declaration of its type, across files.
Find All References: Display all occurrences of a symbol throughout the project.
Rename Symbols: Consistently rename variables and functions across the codebase.
Hover Information: Show type information and comments when hovering over variables.
Code Formatting: Automatically format ST code for improved readability.
Code Snippets: Predefined code snippets for common structures and patterns.
Signature help: Display function signatures and parameter information.
State Machine Diagram (Beta): Visualize CASE-based state machines as interactive diagrams. Transition functions can be configured via the extension settings.
Features coming soon
Prefix validation: Check for valid prefixes in variable names.
Further validation: More validation rules for structured text.
Known Issues
Changes in dictionary folder structure are not detected (need to reopen the workspace)
Initialization of complex structures in typ or var files are not fully supported