VS Code extension for Allen-Bradley L5X files with full Cursor IDE support. Edit, analyze, and modify PLC code with advanced features including syntax highlighting, tag navigation, ladder logic analysis, and real-time validation. Perfect for both VS Code and Cursor users working with Rockwell Automa
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
A Visual Studio Code extension for working with Allen-Bradley L5X files. This extension provides syntax highlighting, code intelligence, and other features to help you work with L5X files more effectively.
Features
Syntax Highlighting: Full syntax highlighting for L5X files
Code Intelligence:
Hover information for tags and instructions
Go to definition for tags
Find all references for tags
Code completion for tags and instructions
Language Server: Full LSP support for L5X files
Parser: Converts L5X XML into structured JSON format
Requirements
Visual Studio Code 1.85.0 or higher
Node.js 14.x or higher
Installation
Clone this repository
Run npm install to install dependencies
Run npm run compile to compile the extension
Press F5 to start debugging
Usage
Opening L5X Files
Simply open any .L5X file in VS Code. The extension will automatically activate and provide syntax highlighting and code intelligence features.
Code Intelligence
Hover: Hover over any tag or instruction to see detailed information
Go to Definition: Right-click on a tag and select "Go to Definition" to jump to its definition
Find All References: Right-click on a tag and select "Find All References" to see all places where the tag is used
Code Completion: Start typing a tag name or instruction to see suggestions
Commands
The extension provides the following commands:
L5X: Show Tag References: Shows all references to the selected tag
L5X: Show Rung Summary: Shows a summary of the selected rung's logic
Development
Project Structure
.
├── src/ # Source files
│ ├── extension.ts # Extension entry point
│ ├── l5xParser.ts # L5X parser implementation
│ └── languageServer.ts # Language server implementation
├── syntaxes/ # Syntax highlighting
│ └── l5x.tmLanguage.json # TextMate grammar for L5X
├── package.json # Extension manifest
└── README.md # This file
Building
Install dependencies:
npm install
Compile the extension:
npm run compile
Start debugging:
Press F5 in VS Code
Select "Extension" from the debug configuration
Testing
Run the test suite:
npm test
Contributing
Fork the repository
Create a feature branch
Make your changes
Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.