This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Collect the refs when the main file is header.
ClosedPublic

Authored by hokein on Jun 26 2019, 5:57 AM.

Details

Summary

Previously, we only collect refs of the symbols which are declared in
the preamble and referenced in the main file, it works well when the
main file is .cpp file.

However, when the main file is .h file (when opening a .h file in the
editor), we don't collect refs of the symbol declared in this file, so we miss
these refs in our dynamic index.

A typical scenario:

  1. Open Foo.h (which contains class Foo)
  2. Open Foo.cpp, call find references for Foo

And we only get refs from Foo.cpp.

Diff Detail

Repository
rL LLVM

Event Timeline

hokein created this revision.Jun 26 2019, 5:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 26 2019, 5:57 AM
sammccall accepted this revision.Jul 2 2019, 12:38 AM
This revision is now accepted and ready to land.Jul 2 2019, 12:38 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 2 2019, 2:18 AM