Skip to content

Commit

Permalink
[clangd] Don't ignore external HFI in SymbolCollector (#88446)
Browse files Browse the repository at this point in the history
The `FileEntry` corresponds to a `FileID` containing the
`SourceLocation` of a `NamedDecl` which (I think) might've been
deserialized from a PCM file. Considering external `HeaderFileInfo` here
is most likely the right thing to do here in order to get the correct
spelling in case the current compiler instance has not register this
file as a header yet.
  • Loading branch information
jansvoboda11 committed Apr 11, 2024
1 parent 84df7a0 commit 95fbd8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clang-tools-extra/clangd/index/SymbolCollector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ class SymbolCollector::HeaderFileURICache {
// Framework headers are spelled as <FrameworkName/Foo.h>, not
// "path/FrameworkName.framework/Headers/Foo.h".
auto &HS = PP->getHeaderSearchInfo();
if (const auto *HFI = HS.getExistingLocalFileInfo(*FE))
if (const auto *HFI = HS.getExistingFileInfo(*FE))
if (!HFI->Framework.empty())
if (auto Spelling =
getFrameworkHeaderIncludeSpelling(*FE, HFI->Framework, HS))
Expand Down

0 comments on commit 95fbd8d

Please sign in to comment.