ilya-biryukov added a comment. Sorry for the delay
================ Comment at: clang-tools-extra/clangd/Macro.h:59 + + if (auto Range = getTokenRange(SM, LangOpts, MacroNameTok.getLocation())) { + MainFileMacros.push_back( ---------------- Converting here is too early, could we keep this conversion in syntax highlighting code? Keeping source locations here is enough. ================ Comment at: clang-tools-extra/clangd/Macro.h:67 + bool InMainFile = true; + std::vector<MainFileMacro> &MainFileMacros; +}; ---------------- Could we model in a way that avoids duplicating macro names on each occurrence? We had `StringSet Names` and `vector<SourceLocation> Locations`, let's keep it in the same way. We could group this into a struct to reduce boilerplate of transferring it around, obviously ``` struct MainFileMacros { StringSet Names; vector<SourceLocation> Locations; }; ``` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67496/new/ https://reviews.llvm.org/D67496 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits