fix: 避免重复配置时清理 PCM 缓存 - #14
Open
helantianshen wants to merge 2 commits into
Open
Conversation
helantianshen
force-pushed
the
fix/preserve-pcm-on-repeat-setup
branch
from
August 12, 2026 08:45
518bd1a to
504eb11
Compare
helantianshen
marked this pull request as ready for review
August 12, 2026 08:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
「一键配置模块代码提示」此前无论是否安装或切换 LLVM 工具链,都会执行
mcpp build --no-cache。当项目已经在使用正确的 LLVM 工具链时,重复配置仍会强制清理并重建缓存。clangd 与
compile_commands.json在重载期间可能继续引用已经失效的 PCM,进而出现std.pcm: module file not found等诊断。此时工具链并未发生变化,清理缓存没有必要,也会破坏原本可用的模块产物。修复
mcpp build --no-cache;mcpp build,保留已有 PCM 缓存;工具链发生变化时仍然保留原有的无缓存构建行为,避免复用旧工具链生成的 PCM。
验证
npm test:266/266 通过npm run package.vscode、.xlings和compile_commands.json后,重新执行一键配置和刷新编译数据库均成功已知限制
消费者源码中的
Module 'mcpplibs.cmp' not found诊断不属于本 PR;它由后续独立 PR 修复。