[PATCH] D94477: [clangd] Add main file macros into the main-file index.

Aleksandr Platonov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 12 01:53:33 PST 2021


ArcsinX created this revision.
Herald added subscribers: usaxena95, kadircet, arphaman.
ArcsinX requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov.
Herald added a project: clang.

This patch is a try to fix `WorkspaceSymbols.Macros` test after D93796 <https://reviews.llvm.org/D93796>.
If a macro definition is in the preamble section, then it appears to be in the preamble (static) index and not in the main-file (dynamic) index.
Thus, a such macro could not be found at a symbol search according to the logic that we skip symbols from the static index if the location of these symbols is inside the dynamic index files.
To fix this behavior this patch adds main file macros into the main-file (dynamic) index.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D94477

Files:
  clang-tools-extra/clangd/CollectMacros.cpp
  clang-tools-extra/clangd/CollectMacros.h
  clang-tools-extra/clangd/SemanticHighlighting.cpp
  clang-tools-extra/clangd/XRefs.cpp
  clang-tools-extra/clangd/index/SymbolCollector.cpp
  clang-tools-extra/clangd/unittests/CollectMacrosTests.cpp
  clang-tools-extra/clangd/unittests/FindSymbolsTests.cpp
  clang-tools-extra/clangd/unittests/ParsedASTTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94477.316027.patch
Type: text/x-patch
Size: 7855 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210112/5e03e24b/attachment-0001.bin>


More information about the cfe-commits mailing list