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:
- Open Foo.h (which contains class Foo)
- Open Foo.cpp, call find references for Foo
And we only get refs from Foo.cpp.