[PATCH] D116638: [clang-format] Fix ignoring JavaScriptWrapImport when ColumnWidth: 0

2022-05-31 Thread Andrey Mishchenko via Phabricator via cfe-commits
andmis added a comment. In D116638#3545246 , @stasm wrote: > I'm still interested in seeing this fixed. Would it help if I rebased this > change and addressed the outstanding review comments? Go for it! I don't plan to do any further work on this. (I'm

[PATCH] D116638: [clang-format] Fix ignoring JavaScriptWrapImport when ColumnWidth: 0

2022-01-07 Thread Andrey Mishchenko via Phabricator via cfe-commits
andmis added a comment. The current behavior when `ColumnLimit: 0` and `JavaScriptWrapImports: false` formats this: import {aaa} from "abc"; import {aaa, bbb, ccc} from "def"; import {aaa, bbb} from "defghi"; import {aaa, long, ccc,} from "ghi"; import { aaa,

[PATCH] D116638: [clang-format] Fix ignoring JavaScriptWrapImport when ColumnWidth: 0

2022-01-06 Thread Andrey Mishchenko via Phabricator via cfe-commits
andmis added a comment. My guess that `ColumnLimit: 0` is rarely used for JS is based on the objective fact that JS import formatting is (IMO very) buggy with the column limit set that way, and it took several years for us to hear a bug report about it. And "we should not make assumptions about

[PATCH] D116638: [clang-format] Fix ignoring JavaScriptWrapImport when ColumnWidth: 0

2022-01-06 Thread Andrey Mishchenko via Phabricator via cfe-commits
andmis added a comment. Thanks for the feedback. Two things: 1. Force-breaking at >= 2 imports and not breaking at 1 import feels has the advantage of being simple to state, implement, document, and test, but I don't think it's actually the behavior people will want. For example, the original

[PATCH] D116638: [clang-format] Fix ignoring JavaScriptWrapImport when ColumnWidth: 0

2022-01-05 Thread Andrey Mishchenko via Phabricator via cfe-commits
andmis added inline comments. Comment at: clang/docs/ClangFormatStyleOptions.rst:2827 -**JavaScriptWrapImports** (``Boolean``) :versionbadge:`clang-format 3.9` - Whether to wrap JavaScript import/export statements. + * If ``ColumnWidth`` is 0 (no limit on the number of column

[PATCH] D116638: [clang-format] Fix ignoring JavaScriptWrapImport when ColumnWidth: 0

2022-01-05 Thread Andrey Mishchenko via Phabricator via cfe-commits
andmis added a comment. Thanks all for the reviews. I've updated the patch and added responses to your comments. Comment at: clang/docs/ClangFormatStyleOptions.rst:2820 +**JavaScriptWrapImports** (``Boolean``) :versionbadge:`clang-format 3.9` + Whether to wrap JavaScript im

[PATCH] D116638: [clang-format] Fix ignoring JavaScriptWrapImport when ColumnWidth: 0

2022-01-05 Thread Andrey Mishchenko via Phabricator via cfe-commits
andmis updated this revision to Diff 397579. andmis added a comment. - Move source code for option documentation to `Format.h`, from which the RST is autogenerated. - Clean up tests in response to review feedback. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116638/new/ https://review

[PATCH] D116638: [ClangFormat] Fix ignoring JavaScriptWrapImport when ColumnWidth: 0

2022-01-04 Thread Andrey Mishchenko via Phabricator via cfe-commits
andmis created this revision. andmis added a reviewer: MyDeveloperDay. andmis added a project: clang-format. andmis requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Prior to this patch, when ColumnWidth: 0, all JS imports of the form `import