Skip to content

Commit 518bd1a

Browse files
committed
fix: 在模块检查前恢复已有 PCM
1 parent b32f9e2 commit 518bd1a

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

src/extension.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,10 @@ async function runModuleSupportCheck(
595595
return moduleStatus;
596596
}
597597

598+
if (stageProjectPcms(context, output)) {
599+
await restartClangd(output);
600+
}
601+
598602
const checkToken = moduleCheckOperations.begin(context.project.root);
599603
moduleStatusByProject.delete(context.project.root);
600604
if (shouldRenderProjectStatus(findCurrentProject()?.root, context.project.root)) {

test/artifacts.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,15 @@ test("IDE commands expose progress and bound clangd restart waits", () => {
154154
assert.match(source, /output\.show\(true\)/);
155155
});
156156

157+
test("module checks restore available PCM before invoking clangd", () => {
158+
const source = readFileSync(path.join(root, "src/extension.ts"), "utf8");
159+
const start = source.indexOf("async function runModuleSupportCheck");
160+
const end = source.indexOf("async function updateModuleSupportForContext", start);
161+
const method = source.slice(start, end);
162+
assert.ok(method.indexOf("stageProjectPcms(context, output)") < method.indexOf("runClangdCheck("));
163+
assert.match(method, /stageProjectPcms\(context, output\)[\s\S]*await restartClangd\(output\)/);
164+
});
165+
157166
test("ships syntax-only C++ highlighting for the exact build.mcpp filename", () => {
158167
const manifest = JSON.parse(readFileSync(path.join(root, "package.json"), "utf8")) as PackageManifest;
159168
const associations = manifest.contributes?.configurationDefaults?.["files.associations"] as

0 commit comments

Comments
 (0)