sstwcw marked an inline comment as done.
sstwcw added inline comments.

================
Comment at: clang/lib/Format/ContinuationIndenter.cpp:631
+      Style.IndentPPDirectives == FormatStyle::PPDIS_AfterHash &&
       Previous.is(tok::hash) && State.FirstIndent > 0 &&
       (State.Line->Type == LT_PreprocessorDirective ||
----------------
MyDeveloperDay wrote:
> can I check? is this case really firing? i mean isn't it
> 
> `# import`
> 
> why would javascript be seeing that?
In Javascript import statements also need some special handling. So the line is 
intentionally labeled as LT_ImportStatement. In `AnnotatingParser::parseLine` 
there is this.
```
    if (Style.isJavaScript() && CurrentToken->is(Keywords.kw_import))
      ImportStatement = true;
```
I don't know why the line type isn't printed in 
`TokenAnnotator::printDebugInfo`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121906

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

Reply via email to