Previously, we would use include spelling of the declaring header to check
whether the inserted header is the same as the main file. This doesn't help because
we only have file path of the main file.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Thanks!
IIUC, this already fixes the cases we'd seen of include-insertion of a header into itself.
Is it feasible to add a test case for that?
clangd/Headers.h | ||
---|---|---|
140 ↗ | (On Diff #195136) | is the path |
unittests/clangd/HeadersTests.cpp | ||
---|---|---|
208 ↗ | (On Diff #195136) |
Here is a test case for it. However, to trigger the old behavior caused by include spelling, we would need to implement a custom URI scheme that performs include spelling customization. Let me know if you think we should add one. |
unittests/clangd/HeadersTests.cpp | ||
---|---|---|
208 ↗ | (On Diff #195136) | Ah right, this probably isn't worth it :-( |