[clang-tools-extra] feat: highlight for import, export keyword of CXX Module (PR #204511)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 22 05:25:44 PDT 2026


================
@@ -582,36 +582,49 @@ class CollectExtraHighlightings
     return true;
   }
 
-  bool VisitTagDecl(TagDecl *D) {
-    for (TemplateParameterList *TPL : D->getTemplateParameterLists())
-      H.addAngleBracketTokens(TPL->getLAngleLoc(), TPL->getRAngleLoc());
+  bool VisitImportDecl(const ImportDecl *D) {
+    H.addToken(D->getLocation(), HighlightingKind::Keyword);
+    for (const auto ModuleLoc : D->getIdentifierLocs()) {
+      H.addToken(ModuleLoc, HighlightingKind::Namespace)
+          .addModifier(HighlightingModifier::DependentName);
----------------
Decodetalkers wrote:

I just think the name name maybe good, because they are module.. I am not familiar with this part. I will delete them

https://github.com/llvm/llvm-project/pull/204511


More information about the cfe-commits mailing list