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

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 18 09:08:40 PDT 2022


MyDeveloperDay added inline comments.


================
Comment at: clang/lib/Format/ContinuationIndenter.cpp:633
       (State.Line->Type == LT_PreprocessorDirective ||
        State.Line->Type == LT_ImportStatement)) {
     Spaces += State.FirstIndent;
----------------
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.


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