Afunana
Afunana Documentation

VS Code Extension

View documentation, navigate dependencies, and chat with your codebase in VS Code.

← All docs

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:

  1. Download the .vsix from your Afunana server's downloads page or from your administrator.
  2. 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.

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:

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):

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:

  1. Click Edit in VS Code on any program in the sidebar.
  2. The extension pulls the member from the IBM i into a temporary local file.
  3. Edit with full syntax highlighting and diagnostics.
  4. 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.

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.