WaRPGate for IBM i
Language support for Warp, the .warp/.warproj/.warpcfg DSL compiled by
the warpgate compiler into RPGLE/DDS for IBM i. This extension wraps the real
compiler binary — diagnostics reflect exactly what the CLI would report.
📖 Full documentation (guides and language reference):
https://www.softwarehouse.pe/warpgate
Licensing
Generate, Build & Deploy and Reverse Engineer DDS... require a Warpgate
license; Validate File does not, so IntelliSense and live diagnostics always
work. Licenses are currently issued free of charge, valid for 90 days and
renewable — see Licensing
for how to request one.
Features
- Syntax highlighting for
.warp, .warproj and .warpcfg files: sections
(@Documentation, @Properties, @Structure, @References, @Variables,
@Parameters, @Layout, @Source, @Project, @GeneratorConfig,
@Profile, ...), variables (&var), data types (char, varchar,
number, date, time, timestamp, field, list, matrix, struct),
and the @Source control-flow keywords (Procedure, Function, For Each,
Where, Defined By, When None, If, While, ...).
- Live diagnostics: runs the compiler in the background on open/save and
shows errors/warnings as native squiggles + Problems panel entries.
- IntelliSense:
@ completes section names, & completes variables
declared anywhere in the file, and section-aware completion for every
section's property keys (with their expected values), @Fields/
@Variables data types, @Indexes entry kinds, @Layout controls,
@References keys, @Parameters modes, and @Source control-flow
keywords. Hovering any of those, or a &variable, shows its documentation.
- Outline / breadcrumbs via a
DocumentSymbolProvider (sections,
Procedure/Function declarations).
- Go to Definition on
&variable jumps to its declaration; quoted paths in
@References that resolve to a real file become clickable links.
- Snippets for the common section/statement shapes (
doc, properties,
structure, field, index, variables, parameters, layout, grid,
foreach, procedure, function, if, project, genconfig, profile,
license, licensefile).
- Layout Preview:
WaRPGate: Preview Layout renders @Layout as a
24x80 IBM i 5250-style text screen beside the editor, live-updating as you
type. See below for details.
- Project profiles: a
.warpcfg can declare several deployment profiles
(@Profile "Dev", @Profile "UAT", @Profile "Prod", free-form name),
each with its own @Connection/@Deployment/@License. WaRPGate: Select Active Profile picks which one is active, shown in a status bar item.
Without a choice, the CLI falls back to the project's Default Profile.
- Commands (Command Palette / editor context menu):
WaRPGate: Validate File, WaRPGate: Generate, WaRPGate: Build & Deploy, WaRPGate: Select Active Profile, WaRPGate: Reverse Engineer DDS..., WaRPGate: Select Project File, WaRPGate: Preview Layout, WaRPGate: Select Layout Block.
Requirements
Validation and code generation require a .warproj project file somewhere in
the workspace (or set explicitly, see below) — the compiler always resolves a
.warp source against its owning project.
Compiler binaries for Linux and Windows are bundled under bin/. For any
other platform, build the warpgate compiler yourself and point
warpgate.compilerPath at the resulting binary.
Validate vs Generate vs Build & Deploy vs Reverse Engineer DDS...
WaRPGate: Validate File only parses and runs the semantic analyzer
(@Structure, @Fields, @Indexes, @Deployment, @Connection, ...). It
never touches the network and needs no license — safe to run on every save,
which is why it's the default for live diagnostics.
WaRPGate: Generate does everything Validate does, and then generates
the DDS (physical + logical files) and the compile CL locally — it never
touches the IBM i.
WaRPGate: Build & Deploy does everything Generate does, and then
uploads the result to the IBM i configured in the active profile's
@Connection/@Deployment (via ssh/scp/sftp/ftp, per Protocol),
and runs the compile there (CRTPF/CRTLF/CRTCLPGM) — a real remote
system, with real credentials. Because of that, it asks for confirmation
before it starts. Output and any compiler-reported errors from the remote
compile show up in the "WaRPGate" output channel.
WaRPGate: Reverse Engineer DDS... goes the other way: it connects to
the IBM i configured in the active project's @Connection, downloads a
DDS physical-file (PF) source member, and writes a new .warp with the
equivalent @Structure/@Fields. It also asks, optionally, for a
comma-separated list of sibling logical-file (LF) member names (access
paths on the same table, primary key included — it is generated as its
own LF since compiler 1.3.0, not embedded in the PF); when given,
those get folded into the resulting @Indexes, though a unique LF
always comes back as Unique, never PrimaryKey (classic DDS has no
keyword for that distinction) — relabel it by hand if needed. Like
Build & Deploy, it connects to a real IBM i and asks for confirmation
before it starts.
Generate, Build & Deploy and Reverse Engineer DDS... require a license
(see Licensing); Validate File never does.
Project profiles (@Profile)
A .warpcfg declares one or more deployment profiles inside
@GeneratorConfig, each with its own @Connection/@Deployment/@License
— typical names are Dev, UAT, Prod, but any name works. Run WaRPGate: Select Active Profile to pick one from a list (or "Use project default");
the choice is remembered per project and shown in a status bar item you can
click to change it. Without an explicit choice, the CLI uses the project's
Default Profile (or the only declared profile, if there's just one).
Preview Layout
WaRPGate: Preview Layout opens a panel beside the editor showing what
@Layout would look like on a real IBM i 5250 terminal: a text screen,
x,y read as (row, column), both 1-based. It's a local, read-only
rendering (nothing is sent anywhere) and stays open, updating live as you
edit the file.
The screen size defaults to 24x80 but follows the active file's project:
.warproj → @Generator/@Paths.Config → that .warpcfg's
@GeneratorConfig/@Screen { Rows: N Columns: M }, if present. @Layout
itself can only use rows 1 through Rows - 2 (22, by default) — IBM i
reserves the row right above the last one for the attention line, where
function keys are painted as-is (e.g. F3=Salir). Configure those in
@Screen/@FunctionKeys { F3: "Salir" F5: "Refresh" F24: "Mas teclas" }; a
custom Event 'Name' KeyNumber ... EndEvent (Screen files only) paints its
own label there too, alongside the configured ones. A control that writes
past row Rows - 2, or a function key claimed by both @FunctionKeys and a
custom Event, shows up in the warnings list under the preview instead of
failing silently — the compiler itself warns about both when you run
Validate.
Since there's no runtime to supply real values, Input and DataGridView
cells show a generic placeholder shaped by the bound &Variable's declared
@Variables type — char(10) becomes 10 underscores, number(7,2) becomes
8 characters (7 digits + the decimal point), date becomes 10 — falling back
to a default width for field(...)/list(...)/undeclared variables.
DataGridView(x, y, records, separator)'s optional 4th argument is the
literal shown between columns (e.g. "|"); without it, columns are shown
directly adjacent, with no space reserved for a separator. A generic wrapper
control with no coordinates of its own (e.g. Block("...") in a
Program-type file's @Layout) contributes no position; its children
render at their own x,y.
Extension Settings
warpgate.compilerPath — absolute path to the compiler executable. Empty
uses the binary bundled with the extension.
warpgate.projectFile — absolute path, or path relative to the workspace
folder, to the .warproj used for validation/generation. Empty auto-detects
the first .warproj found in the workspace (also settable via the
WaRPGate: Select Project File command).
warpgate.validateOnSave (default true) — validate on every save.
warpgate.validateOnOpen (default true) — validate when a file is opened.
Custom syntax colors
By default, Warp files are colored by whatever theme you have active, using
its usual rules for comments/strings/keywords/etc. If you want to override
specific colors instead:
warpgate.colors.enabled (default false) — turn this on first; the
settings below do nothing until it's set.
warpgate.colors.comments, warpgate.colors.strings,
warpgate.colors.sections (@Name), warpgate.colors.variables
(&Name), warpgate.colors.numbers, warpgate.colors.keywords
(For, If, Event, ...), warpgate.colors.dataTypes (char,
number, ...), warpgate.colors.eventNames (Enter, Exit, Load,
Refresh, Start), warpgate.colors.functionCalls,
warpgate.colors.propertyKeys, and warpgate.colors.operators — each a
hex color (e.g. #CE9178). Leave any of them empty to keep your theme's
default for that category. warpgate.colors.strings applies to both
"double" and 'single' quoted strings — Warp doesn't distinguish
between them.
These are applied by merging into your user editor.tokenColorCustomizations
setting (VS Code's only mechanism for recoloring specific syntax scopes);
only the Warp-specific rules are touched, anything else already in that
setting is left alone.
Known Issues
- The compiler's diagnostics don't currently include which file an error
belongs to, so a syntax error in a referenced project/table file can
(rarely) surface attributed to the wrong open document.
- Live validation only re-runs on open/save, not on every keystroke, since the
compiler reads from disk rather than the in-memory buffer.
| |