AL Coding Guidelines Extension
This VS Code extension enforces coding guidelines for Business Central AL language development. It checks files upon saving and reports issues.
Prerequisites
- Node.js: You must have Node.js installed to build this extension. Download it from https://nodejs.org/.
- VS Code: Visual Studio Code editor.
Setup Instructions
- Install Node.js: If you haven't already, download and install Node.js.
- Open Terminal: Open a terminal in this directory (
al-guidelines-extension).
- Install Dependencies: Run the following command:
npm install
- Compile the Extension:
npm run compile
- Run/Debug:
- Open this folder in VS Code.
- Press
F5 to start debugging.
- A new "Extension Development Host" window will open.
- Open an
.al file in that window to test the guidelines.
Features
- On Save Validation: Automatically checks AL files when you save them.
- Sample Rules:
- Empty File Check: Errors if the file is empty.
- Object Type Check: Warnings if the file does not start with a valid AL object type (e.g.,
table, page, codeunit).
Customization
You can add more rules in src/extension.ts inside the validateALFile function.
| |