Files
vscode-cowriting-plugin/test/e2e/suite-no-workspace/noWorkspace.test.ts
T
Ben Stull 8fdea97d36 F4 SLICE-5: host E2E (propose/accept/reject/persist/stale/coexist) + seam fix: event-level net-effect matching survives host word-diff splitting (INV-9) (#12)
The accept E2E exposed a latent F3 limitation: VS Code word-diffs one
applied WorkspaceEdit into several minimal hunks when old/new share
interior tokens, so the registry's per-hunk exact match missed and seam
edits fell through as fragmented human spans. PendingEditRegistry.match
is replaced by matchEvent (all hunks inside the registered full range +
equal net delta — one applyEdit is one change event). Plan AMENDMENT 1.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 22:12:15 -07:00

41 lines
1.6 KiB
TypeScript

import * as assert from "assert";
import * as vscode from "vscode";
// Regression for #8: with NO workspace folder open, activate() used to return
// before registering the F2/F3 commands, so the palette errored with
// "command 'cowriting.editSelection' not found". The fix registers warning
// stubs instead. This suite runs in a second EDH pass launched WITHOUT a
// folder (see runTest.ts).
suite("no-workspace activation (#8)", () => {
test("EDH really has no workspace folder", () => {
assert.strictEqual(vscode.workspace.workspaceFolders, undefined);
});
test("all contributed coauthoring commands are registered as warning stubs", async () => {
const ext = vscode.extensions.getExtension("benstull.vscode-cowriting-plugin")!;
const api = await ext.activate();
assert.strictEqual(api, undefined, "no-root activation returns no API");
const all = await vscode.commands.getCommands(true);
for (const command of [
"cowriting.createThread",
"cowriting.reply",
"cowriting.resolveThread",
"cowriting.reopenThread",
"cowriting.editSelection",
"cowriting.toggleAttribution",
"cowriting.applyAgentEdit",
"cowriting.acceptProposal",
"cowriting.rejectProposal",
"cowriting.proposeAgentEdit",
]) {
assert.ok(all.includes(command), `${command} is registered`);
}
});
test("invoking a stub does not throw (shows a warning instead)", async () => {
await vscode.commands.executeCommand("cowriting.editSelection");
await vscode.commands.executeCommand("cowriting.createThread");
});
});