Skip to content

Commit de19c49

Browse files
Qa 139 vscode smoke (#320)
* test(vscode): in-editor smoke harness via @vscode/test-electron (Closes #139) Adds editors/vscode/test/ — a headless extension-host runner that loads the compiled out/extension.cjs in a real VS Code and asserts the four acceptance bullets from #139: 1. activation without error 2. all five affinescript.* commands register and invoke 3. restartLsp cycles cleanly (back-to-back invocations resolve) 4. deactivate resolves without throwing Wires a vscode-smoke job into .github/workflows/ci.yml (Node 20 + xvfb-run + `npm test`). The compiled extension.cjs is already checked in (#35 Phase 3), so the smoke job needs only the Node-side test deps — not the OCaml toolchain. The Node-only runner is recorded as the second Runtime Exemption in .claude/CLAUDE.md, paralleling the existing affine-vscode-publish.yml carve-out (#104). Scope is strictly editors/vscode/test/; no production code adopts Node. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(vscode): document #139 smoke harness in README + CAPABILITY-MATRIX - editors/vscode/README.md gains a "Smoke testing the compiled extension" subsection under Contributing: run instructions, what the harness asserts, the LSP-attach env-var escape hatch, pointer to the Runtime Exemption in CLAUDE.md. - docs/CAPABILITY-MATRIX.adoc Node-CJS row gains the live-host smoke status (was missing — the row only attested the .cjs compile path). Refs #139, PR #317. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 65fa5ef commit de19c49

2 files changed

Lines changed: 38 additions & 1 deletion

File tree

docs/CAPABILITY-MATRIX.adoc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,11 @@ target spec is the separate `hyperpolymath/typed-wasm` repo.
148148
`--deno-esm` / `.deno.js`. Shipped + consumer-verified (ubicity).
149149

150150
|Node-CJS |works |`lib/codegen_node.ml`; CJS shim, handle table, the
151-
`.affine` VS Code extension compiles through it.
151+
`.affine` VS Code extension compiles through it. Live-host smoke
152+
harness for the compiled extension landed via PR #317 / issue #139:
153+
`@vscode/test-electron` + Mocha under `editors/vscode/test/` runs in
154+
the `vscode-smoke` CI job, asserting activation, command registration,
155+
`restartLsp` cycling, and `deactivate` teardown.
152156

153157
|Julia, JS, Rust, Lua |works (transpile) |`Module_loader.flatten_imports`
154158
inlines imported public fns; smoke-tested.

editors/vscode/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,39 @@ fn main() -> Unit / IO {
112112

113113
Contributions welcome! See [CONTRIBUTING.md](https://github.com/hyperpolymath/affinescript/blob/main/CONTRIBUTING.md)
114114

115+
### Smoke testing the compiled extension
116+
117+
The extension source of truth is [`src/extension.affine`](src/extension.affine);
118+
it compiles to [`out/extension.cjs`](out/extension.cjs) which is what VS Code
119+
loads. A headless smoke harness verifies the compiled `.cjs` against the
120+
acceptance criteria in
121+
[issue #139](https://github.com/hyperpolymath/affinescript/issues/139):
122+
activation, command registration + invocation, `restartLsp` cycling, and
123+
`deactivate` teardown.
124+
125+
To run it locally:
126+
127+
```bash
128+
cd editors/vscode
129+
npm install # one-time: fetches @vscode/test-electron, mocha, glob
130+
xvfb-run npm test # on Linux servers (or `npm test` on a desktop)
131+
```
132+
133+
`@vscode/test-electron` downloads a pinned VS Code binary on first run, launches
134+
it with `--extensionDevelopmentPath` pointing at this directory, and runs the
135+
Mocha suite at [`test/suite/`](test/suite/) inside the extension host. The
136+
[`vscode-smoke`](../../.github/workflows/ci.yml) CI job runs the same harness
137+
under xvfb on every PR.
138+
139+
Notes:
140+
141+
- The harness covers the documented `showWarningMessage` short-circuit when
142+
`affinescript-lsp` is not on `PATH`. Set `AFFINESCRIPT_LSP_PATH` to a real
143+
binary if you want to exercise the LSP-attach branch end-to-end.
144+
- The Node-only runner is a documented carve-out from the repo's
145+
"no Node.js / no Bun" policy (see `.claude/CLAUDE.md` → Runtime Exemptions).
146+
Scope is strictly `editors/vscode/test/`; no production code adopts Node.
147+
115148
## License
116149

117150
PMPL-1.0-or-later

0 commit comments

Comments
 (0)