Language support for WinCC OA CTRL and CTRL++ in Visual Studio Code
Features β’ Installation β’ Known Issues
Disclaimer: This is one of the first releases of the WinCC OA CTRL Language extension. Some edge cases may not be fully covered yet. Please check the Known Issues section for workarounds if you encounter problems.
Tip: If the extension doesn't work as expected, tryCtrl+Shift+PβReload Windowto refresh.
- Full support for
.ctland.ctlppfiles - WinCC OA built-in functions highlighted
- Classes, structs, enums, and mappings
- Hover Information: See function signatures, variable types, and documentation
- Auto-Completion: WinCC OA built-in functions with parameter hints
- Go-to-Definition (
F12orCtrl+Click):- Functions and methods
- Classes and structs
- Variables (global, local, member)
- Enums and enum members (
Color::RED) #usesimports (cross-file navigation)
- Member Access Navigation: Chain navigation
obj.member.field
- Enum Support: Hover and navigation for
enum Color { RED, GREEN } - Class Inheritance: Navigate to base classes (single-level)
- Scope-Aware Resolution: Distinguishes local vs. member variables
- Cross-File Dependencies: Automatic
#usesresolution
- Quick access to official WinCC OA documentation
Ctrl+Shift+PβWinCC OA: Open Documentation for CTRL Function
- Astyle-based formatting for
.ctland.ctlppfiles - Format on save support
- Native WinCC OA syntax validation via
WCCOActrl - Inline error highlighting
| Setting | Default | Description |
|---|---|---|
winccoa.ctrlLang.pathSource |
automatic |
Project path detection: workspace (auto-detect) or manual |
winccoa.syntaxCheck.enabled |
false |
Enable WinCC OA syntax validation |
winccoa.syntaxCheck.executeOnSave |
false |
Run syntax check automatically on save |
winccoa.astyleFormatter.enabled |
false |
Enable Astyle code formatting |
winccoa.astyleFormatter.runOnSave |
false |
Format code on save |
| Setting | Default | Description |
|---|---|---|
winccoa.ctrlLang.logLevel |
INFO |
Log verbosity: ERROR, WARN, INFO, DEBUG, TRACE |
π‘ Tip: Set log level to DEBUG when reporting bugs for detailed diagnostics.
-
Inheritance Chains:
- Only 1 level of inheritance supported
class C : B : Aβobj.memberInAnot resolved
-
Interfaces:
- Interface parsing not yet implemented
interface IDrawablesyntax not recognized
-
Static Members:
class Utils { public static int counter; }- Static member detection not yet supported
Utils::method()may be confused with enums
-
Goto-Definition Precision:
- Occasional jumps to wrong line numbers
- Especially in complex member access chains
Found an issue? Please report it with:
- WinCC OA version
- Extension version (
1.0.4) - Code example that reproduces the issue
- Enable
DEBUGlogging and attach log output
Access via Ctrl+Shift+P:
| Command | Description |
|---|---|
WinCC OA: Open Documentation for CTRL Function |
Opens official docs for function under cursor |
WinCC OA: Format Document with Astyle |
Formats current document |
WinCC OA: Run WinCC OA Syntax Check |
Validates syntax with WCCOActrl |
- VS Code: 1.105.0 or higher
- WinCC OA: 3.19+ (optional, required for syntax checking via
WCCOActrl) - WinCC OA Core Extension: (optional, recommended) Enables automatic project detection and management. With the Core extension installed, you can select your active project from a listβthe Language extension will automatically detect all local projects with a
config/configfile. - Project Structure: Your workspace must contain a
config/configfile (standard WinCC OA project layout) for auto-detection to work.
Automatic Mode: If the WinCC OA Project Admin Extension is installed, project detection is fully automatic.
Windows Performance:
The extension may run slower on Windows with longer loading times. Linux performs significantly better.
Large Projects:
Very large projects (1000+ files) may experience performance issues with IntelliSense and navigation.
Extension Not Responding:
If the extension doesn't work as expected (IntelliSense not working, goto-definition fails), reload VS Code:
- Press
Ctrl+Shift+P - Type and select
Reload Window - This refreshes the language server
- Goto Precision: Sometimes jumps to incorrect lines (minor offset issues)
- Inheritance: Only single-level inheritance supported (no deep chains)
- Interfaces: Not yet implemented
This project is licensed under the GNU General Public License v3.0.
This extension includes code from:
vscode-ctrlpptools by LukasSchopp
License: GNU GPL v3.0
Modified files:
language-configuration.jsonsyntaxes/ctrl.tmLanguage.jsonsyntaxes/ctrlpp.tmLanguage.json
WinCC OA and Siemens are trademarks of Siemens AG. This project is not affiliated with, endorsed by, or sponsored by Siemens AG. This is a community-driven open source project.
Made with β€οΈ for the WinCC OA community
GitHub β’ Issues β’ WinCC OA Docs
