Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ The extension detects outdated CLI builds and warns with upgrade guidance. It re
Set `patchloom.path` in settings, or add the CLI to your `PATH`.

**CLI compatibility warning**
Run `Patchloom: Open Releases` to download the latest release. The extension requires 0.3.0 or newer; 0.6.0 is recommended.
Run `Patchloom: Open Releases` to download the latest release. The extension requires 0.3.0 or newer; 0.7.0 is recommended.

**MCP config not injected**
Run `Patchloom: Configure MCP` and select the target editor config.
Expand Down Expand Up @@ -183,7 +183,7 @@ File bugs and feature requests at [patchloom/patchloom-vscode/issues](https://gi
## Requirements

- VS Code 1.90 or newer (or compatible editors: Cursor, Windsurf, VSCodium)
- [Patchloom CLI](https://github.com/patchloom/patchloom) 0.3.0 or newer (0.6.0+ recommended for 43 MCP tools including 11 AST tools, declarative MCP registry, and concurrent performance improvements)
- [Patchloom CLI](https://github.com/patchloom/patchloom) 0.3.0 or newer (0.7.0+ recommended for 43 MCP tools, LLM-aligned CLI arguments, post-write formatter hook, and transaction engine unification)

## Contributing

Expand Down
4 changes: 2 additions & 2 deletions src/commands/quickActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export async function runQuickAction(): Promise<void> {
{
label: "Replace text in file",
description: "Literal text replacement with diff preview",
detail: "Builds `patchloom replace <from> --to <to> <file>`",
detail: "Builds `patchloom replace <old> --new <new> <file>`",
run: async () => {
const target = await pickWorkspaceFileTarget("Select a file for Patchloom replace");
if (!target) {
Expand Down Expand Up @@ -809,7 +809,7 @@ export function buildReplaceQuickAction(targetPath: string, from: string, to: st
title: `Replace text in ${path.basename(targetPath)}`,
targetPath,
targetArgIndices: [4],
args: ["replace", from, "--to", to, targetPath]
args: ["replace", from, "--new", to, targetPath]
};
}

Expand Down
12 changes: 11 additions & 1 deletion src/install/managed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export type PatchloomTargetTriple =
| "x86_64-apple-darwin"
| "aarch64-unknown-linux-gnu"
| "x86_64-unknown-linux-gnu"
| "x86_64-pc-windows-msvc";
| "x86_64-pc-windows-msvc"
| "aarch64-pc-windows-msvc";

export interface ManagedInstallTarget {
readonly platform: NodeJS.Platform;
Expand Down Expand Up @@ -250,6 +251,15 @@ export function detectManagedInstallTarget(
};
}

if (platform === "win32" && arch === "arm64") {
return {
platform,
arch,
targetTriple: "aarch64-pc-windows-msvc",
archiveFormat: ".zip"
};
}

return undefined;
}

Expand Down
6 changes: 6 additions & 0 deletions test/unit/binary.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,12 @@ test("detectManagedInstallTarget maps supported platforms to release targets", (
targetTriple: "x86_64-pc-windows-msvc",
archiveFormat: ".zip"
});
assert.deepEqual(detectManagedInstallTarget("win32", "arm64"), {
platform: "win32",
arch: "arm64",
targetTriple: "aarch64-pc-windows-msvc",
archiveFormat: ".zip"
});
assert.equal(detectManagedInstallTarget("linux", "arm"), undefined);
});

Expand Down
4 changes: 2 additions & 2 deletions test/unit/outputChannel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ test("logCommand appends command with arguments and cwd", () => {
dispose() {}
}));

log.logCommand("/usr/bin/patchloom", ["replace", "old", "--to", "new", "file.txt"], "/workspace");
log.logCommand("/usr/bin/patchloom", ["replace", "old", "--new", "new", "file.txt"], "/workspace");

assert.equal(lines.length, 2);
assert.ok(lines[0].includes("patchloom"));
assert.ok(lines[0].includes("replace old --to new file.txt"));
assert.ok(lines[0].includes("replace old --new new file.txt"));
assert.ok(lines[1].includes("cwd: /workspace"));
});

Expand Down
8 changes: 4 additions & 4 deletions test/unit/patchloomCli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ describe("patchloom CLI integration", async () => {
await fs.writeFile(txtFile, "Hello old_name, welcome to old_name project.\n", "utf8");

await execFileAsync(binaryPath, [
"replace", "old_name", "--to", "new_name", txtFile, "--apply"
"replace", "old_name", "--new", "new_name", txtFile, "--apply"
], { cwd: dir, timeout: 5000 });

const result = await fs.readFile(txtFile, "utf8");
Expand Down Expand Up @@ -268,7 +268,7 @@ describe("patchloom CLI integration", async () => {

try {
await execFileAsync(binaryPath, [
"replace", "hello", "--to", "goodbye", file, "--check"
"replace", "hello", "--new", "goodbye", file, "--check"
], { timeout: 5000 });
assert.fail("should have exited with non-zero code");
} catch (error) {
Expand Down Expand Up @@ -567,7 +567,7 @@ describe("patchloom CLI integration", async () => {

// Apply a change (creates a backup)
await execFileAsync(binaryPath, [
"replace", "original", "--to", "modified", file, "--apply"
"replace", "original", "--new", "modified", file, "--apply"
], { cwd: dir, timeout: 5000 });

const modified = await fs.readFile(file, "utf8");
Expand Down Expand Up @@ -792,7 +792,7 @@ describe("managed install end-to-end MCP", { timeout: 120_000 }, async () => {
jsonrpc: "2.0", id: 3, method: "tools/call",
params: {
name: "doc_set",
arguments: { path: "config.json", selector: "port", value: 8080 }
arguments: { path: "config.json", key: "port", value: 8080 }
}
}) + "\n");

Expand Down
12 changes: 6 additions & 6 deletions test/unit/quickActions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ test("buildReplaceQuickAction builds a replace command for one file", () => {

assert.equal(action.title, "Replace text in README.md");
assert.deepEqual(action.targetArgIndices, [4]);
assert.deepEqual(action.args, ["replace", "old", "--to", "new", "/workspace/demo/README.md"]);
assert.deepEqual(action.args, ["replace", "old", "--new", "new", "/workspace/demo/README.md"]);
});

test("buildTidyQuickAction includes selected tidy flags", () => {
Expand Down Expand Up @@ -71,25 +71,25 @@ test("retargetQuickAction swaps only the target path arguments", () => {
assert.deepEqual(retargeted.args, [
"replace",
"/workspace/demo/README.md",
"--to",
"--new",
"new",
"/tmp/preview/README.md"
]);
});

test("withApplyFlag appends apply once", () => {
assert.deepEqual(withApplyFlag(["replace", "old", "--to", "new", "README.md"]), [
assert.deepEqual(withApplyFlag(["replace", "old", "--new", "new", "README.md"]), [
"replace",
"old",
"--to",
"--new",
"new",
"README.md",
"--apply"
]);
assert.deepEqual(withApplyFlag(["replace", "old", "--to", "new", "README.md", "--apply"]), [
assert.deepEqual(withApplyFlag(["replace", "old", "--new", "new", "README.md", "--apply"]), [
"replace",
"old",
"--to",
"--new",
"new",
"README.md",
"--apply"
Expand Down
Loading