ABAP Developer Assistant —
|
| Command | Status | Notes |
|---|---|---|
@abap /unittest |
v1 — working | Generates a Test Plan + ltcl_test class. Unknown fields become * TODO comments rather than fabricated field names. |
@abap /review |
Stub only (v3) | Registered, returns a "coming soon" message. Deliberately kept separate from /unittest's output. |
| ADT live lookup (package + DDIC fields) | Stub only (v2) | Off by default (abapAssistant.enableAdtLookup). Wiring the real ADT REST calls is the next milestone if /unittest's TODO-placeholder approach turns out to be a real pain point. |
| Transport/deployment automation | Not planned as part of this extension. Any code fix suggestions are output-only, never auto-applied, and this extension does not create or modify Transport Requests. |
Project layout
src/
extension.ts entry point — registers the chat participant
router.ts dispatches request.command -> handler
handlers/
unitTestHandler.ts /unittest logic (v1, live)
reviewHandler.ts /review stub (v3)
prompts/
unitTestPrompt.ts system + user prompt builder for /unittest
shared/
types.ts shared interfaces (hints, DDIC context)
hintExtractor.ts regex-based static analysis of ABAP source
modelSelector.ts Copilot model selection with fallback
adtLookup.ts v2 stub for live ADT package/field lookups
Adding a new command (e.g. a future /dump) means: one new handler file in
handlers/, one new prompt file in prompts/, one new case in router.ts.
Nothing else needs to change.
Running locally
npm install
npm run compile
Then press F5 in VS Code to launch an Extension Development Host. In the new window:
- Open an
.abapfile, or paste ABAP code directly. - Open Copilot Chat (
Ctrl+Alt+I/Cmd+Alt+I). - Select some code (or leave nothing selected to use the whole file) and type:
@abap /unittest
Configuration
| Setting | Default | Purpose |
|---|---|---|
abapAssistant.enableAdtLookup |
false |
(v2, not yet implemented) Turn on live DDIC/package lookups instead of TODO placeholders. |
abapAssistant.adtBaseUrl |
"" |
(v2) Base URL of your ABAP system's ADT service. |
Packaging for distribution
npx vsce package
This produces a .vsix file.
Distribution via GitHub Releases
The repo ships a workflow (.github/workflows/release.yml)
that builds the .vsix and attaches it to a GitHub Release whenever a version
tag is pushed:
npm version patch # or minor/major — bumps package.json + creates a git tag
git push origin main --tags
Once the workflow finishes, install the released .vsix:
gh release download <tag> --repo hmdev-test/abap-copilot-unit-test-agent --pattern '*.vsix'
code --install-extension abap-unit-test-generator-<version>.vsix
(gh is the GitHub CLI; since this repo is
private, the person running this must be signed in — gh auth login — and
have repo access.) To update, re-run the same two commands with the new tag.
Note: this does not give VS Code automatic background updates the way the
public Marketplace does — installing a new version is still a manual
gh release download + code --install-extension per person. If true
silent auto-update becomes a requirement, that needs a private Open VSX
registry (or the public Marketplace) instead of GitHub Releases.
Before wide rollout: confirm with your GitHub Copilot licensing/security
owner that routing ABAP source through vscode.lm (Copilot's model access)
is approved for your company's code — this uses the developer's existing
Copilot subscription and sends code to GitHub/Microsoft/OpenAI infrastructure
per Copilot's standard data handling.
Design principles this codebase follows
- No hardcoded model family.
modelSelector.tsasks for whatever Copilot model is available rather than pinning to a specific one that may be deprecated later. - Deterministic facts come from regex, not the LLM.
hintExtractor.tsparses method visibility, DB table access, and DI seams directly from the source so the model isn't re-deriving (and potentially getting wrong) facts that code can already tell us for certain. - Never fabricate DDIC field names. Without a live ADT connection (v2),
unknown structures get a
* TODO: verify fieldscomment instead of invented field names — a wrong guess here is worse than an honest gap. - Code review output stays separate from test generation output (v3 is a distinct command), so a developer asking for a test never gets an unrequested critique of their business logic silently mixed into the same response.
- No auto-applied changes, ever. Suggestions are always chat output for a human to review — nothing in this extension writes to files or transports on its own.