ZAB ERP Formatter & Tools for VS CodeA comprehensive, production-grade Visual Studio Code extension built for ZAB ERP development. Provides Prettier-like code formatting, real-time diagnostic validation (Crystal Reports, button sequences, list counts, filename matching), Smart Quick Fixes, Emmet-style boilerplate generators, snippet libraries, syntax highlighting, and custom file icons. Table of Contents
Supported File Formats
Key Features1. Code Formatting (Prettier-like)
2. Real-Time Crystal Reports ValidationValidates Crystal Reports invocations in both In
|
| Prefix | Expansion |
|---|---|
scr / screen |
screen <name> ... end screen |
frm / form |
form <name> ... end form |
lis / list |
list <name> ... end list |
tbl / table |
table <name> ... end table |
fld / field |
field <name> ... end field |
evt / event |
event before/after ... end event |
if |
if <cond> ... end if |
while |
while <cond> ... end while |
jsc / jscript |
jscript <name> ... end jscript |
dash |
dashboard <name> ... end dashboard |
crd |
card <name> ... end card |
chrt |
chart <name> ... end chart |
qry |
query <name> ... end query |
modal / display modal |
Expand modal button properties (caption, display modal, icon, src) |
fld:modal / field:modal |
Full modal button declaration (width, height, caption, display modal, icon, src) |
//hide navbar / hide navbar |
Style block or CSS injection to hide .topnav, .btn-slide, and #floatingMenuButton |
7. Modal Display Expansion & Hide Navbar Directives
Modal Display Expansion:
Inside button field blocks in .screen files, declaring display modal automatically completes the full modal configuration:
caption <Caption Name>
display modal
icon <i class="fas fa-solid fa-list-ul" aria-hidden="true"></i>
src /login?screen=<Screen Name>
- Smart Duplicate Prevention: If
captionis already defined on the line above, the extension preserves your caption without duplicating it. - Quick Fix (
Ctrl + .): PressCtrl + .on anydisplay modalstatement to immediately expand missing modal properties (caption,icon,src). - Snippets: Available via
display modal,modal,disp:modal, andfld:modal.
Hide Navbar Directive (//hide navbar):
When you add the comment //hide navbar:
//hide navbar
- Existing
<style>Block: If a<style>block is available anywhere in the file, the extension seamlessly injects:
directly inside the.topnav, .btn-slide, #floatingMenuButton { display: none !important; }<style>block before</style>, removing the comment. - No Existing
<style>Block: If no<style>block exists, it creates the<style>block containing the rules at the comment location. - Multiple Triggers: Works instantly through Document Formatting (Save / Format Document), Quick Fix lightbulb (
Ctrl + .), or auto-completion snippets.
8. Custom File Icon Theme
A complete file icon theme specifically tailored for ZAB ERP files and general web languages:
.screen➔ Cyan Display Icon.def➔ Amber Database Table Icon.list➔ Emerald List Icon.menu➔ Purple Navigation Tree Icon.column➔ Sky Blue Column Definition Icon.lrpt➔ Teal Report Icon.dashboard➔ Indigo Dashboard Icon.dbqr➔ Amber Query Icon
Installation Guide
Method 1: Install from VSIX via VS Code UI (Recommended)
- In VS Code, open the Extensions view (
Ctrl + Shift + X). - Click the
...(Views and More Actions) icon in the top-right corner of the Extensions panel. - Select Install from VSIX....
- Browse to the repository folder and select:
vscode-zab-formatter-1.3.4.vsix - Click Install. VS Code will install the extension and reload automatically.
Method 2: Install via Command Line Terminal
Open PowerShell or Command Prompt in the repository folder and run:
code --install-extension vscode-zab-formatter-1.3.4.vsix
Method 3: Build from Source
If you want to modify the source code and build the extension package:
- Clone the repository:
git clone https://github.com/nawfs254/vscode-zab-formatter.git cd vscode-zab-formatter - Install dependencies:
npm install - Run the unit test suite:
node tests/test-formatter.js - Package the extension into a
.vsixfile:npx @vscode/vsce package --no-git-tag-version
Recommended Configuration (settings.json)
To enable automatic formatting on save and activate the icon theme, add the following to your VS Code settings.json (Ctrl + Shift + P ➔ Preferences: Open User Settings (JSON)):
{
"editor.formatOnSave": true,
"workbench.iconTheme": "zab-icons",
"[zab-screen]": {
"editor.defaultFormatter": "zab-tools.vscode-zab-formatter"
},
"[zab-def]": {
"editor.defaultFormatter": "zab-tools.vscode-zab-formatter"
},
"[zab-list]": {
"editor.defaultFormatter": "zab-tools.vscode-zab-formatter"
},
"[zab-menu]": {
"editor.defaultFormatter": "zab-tools.vscode-zab-formatter"
},
"[zab-column]": {
"editor.defaultFormatter": "zab-tools.vscode-zab-formatter"
},
"[zab-lrpt]": {
"editor.defaultFormatter": "zab-tools.vscode-zab-formatter"
},
"[zab-dashboard]": {
"editor.defaultFormatter": "zab-tools.vscode-zab-formatter"
},
"[zab-dbqr]": {
"editor.defaultFormatter": "zab-tools.vscode-zab-formatter"
}
}
Settings Reference
Configurable in VS Code Settings (Ctrl + , ➔ search zab.formatter):
| Setting | Default | Description |
|---|---|---|
zab.formatter.enableColumnQuickFix |
false |
Enable Quick Fixes (Ctrl + .) to automatically add/include missing columns into .def and table.column files. When disabled, missing column errors remain visible but Quick Fixes are suppressed. |
zab.formatter.enableButtonSequenceQuickFix |
false |
Enable Quick Fixes (Ctrl + .) to reorder button sequences into standard Detail or Header order in .screen files. When disabled, button sequence warnings remain visible but Quick Fixes are suppressed. |
zab.formatter.authorId |
"" |
Optional identifier for column addition comments. If blank, automatically uses the PC's MAC address and computer name (e.g. {mac} - ({pcName})). |
zab.formatter.tabSize |
2 |
Number of spaces per indentation level. |
zab.formatter.insertSpaces |
true |
Indent with spaces instead of tab characters. |
zab.formatter.alignMenuPipes |
true |
Automatically align pipe columns (\|) in .menu and .column files. |
zab.formatter.maxConsecutiveBlankLines |
1 |
Maximum consecutive blank lines allowed before collapsing. |
Keyboard Shortcuts
| Action | Windows / Linux | macOS |
|---|---|---|
| Format Document | Shift + Alt + F |
Shift + Option + F |
| Trigger Quick Fix | Ctrl + . |
Cmd + . |
| Trigger Autocompletion | Ctrl + Space |
Cmd + Space |
| Open Command Palette | Ctrl + Shift + P |
Cmd + Shift + P |
PDF Documentation
A complete, beautifully styled installation and user guide PDF is included in the repository:
- File:
ZAB_ERP_Formatter_Installation_and_User_Guide.pdf
Contains full step-by-step instructions, troubleshooting tips, screenshots, and syntax references for all ZAB developers.