Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clangd] Fix Origin and MainFileOnly-ness for macros
Summary: This was resulting in macros coming from preambles vanishing when user have opened the source header. For example: ``` // test.h: #define X ``` 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. Fixes clangd/clangd#461 Reviewers: hokein Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D84297
- Loading branch information
Showing
2 changed files
with
21 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters