[PATCH] D20632: clang-format: [JS] Support shebang lines on the very first line.

Martin Probst via cfe-commits cfe-commits at lists.llvm.org
Thu May 26 07:40:52 PDT 2016


mprobst marked 2 inline comments as done.

================
Comment at: lib/Format/TokenAnnotator.cpp:698
@@ +697,3 @@
+
+    if (Style.Language == FormatStyle::LK_JavaScript) {
+      // JavaScript files can contain shebang lines of the form:
----------------
alexeagle wrote:
> should we still restrict it to be on the first line?
> 
> I suppose if you start some other line with #, that's not valid JS or TS so it doesn't matter what clang-format does to it? Maybe it's fine like this.
Done. Doesn't make a big difference I guess, but it's better to be conservative.


http://reviews.llvm.org/D20632





More information about the cfe-commits mailing list