[PATCH] D121906: [clang-format] Indent import statements in JavaScript.

sstwcw via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 21 16:04:21 PDT 2022


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


================
Comment at: clang/lib/Format/ContinuationIndenter.cpp:633
       (State.Line->Type == LT_PreprocessorDirective ||
        State.Line->Type == LT_ImportStatement)) {
     Spaces += State.FirstIndent;
----------------
MyDeveloperDay wrote:
> AfterHash  - Could be true
> Previous is hash - Can't be true can it?
> FirstIndent > 0 - I guess could be true
> State.Line->Type being LT_ImportStatement could be true..
> 
> true && false && true && true == false right?
> 
> Remove `!Style.isJavaScript()` from this, does your test still pass?
> 
> Either add the second test to cover this case or remove the condition, I don't mind either way.
I undid the change here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121906



More information about the cfe-commits mailing list