Skip to content
Open
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
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"js/ts.tsdk.path": "node_modules/typescript/lib"
}
5 changes: 4 additions & 1 deletion src/moduleSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ export function mcppModuleSetupCommands(plan: ModuleSetupPlan): ModuleSetupComma
args: ["toolchain", "default", "llvm"],
});
}
commands.push({ stage: "build", mode: "task", args: ["build", "--no-cache"] });
const buildArgs = plan.installLlvm || plan.switchDefault
? ["build", "--no-cache"]
: ["build"];
commands.push({ stage: "build", mode: "task", args: buildArgs });
return commands;
}

Expand Down
4 changes: 2 additions & 2 deletions test/moduleSetup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ test("阻止原因按未信任、未知清单、忙碌、项目覆盖的顺序
);
});

test("模块设置命令使用固定 argv 数组且始终构建", () => {
test("模块设置命令仅在工具链变化时清缓存", () => {
assert.deepEqual(
mcppModuleSetupCommands({ kind: "ready", installLlvm: true, switchDefault: true }),
[
Expand All @@ -221,7 +221,7 @@ test("模块设置命令使用固定 argv 数组且始终构建", () => {
);
assert.deepEqual(
mcppModuleSetupCommands({ kind: "ready", installLlvm: false, switchDefault: false }),
[{ stage: "build", mode: "task", args: ["build", "--no-cache"] }],
[{ stage: "build", mode: "task", args: ["build"] }],
);
});

Expand Down