Skip to content

winccoa-tools-pack/vscode-winccoa-ctrllang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

102 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

WinCC OA CTRL Language Support

Version License VS Code

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, try Ctrl+Shift+P β†’ Reload Window to refresh.


🎬 See It In Action

WinCC OA CTRL Language Support Demo


✨ Features

🎨 Syntax Highlighting

  • Full support for .ctl and .ctlpp files
  • WinCC OA built-in functions highlighted
  • Classes, structs, enums, and mappings

🧠 IntelliSense & Code Intelligence

  • Hover Information: See function signatures, variable types, and documentation
  • Auto-Completion: WinCC OA built-in functions with parameter hints
  • Go-to-Definition (F12 or Ctrl+Click):
    • Functions and methods
    • Classes and structs
    • Variables (global, local, member)
    • Enums and enum members (Color::RED)
    • #uses imports (cross-file navigation)
  • Member Access Navigation: Chain navigation obj.member.field

πŸ” Advanced Language Features

  • 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 #uses resolution

πŸ“š Documentation Access

  • Quick access to official WinCC OA documentation
  • Ctrl+Shift+P β†’ WinCC OA: Open Documentation for CTRL Function

πŸ”§ Code Formatting (Optional)

  • Astyle-based formatting for .ctl and .ctlpp files
  • Format on save support

βœ… Syntax Checking (Optional)

  • Native WinCC OA syntax validation via WCCOActrl
  • Inline error highlighting

βš™οΈ Configuration

Essential Settings

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

Logging (for debugging)

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.


πŸ› Known Issues

Current Limitations

  1. Inheritance Chains:

    • Only 1 level of inheritance supported
    • class C : B : A β†’ obj.memberInA not resolved
  2. Interfaces:

    • Interface parsing not yet implemented
    • interface IDrawable syntax not recognized
  3. Static Members:

    • class Utils { public static int counter; }
    • Static member detection not yet supported
    • Utils::method() may be confused with enums
  4. Goto-Definition Precision:

    • Occasional jumps to wrong line numbers
    • Especially in complex member access chains

Reporting Bugs

Found an issue? Please report it with:

  • WinCC OA version
  • Extension version (1.0.4)
  • Code example that reproduces the issue
  • Enable DEBUG logging and attach log output

Report Issue on GitHub


Commands

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

πŸ› οΈ Requirements

  • 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/config file.
  • Project Structure: Your workspace must contain a config/config file (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.


πŸ› Known Issues

Performance

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.

General

Extension Not Responding:
If the extension doesn't work as expected (IntelliSense not working, goto-definition fails), reload VS Code:

  1. Press Ctrl+Shift+P
  2. Type and select Reload Window
  3. This refreshes the language server

Current Limitations

  • Goto Precision: Sometimes jumps to incorrect lines (minor offset issues)
  • Inheritance: Only single-level inheritance supported (no deep chains)
  • Interfaces: Not yet implemented

πŸ“„ License

This project is licensed under the GNU General Public License v3.0.


πŸ™ Third-Party Code

This extension includes code from:

vscode-ctrlpptools by LukasSchopp
License: GNU GPL v3.0

Modified files:

  • language-configuration.json
  • syntaxes/ctrl.tmLanguage.json
  • syntaxes/ctrlpp.tmLanguage.json

πŸ“œ Disclaimer

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

About

WinCC OA CTRL Language Support - VS Code extension for syntax highlighting, IntelliSense, and code navigation

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Contributors