IntelliSense & Code Completion Fails Unless Compiler Paths are Added to PATH Environmental Variable
@Colengms 已经在做这个了。
开始于 2026年9月15日。
评估
这个 Issue 还没有评估数据。
描述
Environment
- OS and Version: Windows 11
- VS Code Version: 1.125.1
- C/C++ Extension Version: 1.33.4
- If using SSH remote, specify OS of remote machine:
Bug Summary and Steps to Reproduce
The ms-vscode.cpptools extension fails to evaluate the PATH variables provided by e.g. a CMake preset, terminal.integrated.env.windows or cmake.environment (or any other cmake.*Environment) variables, nor is there an option to explicitly specify a PATH environmental variable to be used by the extension, like C_Cpp.path.
This results in the build environment not being detected correctly. IntelliSense and code completion does not work.
Building via the ms-vscode.cmake-tools extension works perfectly fine, since it is evaluating the environment specified in a CMakePresets.json (s. excerpt):
{
"configurePresets": [
{
"name": "<PRESET_NAME>",
"displayName": "'<PRESET_NAME>' config",
"description": "'<PRESET_NAME>' configure using 'Unix Makefiles' generator",
"generator": "Unix Makefiles",
"environment": {
"PATH": "<PATH_TO_COMPILER_ROOT>/sysroots/x86_64-petalinux-mingw32/usr/bin:$penv{PATH}"
}
}
],
}
I do not want to alter the PATH environmental variable of the system, in order not to create conflicts with other projects I am working on. This means I have to manually specify the path every time in a CMD.exe,
C:\PATH\TO\PROJECT>set PATH=<PATH_TO_COMPILER_ROOT>\sysroots\x86_64-petalinux-mingw32\usr\bin;%PATH%
C:\PATH\TO\PROJECT>code .
or create a batch file, to start code with the correct environment.
Am I missing a way how to set the environment, particularly for a project - not system wide?
Could you please add a feature to set the PATH used by ms-vscode.cpptools ? Ideally the one from the CMake preset is automatically used.
Configuration and Logs
[7/10/2026, 12:12:00 PM] Unable to resolve configuration with compilerPath "<PATH_TO_COMPILER_ROOT>/sysroots/x86_64-petalinux-mingw32/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-g++.exe". Using "cl.exe" instead.
Other Extensions
No response
Additional context
No response
- 主要语言
- TypeScript
- 星标
- 6.2k
- 派生
- 1.7k
- 平均合并
- 14 小时 46 分钟
- 30 天内合并 PR
- 61
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/vscode-cpptools 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 35/100
microsoft/vscode-cpptools#14787 ·
-
[Bug] cpptools fails to start on Ubuntu ARM64 due to missing execute permissions on shared libraries 未关闭bug fixed Language Service regression
microsoft/vscode-cpptools#14779 · 已指派 1 人 ·
-
Language Service more info needed
microsoft/vscode-cpptools#14778 · 1 条评论 · 已指派 1 人 ·
-
难度 4/5 3-5 天 新手友好度 64/100
microsoft/vscode-cpptools#14769 ·
-
难度 3/5 1-2 天 新手友好度 68/100
microsoft/vscode-cpptools#14768 · 1 条评论 ·
查看 microsoft/vscode-cpptools 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
难度 2/5 1-3 小时 新手友好度 78/100
-
enhancement
难度 2/5 1-3 小时 新手友好度 68/100
-
calcite-components needs triage refactor
难度 2/5 1-3 小时 新手友好度 75/100
Esri/calcite-design-system#15203 ·
-
难度 2/5 1-3 小时 新手友好度 90/100
danielmiessler/LifeOS#2218 ·