Header file with duplicate name but unique directory not identified by intellisense
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- cpp, vscode
调研方向
在不同项目中放置重复的 Resources/common.h 文件,以复现报告中的布局,然后在比较 ProjectA/SourceA.cpp 和 ProjectB/SourceB.cpp 的同时检查扩展的 IntelliSense 诊断和调试日志。跟踪扩展如何识别并索引 header:此时 go-to-definition 可以成功,但标识符仍无法解析。完成标准是两个项目本地 header 都已建立索引,并且引用解析时没有红色波浪线。
由索引模型根据 Issue 内容生成。
描述
Bug Summary
I am using VSCode to work on source files from a large Visual Studio solution with many projects. Each project has its its own directory with various source files, and a subfolder for resource headers.
Solution/
├─ ProjectA/
│ ├─ Resources/
│ │ ├─ common.h
│ ├─ SourceA.cpp
├─ ProjectB/
│ ├─ Resources/
│ │ ├─ common.h
│ ├─ SourceB.cpp
ProjectA/Resources/common.h will only ever be referenced by source files within the ProjectA directory.
The issue with this is each of these resource headers has the same filename, so the intellisense database will only process the first one it finds. This is usually the first project folder alphabetically.
When running intellisense, on the above example, references to ProjectA/Resources/common.h by ProjectA/SourceA.cpp are resolved.
References to ProjectB/Resources/common.h by ProjectB/SourceB.cpp are not resolved and result in red squiggles with "identifier XYZ is undefined"
However when I click on the identifier in Source.B and select "go to definition" the extension correctly opens ProjectB/Resources/common.h and jumps to the selected identifier.
Configuration and Logs
This behavior is found in the default configurations. I have not been able to find a change to the configuration that alters this behavior.
Debug log diagnostics do not display anything unusual or useful.
Environment
- OS and Version: Win 11 25H2
- VS Code Version: 1.125.1 (issue identified on earlier versions)
- C/C++ Extension Version: 1.33.0 (issue identified on earlier versions)
- 主要语言
- 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
-
Browser Waiting for: Product Owner
难度 2/5 1-3 小时 新手友好度 85/100
getsentry/sentry-javascript#24577 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
agilepathway/label-checker#640 ·
-
难度 2/5 1-3 小时 新手友好度 84/100
copse-dev/agent-pane#2953 ·
-
agentic-workflows
难度 1/5 1 小时以内 新手友好度 85/100
githubnext/rig#534 ·
-
automation missing-model model-sync provider:pioneer
难度 2/5 1-3 小时 新手友好度 76/100
anomalyco/models.dev#7701 ·