[PATCH] D60605: [clangd] Revamp textDocument/onTypeFormatting.

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 8 09:12:08 PDT 2019


ilya-biryukov added a comment.

In D60605#1495268 <https://reviews.llvm.org/D60605#1495268>, @yvvan wrote:

> @ilya-biryukov 
>  What do you think about D53072 <https://reviews.llvm.org/D53072>? It can be polished and combined with this change removing some code from here (which I assume is a good thing).
>  The idea there is that clang-format knows that it's not allowed to remove new lines and it always marks them with MustBreakBefore.
>  I'm not sure if anybody needs an executable but I think it's not a big deal to have an extra reformat() function.
>
> It is also safe because it was the only way I found which does not break the code style like, for instance, adding comment block to the end of the previous line.


I also think (both Sam and you seem to agree with this) that we'll definitely need changes to `clang-format` to support this use-case.
Also sympathetic to the view that this change should probably live in `clang-format`, but having it in clangd first and moving to `clang-format` later also LG.
@sammccall, what's your plan there? Experimenting in `clangd` and moving to `clang-format` later? Any reason to not start in `clang-format` in the first place?

Will add a few comments regarding the need for a separate tool in D53072 <https://reviews.llvm.org/D53072> directly.


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D60605





More information about the cfe-commits mailing list