[PATCH] D53072: [clang-format] Create a new tool for IDEs based on clang-format

Ivan Donchevskii via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 9 11:01:03 PDT 2019


yvvan added a comment.

In D53072#1496317 <https://reviews.llvm.org/D53072#1496317>, @sammccall wrote:

> My feedback would be:
>
> - I definitely think more control over preserving line breaks would be useful. Actually preserving *blank* lines is an important property. If you see D60605 <https://reviews.llvm.org/D60605>, there are a lot of cases where clang-format wants to delete the line you just added. Maybe we can make `MaxEmptyLinesToKeep: 9999999` work in more cases.
> - I'm not convinced you need/want to preserve *all* line breaks, isn't it just one? (where the user pressed enter)
> - It's unclear why "extraformattingoptions" is needed, rather than just the usual formatting options, or some other parameter. It would be nice to avoid a new library entry point (overload) if possible.
> - as far as command-line interface goes, this definitely feels more like a flag than a new tool


Thanks for the feedback!
'to preserve *all* line breaks, isn't it just one' - it's just much easier code wise, you don't need to take the current position into account. I can look how I can make it for only one line.
'unclear why "extraformattingoptions" is needed' - the idea behind is that we can add more ide-specific options later without introducing new reformat parameters.
I will definitely remove a separate tool, it seems nobody sees the need of such thing.


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

https://reviews.llvm.org/D53072





More information about the cfe-commits mailing list