[PATCH] D67264: [clangd] Collect location of macro definition in the ParsedAST

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 9 08:45:41 PDT 2019


ilya-biryukov accepted this revision.
ilya-biryukov added a comment.
This revision is now accepted and ready to land.

LGTM.

We should probably also take a look at highlighting macros inside the preamble part of the main file.
@hokein, are you planning to do this or should we just file a bug for this for now?



================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:38
     // visitor.
-    // FIXME: Should add highlighting to the macro definitions as well. But this
-    // information is not collected in ParsedAST right now.
-    for (const SourceLocation &L : AST.getMainFileExpansions())
+    for (const SourceLocation &L : AST.getMacros())
       addToken(L, HighlightingKind::Macro);
----------------
NIT: use `SourceLocation`, it's just an int, so no need to use references here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67264/new/

https://reviews.llvm.org/D67264





More information about the cfe-commits mailing list