Skip to content

Commit de7d250

Browse files
committed
fix: force LLVM module database refresh
1 parent f233584 commit de7d250

3 files changed

Lines changed: 14 additions & 7 deletions

File tree

src/moduleSetup.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export function buildModuleSetupPlan(
4949
return {
5050
kind: "ready",
5151
installLlvm: !installedHostLlvm,
52-
switchDefault: inventory.effective !== undefined && !effectiveIsLlvm,
52+
switchDefault: !effectiveIsLlvm,
5353
};
5454
}
5555

@@ -75,7 +75,7 @@ export function mcppModuleSetupCommands(plan: ModuleSetupPlan): ModuleSetupComma
7575
args: ["toolchain", "default", "llvm"],
7676
});
7777
}
78-
commands.push({ stage: "build", mode: "task", args: ["build"] });
78+
commands.push({ stage: "build", mode: "task", args: ["build", "--no-cache"] });
7979
return commands;
8080
}
8181

test/e2e/runTest.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ async function main(): Promise<void> {
2828

2929
try {
3030
await runTests({
31+
version: "1.90.2",
3132
extensionDevelopmentPath: repositoryRoot,
3233
extensionTestsPath: join(repositoryRoot, "dist/test/e2e/suite/index.js"),
3334
launchArgs: [

test/moduleSetup.test.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ test("LLVM 已生效时不重复安装或切换", () => {
9797
});
9898
});
9999

100-
test("没有 effective 工具链时不推断需要切换全局默认", () => {
100+
test("没有 effective 工具链时安装 LLVM 后设置全局默认", () => {
101101
const plan = buildModuleSetupPlan(
102102
inventory(),
103103
"unavailable",
@@ -108,7 +108,7 @@ test("没有 effective 工具链时不推断需要切换全局默认", () => {
108108
assert.deepEqual(plan, {
109109
kind: "ready",
110110
installLlvm: true,
111-
switchDefault: false,
111+
switchDefault: true,
112112
});
113113
});
114114

@@ -216,12 +216,12 @@ test("模块设置命令使用固定 argv 数组且始终构建", () => {
216216
[
217217
{ stage: "install", mode: "task", args: ["toolchain", "install", "llvm"] },
218218
{ stage: "default", mode: "process", args: ["toolchain", "default", "llvm"] },
219-
{ stage: "build", mode: "task", args: ["build"] },
219+
{ stage: "build", mode: "task", args: ["build", "--no-cache"] },
220220
],
221221
);
222222
assert.deepEqual(
223223
mcppModuleSetupCommands({ kind: "ready", installLlvm: false, switchDefault: false }),
224-
[{ stage: "build", mode: "task", args: ["build"] }],
224+
[{ stage: "build", mode: "task", args: ["build", "--no-cache"] }],
225225
);
226226
});
227227

@@ -255,7 +255,13 @@ test("确认文案说明将复用已安装的 LLVM", () => {
255255
});
256256

257257
test("确认文案在无需切换时明确不修改全局默认值", () => {
258-
const plan = ready(buildModuleSetupPlan(inventory(), "unavailable", true, false));
258+
const llvm = toolchain("llvm", true);
259+
const plan = ready(buildModuleSetupPlan(
260+
inventory({ installed: [llvm], effective: llvm }),
261+
"full",
262+
true,
263+
false,
264+
));
259265
const confirmation = moduleSetupConfirmation(
260266
"unavailable",
261267
plan,

0 commit comments

Comments
 (0)