Siemens Language Support
This VS Code extension provides basic syntax highlighting for the Siemens custom language.
Features
- Syntax highlighting via TextMate grammar
- Show variable datatypes on hover
- Comment toggling and bracket pairing via language configuration
- Check missing semicolons on statements and after END_* blocks
- Check unclosed blocks and missing required keywords (THEN/DO/OF/UNTIL, END_*)
- Check assignment to undefined locals (including nested struct/array member access)
- Check assignment to local constants declared in VAR CONSTANT
- Validate time literals T#/TIME#/LT#/LTIME# (format, segments, units)
- Validate bitstring and base‑prefixed literals (BYTE/WORD/DWORD/LWORD and 2#/8#/16#): base/digits present and value fits bit‑width
- Report unterminated strings, quoted identifiers, quoted local identifiers, and block comments
- Report unterminated attribute blocks { ... }
- Report unexpected characters and invalid standalone '#'
- Disallow static VAR blocks inside FUNCTION (only VAR CONSTANT is allowed)
- Validate block headers and metadata (e.g., VERSION, TITLE) and require values
- Handle REGION/END_REGION lines: rest of the REGION line is a comment; semicolons not required
- Validate .s7res resource files (YAML): structure, required id, scalar translation values
File associations
Files ending in .scl , .s7res and .s7dcl will be highlighted.
Development
- Open this folder in VS Code and press F5 to launch the Extension Development Host.
Releases
npx vsce package
npx vsce publish
The extension should be published to:
Publishing to open-vsx is done manually from the website, vs marketplace is done with vsce publish with a PAT from https://dev.azure.com/nyedynamic
| |