nridge added inline comments.

================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:143
+    for (const SourceRange &R :
+         AST.getPreprocessor().getPreprocessingRecord()->getSkippedRanges()) {
+      if (isInsideMainFile(R.getBegin(), SM)) {
----------------
hokein wrote:
> I think the current implementation only collects the skipped preprocessing 
> ranges **after preamble** region in the main file.  We probably need to store 
> these ranges in PreambleData to make the ranges in the preamble region work, 
> no need to do it in this patch, but we'd better have a test reflecting this 
> fact. 
> 
> ```
> #ifdef ActiveCOde
> // inactive code here
> #endif
> 
> #include "foo.h"
> // preamble ends here
> 
> namespace ns {
> // ..
> }  
> ```
Your observation is correct: the current implementation only highlights 
inactive lines after the preamble. For now, I added a test case with a FIXME 
for this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D67536



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to