OpenIBM
Syntax highlighting, formatting, IntelliSense, schema explorer, and client code generation for .ibmi schema files.
Features
Syntax Highlighting
Full grammar support for all .ibmi schema constructs — datasource, generator, import, program, serviceprogram, table, procedure, ds, dataq, and outbound blocks (including nested request / response sub-blocks).
IntelliSense & Completions
- Block keyword snippets at the top level — including
outbound with a full starter template
- Import path completions — typing
import " shows .ibmi files and folders in your workspace; use Tab to navigate into subdirectories
- Context-aware attribute completions inside each block:
library, transport, system, function, resultSet, timeout, …
- Inside
outbound: library, timeout, request { }, response { }
- Inside
request / response: all IBM i types with argument snippets
- All IBM i types with argument snippets:
PackedDecimal(15, 0), Char(10), VarChar(255), etc.
- Parameter direction directives:
@in, @out, @inout
- Table column directives:
@id, @map("COLNAME"), @default(...), @relation(...)
Format your .ibmi file with Shift+Alt+F (or right-click → Format Document). Aligns columns and attributes for readability.
Click the OpenIBM icon in the Activity Bar to open the Schema Explorer.
- Lists all
.ibmi files in your workspace
- Expands each file into Programs, Service Programs, Tables, Procedures, Data Queues, and Outbound handlers
- Click any declaration to jump directly to it in the editor
- Refresh button (↺) to rescan the workspace
- Auto-refreshes when
.ibmi files are created, changed, or deleted
Generate Client Code
Generate a fully-typed TypeScript client from your .ibmi schema:
- Click the ▶ Generate Client Code lens at the top of any open
.ibmi file, or
- Click the ▶ play button next to a file node in the Schema Explorer
Output is written to the path set in your generator block, or ./generated/ by default.
generator client {
output = "./src/generated/ibmi"
}
File Icon (Material Icon Theme)
If you use the Material Icon Theme, this extension automatically configures .ibmi files to use the database icon.
If the icon doesn't appear, add this to your settings.json manually:
"material-icon-theme.files.associations": {
"*.ibmi": "database"
}
Example Schema
datasource ibmi {
transport = env("IBMI_TRANSPORT")
system = env("IBMI_SYSTEM")
}
generator client {
output = "./src/generated/ibmi"
}
// Split large schemas across files — declarations are merged at generate time
import "./features/outbounds.ibmi"
// DB2 table with relations and defaults
table Customer @map("MYLIB.CUSTMST") {
id Int @id @map("CUSTID")
name Char(25) @map("CUSTNAME")
balance PackedDecimal(11, 2) @map("BALANCE")
created Timestamp @default(now())
}
// IBM i *PGM call
program GetCustomer @map("GETCUST") {
library = "MYLIB"
custId Int @in
custName Char(25) @out
}
// DB2 stored procedure
procedure ListCustomers {
library = "MYLIB"
resultSet = "Customer"
state Char(2) @in
}
// Outbound: lets an RPG program call a JavaScript function
outbound ValidateOrder {
library = "JSBRIDGE"
timeout = 30
request {
orderId Int
custNum Char(6)
amount Decimal(9, 2)
}
response {
valid Bool
message Char(100)
code Int
}
}
outbound Block
The outbound block enables RPG → JavaScript calls via IBM i data queues. It is the reverse of a normal program call: your RPG code calls a JS function and waits for the response.
How it works
RPG job Node.js process
────────────────────────────────────────────────
CALL_VALIDATEORDER(req)
serialize + send → JSBRIDGE/VALIDATERQ ──────► receiveDataQueue()
call your async handler(req)
◄── JSBRIDGE/VALIDATERS ← sendDataQueue() ─────── return { valid: true, ... }
deserialize response // or throw to signal error
return to RPG caller
What gets generated
outbound/
ValidateOrder.ts ← JS listener (TypeScript)
rpg/
ValidateOrder/
VALIDATEORDER.rpgle ← RPG service program source (compile this)
VALIDATEORDER_H.rpgleinc ← copybook (/COPY this in caller programs)
VALIDATEORDER_SAMPLE.rpgle ← complete example caller program
Snippet
Typing outbound at the top level inserts:
outbound Name {
library = "MYLIB"
timeout = 30
request {
field Int
}
response {
field Bool
}
}
Inside request and response blocks, type completions offer all IBM i scalar types with argument snippets.
Requirements
- VS Code
^1.80.0
- An IBM i system accessible via HTTP, SSH, or ODBC transport
@openibm/client in your project for runtime usage