This revision was automatically updated to reflect the committed changes.
Closed by commit rL273603: clang-format: [JS] recognize more type locations.
(authored by mprobst).
Changed prior to commit:
http://reviews.llvm.org/D21597?vs=61706&id=61711#toc
Repository:
rL LLVM
http://reviews.llvm
mprobst updated this revision to Diff 61706.
mprobst marked an inline comment as done.
mprobst added a comment.
- progress
http://reviews.llvm.org/D21597
Files:
lib/Format/FormatToken.h
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.c
mprobst marked 2 inline comments as done.
Comment at: lib/Format/TokenAnnotator.cpp:155
@@ +154,3 @@
+} else if (Style.Language == FormatStyle::LK_JavaScript && Left->Previous
&&
+ Left->Previous->is(TT_JsTypeColon)) {
+ // let x: (SomeType);
--
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Basically looks good.
Comment at: lib/Format/TokenAnnotator.cpp:155
@@ +154,3 @@
+} else if (Style.Language == FormatStyle::LK_JavaScript && Left->Previous
&&
+
mprobst added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:480
@@ -471,1 +479,3 @@
+ void parseJSTypeDefinition() {
+// `type Name = Type Expression;`
djasper wrote:
> Why is this necessary?
It is not, actually. I was chasing a wrong path here
mprobst updated this revision to Diff 61548.
mprobst added a comment.
- Remove parseJSTypeDefinition
http://reviews.llvm.org/D21597
Files:
lib/Format/FormatToken.h
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.cpp
===
djasper added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:480
@@ -471,1 +479,3 @@
+ void parseJSTypeDefinition() {
+// `type Name = Type Expression;`
Why is this necessary?
http://reviews.llvm.org/D21597
_
mprobst added a comment.
This seems to be getting a bit tricky with the declaration contexts. If you
have a better suggestion, please come forward.
http://reviews.llvm.org/D21597
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
Includes parenthesized type expressions and type aliases.
http://reviews.llvm.org/D21597
Files:
lib/Format/FormatToken.h
lib/Format/TokenAnnotator.cpp