hokein created this revision.
hokein added a reviewer: kadircet.
Herald added a subscriber: arphaman.
Herald added a project: All.
hokein requested review of this revision.
Herald added subscribers: MaskRay, ilya-biryukov.
Herald added a project: clang-tools-extra.

Allowing us to test this feature (context: a recent crash in
semantic highlighting.)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D137063

Files:
  clang-tools-extra/clangd/tool/Check.cpp


Index: clang-tools-extra/clangd/tool/Check.cpp
===================================================================
--- clang-tools-extra/clangd/tool/Check.cpp
+++ clang-tools-extra/clangd/tool/Check.cpp
@@ -34,6 +34,7 @@
 #include "ParsedAST.h"
 #include "Preamble.h"
 #include "Protocol.h"
+#include "SemanticHighlighting.h"
 #include "SourceCode.h"
 #include "XRefs.h"
 #include "index/CanonicalIncludes.h"
@@ -206,6 +207,11 @@
     }
   }
 
+  void buildSemanticHighlighting() {
+    log("Building semantic highlighting");
+    getSemanticHighlightings(*AST);
+  }
+
   // Run AST-based features at each token in the file.
   void testLocationFeatures(llvm::Optional<Range> LineRange,
                             const bool EnableCodeCompletion) {
@@ -302,6 +308,7 @@
       !C.buildAST())
     return false;
   C.buildInlayHints(LineRange);
+  C.buildSemanticHighlighting();
   C.testLocationFeatures(LineRange, EnableCodeCompletion);
 
   log("All checks completed, {0} errors", C.ErrCount);


Index: clang-tools-extra/clangd/tool/Check.cpp
===================================================================
--- clang-tools-extra/clangd/tool/Check.cpp
+++ clang-tools-extra/clangd/tool/Check.cpp
@@ -34,6 +34,7 @@
 #include "ParsedAST.h"
 #include "Preamble.h"
 #include "Protocol.h"
+#include "SemanticHighlighting.h"
 #include "SourceCode.h"
 #include "XRefs.h"
 #include "index/CanonicalIncludes.h"
@@ -206,6 +207,11 @@
     }
   }
 
+  void buildSemanticHighlighting() {
+    log("Building semantic highlighting");
+    getSemanticHighlightings(*AST);
+  }
+
   // Run AST-based features at each token in the file.
   void testLocationFeatures(llvm::Optional<Range> LineRange,
                             const bool EnableCodeCompletion) {
@@ -302,6 +308,7 @@
       !C.buildAST())
     return false;
   C.buildInlayHints(LineRange);
+  C.buildSemanticHighlighting();
   C.testLocationFeatures(LineRange, EnableCodeCompletion);
 
   log("All checks completed, {0} errors", C.ErrCount);
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to