Overview
The Afunana VS Code extension — "Legacy Systems Intelligence" — brings the platform's understanding of the estate directly into the editor. It connects to the Afunana server and layers program documentation, hover intelligence, quality diagnostics, code navigation, streaming chat, and live IBM i source editing over ordinary COBOL, RPGLE, CL, and DDS files, without leaving VS Code.
Everything the extension shows is drawn from Afunana's cross-referenced knowledge graph — so a hover over a CALL explains what the called program does for the business, not just that it exists, and "go to definition" can reach a member that lives only on the IBM i.
The extension is fully self-contained: it needs no companion extension and no vendor connectivity client to reach the IBM i. Your editor never connects to the IBM i directly — it talks only to the Afunana server, which in turn is connected to your system. Reading and writing source members, resolving definitions on the box, and running quality checks all happen through Afunana, so a developer installs one extension and is ready to work with nothing else to configure.
The extension is IBM i-centric today: source read/write and the language tooling target the IBM i.
Installation
The primary install path is the VSIX package shipped with your Afunana deployment.
From VSIX:
- Download the
.vsixfrom your Afunana server's downloads page or from your administrator. - In the Extensions view, choose "Install from VSIX..." and select the file.
From the Marketplace (if/when published): search "Afunana" in the Extensions panel and Install.
The installed version is shown in the Extensions panel.
Configuration & login
The only thing to configure is the Afunana API base URL; the auth token is managed for you after login.
Run the Afunana: Login command, enter your credentials, and the token is stored securely in VS Code's SecretStorage. The extension re-authenticates automatically on later launches.
Sidebar
The "Legacy Systems Intelligence" sidebar has five tabs:
| Tab | Description |
|---|---|
| Programs | Browse/search all programs; click to open documentation. |
| Files | Browse/search all files/tables; click for file details and layout. |
| Tree | Hierarchical program/file structure. |
| Overview | System-level narrative and statistics. |
| Chat | In-editor conversational assistant (below). |
Program documentation auto-loads when you switch to a file that matches a known program in the collection.
Hover intelligence
Hover over an identifier to see business-level context pulled from Afunana:
| Element | Hover content |
|---|---|
| CALL'd program | Purpose and criticality of the called program. |
| File name | Description, record format, key fields. |
| Field name | Definition, data type, size, usage context. |
| Paragraph / section | Its role in the program's logic. |
| COPY member | Copybook description and the programs that include it. |
| Business rule | The rule the code at this point enforces. |
Hover data is fetched from the server and cached locally for responsiveness.
Diagnostics
The extension surfaces two kinds of findings as native VS Code diagnostics (Problems panel + inline squiggles), refreshed on open and save:
- Afunana quality findings — the silent-failure layer. Parameter/interface mismatch, MOVE truncation, unsafe control flow, and the other deterministic checks, with each finding's severity governed by the server-side check catalog. These are the defects that produce no runtime error — see AI & Analysis Pipeline → Silent-failure detection.
- Live COBOL syntax check. The extension triggers a server-side live COBOL syntax check: the editor sends the buffer to Afunana, Afunana runs the check and returns diagnostics, and the extension renders them inline — so structural problems show up as you edit with no local COBOL toolchain required. This reinforces the self-contained model: all language tooling lives on the server.
Navigation
CodeLens. Above each CALL in COBOL and RPGLE, a lens shows the called program's description — immediate context without navigating away:
Go to definition.
| Element | Target |
|---|---|
| Program in CALL | The called program's source. |
| Copybook in COPY | The copybook source. |
| Section / paragraph | Its definition in the current file. |
If a target member is not present locally, the extension fetches it from the IBM i on demand.
Call hierarchy. Right-click a program → "Show Call Hierarchy" for outgoing calls (direct and transitive) and incoming callers, built from Afunana's cross-reference data.
In-editor chat
The Chat tab is a full conversational interface over the same multi-agent RAG pipeline as the web app (see Chat & RAG System):
- Ask about any program, file, or field in the collection.
- Responses stream in real time over SSE, with citations to
PROGRAM:LINE. - Session history is preserved — continue previous conversations.
- Code in responses is syntax-highlighted.
Change plans are display-only in the extension. When the assistant produces a change plan, the extension renders it for review; it does not apply it. Execution happens only through the approval-gated admin workflow on the server (see AI & Analysis Pipeline → Close-the-loop code generation).
Live source editing & write-back
The extension can edit IBM i source in place and write it back:
- Click Edit in VS Code on any program in the sidebar.
- The extension pulls the member from the IBM i into a temporary local file.
- Edit with full syntax highlighting and diagnostics.
- Save — the extension PUTs the changes back to the IBM i source library.
The target library follows the program's configuration in Afunana; multiple libraries are supported.
Per-developer IBM i sign-on
Reading source for editing and saving it back use your own IBM i user profile and password, not the shared Afunana service account — so reads and writes are authorized and attributed to the real developer on the box.
- The first edit/save prompts for your IBM i user and password; credentials are stored in SecretStorage (never in plaintext settings) and are not synced to the server beyond the live request.
- They are transmitted only when reading or saving source, over HTTPS. If the server URL is not HTTPS, the extension warns before sending them.
- Manage them with
Afunana: Set AS/400 Credentials/Afunana: Clear AS/400 Credentials. - If the headers are omitted, the server falls back to the global IBM i account. A sign-on/authority failure on save returns HTTP 401 so you can correct your credentials.
Language support
Four bundled grammars provide legacy-language syntax highlighting — COBOL (with column indicators), RPGLE (free-format and fixed-format), CL (command syntax and variables), and DDS (physical, logical, display, and printer files) — across their usual source file extensions.
Commands
All extension actions are available from the Command Palette — login, opening program and file documentation, field lookup, data preview, navigating to a called program, pulling IBM i source in for editing, toggling copybook resolution, managing IBM i credentials, opening settings, and launching the full web app.
Keyboard shortcuts
Standard VS Code gestures apply — go to definition, show call hierarchy for the current program, and the Command Palette for all Afunana commands.