Skip to content

Expose the running extension API for integration tests - #143

Open
rcosta358 wants to merge 1 commit into
codex/issue-125-test-workflowfrom
codex/issue-130-test-api
Open

rcosta358 wants to merge 1 commit into
codex/issue-125-test-workflowfrom
codex/issue-130-test-api

Conversation

@rcosta358

Copy link
Copy Markdown
Collaborator

Expose readiness, diagnostic events (including empty results), current status/diagnostics, and webview messages through the running extension’s activation API. Startup failures reject readiness while existing extension behavior stays intact.

Validation: lint, TypeScript, production bundle, VSIX packaging, and extension installation passed. The integration smoke test in #131 uses this API.

Closes #130.

Generated by Codex.

@rcosta358 rcosta358 added the testing Testing related label Oct 2, 2026

@CatarinaGamboa CatarinaGamboa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed with Claude Code (reviewer + adversarial agents per PR, findings checked against the code before posting).

extension.webview?.sendMessage({ type: "diagnostics", diagnostics });
if (extension.context)
extension.webview?.sendMessage({ type: "context", context: extension.context, errorAtCursor: extension.errorAtCursor });
extension.diagnosticsEmitter.fire(diagnostics);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A verifier crash fires no event. onDiagnostics only fires on liquidjava/diagnostics. When the verifier throws, the server catches it in LJDiagnosticsService.generateDiagnostics and sends liquidjava/failure instead, and handleLJFailure doesn't fire anything. A test waiting on onDiagnostics then sits until the 120s Mocha timeout, with nothing saying the server crashed. #130 asked for tests to be able to tell a crash apart from a slow run.

Suggest firing something from handleLJFailure too (a separate onFailure event, or a status-change event), so tests can fail fast with a clear message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Testing related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants