llvm-project/clang/unittests/Format
Martin Probst 93008f0154 clang-format: [JS] Correctly format JavaScript imports with long module paths
Currently the `UnwrappedLineParser` fails to correctly unwrap JavaScript
imports where the module path is not on the same line as the `from` keyword.
For example:

    import {A} from
    'some/path/longer/than/column/limit/module.js';```

This causes issues when in the middle a list of imports because the formatter
thinks it has reached the end of the imports, and therefore will not sort any
imports lower in the list.

The formatter will, however, split the `from` keyword and the module path if
the path exceeds the column limit, which triggers the issue the next time the
file is formatted.

Patch originally by Jared Neil - thanks!

Differential Revision: https://reviews.llvm.org/D34920

llvm-svn: 308306
2017-07-18 14:00:19 +00:00
..
CMakeLists.txt [clang-format] Support text proto messages 2017-07-03 15:05:14 +00:00
CleanupTest.cpp clang-format: [JS] do not clean up duplicated commas. 2017-05-29 08:41:11 +00:00
FormatTest.cpp Fix dereference of pointers in throw statements. 2017-07-17 15:27:53 +00:00
FormatTestComments.cpp [clang-format] Keep level of comment before an empty line 2017-07-12 15:21:43 +00:00
FormatTestJS.cpp clang-format: [JS] Correctly format JavaScript imports with long module paths 2017-07-18 14:00:19 +00:00
FormatTestJava.cpp clang-format: Do not binpack initialization lists 2017-06-30 20:00:02 +00:00
FormatTestObjC.cpp [clang-format] Remove unused using directive, NFC 2017-05-24 12:15:42 +00:00
FormatTestProto.cpp [clang-format] Add space between a message field key and the opening bracket in proto messages 2017-07-06 13:58:29 +00:00
FormatTestSelective.cpp [clang-format] Handle trailing comment sections in import statement lines 2017-05-19 10:34:57 +00:00
FormatTestTextProto.cpp [clang-format] Add space between a message field key and the opening bracket in proto messages 2017-07-06 13:58:29 +00:00
FormatTestUtils.h Header guard canonicalization, clang part. 2014-08-13 16:25:19 +00:00
NamespaceEndCommentsFixerTest.cpp clang-format: Add CompactNamespaces option 2017-06-14 12:29:47 +00:00
SortImportsTestJS.cpp clang-format: [JS] Correctly format JavaScript imports with long module paths 2017-07-18 14:00:19 +00:00
SortIncludesTest.cpp [clang-format] Switch to case-insensitive header matching and use it to 2017-06-29 23:20:54 +00:00
UsingDeclarationsSorterTest.cpp [clang-format] Support sorting using declarations 2017-06-21 12:03:12 +00:00