[PATCH] D60605: [clangd] Revamp textDocument/onTypeFormatting.
Sam McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri May 3 01:40:44 PDT 2019
sammccall added a comment.
In D60605#1488039 <https://reviews.llvm.org/D60605#1488039>, @ilya-biryukov wrote:
> Maybe that's due to some extra logic applied in VSCode on top of what we do.
> Let me know if this does not reproduce.
Aha, the missing piece was that vscode reindented the cursor to align with the comment (but didn't continue the comment).
This caused us to replace the cursor with an *indented* identifier, and clang-format thought the last line of the comment was attached to it.
It almost seems silly to keep patching the code rather than add a "break here" option to clang-format that doesn't have side-effects. However the fix here is pretty simple, so why not.
Do you think this is converging to something we should land? The last few have been pretty small tweaks and I'm happy to keep fixing those as incremental patches.
Conversely, if the basic design isn't right, then further polish probably isn't worthwhile.
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