[PATCH] D115990: AlignConsecutiveDeclarations not working for 'const' keyword in JavsScript

Marek Kurdej via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 20 22:51:56 PST 2021


curdeius added inline comments.


================
Comment at: clang/lib/Format/TokenAnnotator.cpp:1875
+    // const a = in JavaScript.
+    if (Style.isJavaScript() && PreviousNotConst->is(tok::kw_const))
+      return true;
----------------
owenpan wrote:
> MyDeveloperDay wrote:
> > owenpan wrote:
> > > curdeius wrote:
> > > > Nit.
> > > +1
> > I WILL make the change, but just my 2c worth, when a complex expression is on the last line (as was before), it's a bu***er to debug! I personally use this style so I can just drop a breakpoint on the return and I know its being hit for that case, in clang-format where these functions are called over and over again that's super important... (that's my defend your honour!)
> Alright! I withdraw my +1 then. :)
@MyDeveloperDay, it's up to you whether to change it or not.


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

https://reviews.llvm.org/D115990



More information about the cfe-commits mailing list