This was resulting in macros coming from preambles vanishing when user
have opened the source header. For example:
// test.h:
and
// test.cc #include "test.h" ^
If user only opens test.cc, we'll get X as a completion candidate,
since it is indexed as part of the preamble. But if the user opens
test.h afterwards we would index it as part of the main file and lose
the symbol (as new index shard for test.h will override the existing one
in dynamic index).
Also we were not setting origins for macros correctly, this patch also
fixes it.
nit: move this var to Line 398, in some cases (builtin macros), it is not used, so would save some cost.
this is duplicated with the one in handleDeclOccurrence, creating a new function seems not worthy...