1b8bfd4b76
Summary: This patch adds onTypeFormatting to clangd. The trigger character is '}' and it works by scanning for the matching '{' and formatting the range in-between. There are problems with ';' as a trigger character, the cursor position is before the `|`: ``` int main() { int i;| } ``` becomes: ``` int main() { int i;| } ``` which is not likely what the user intended. Also formatting at semicolon in a non-properly closed scope puts the following tokens in the same unwrapped line, which doesn't reformat nicely. Reviewers: bkramer Reviewed By: bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D29990 llvm-svn: 295304 |
||
---|---|---|
.. | ||
Unit | ||
change-namespace | ||
clang-apply-replacements | ||
clang-move | ||
clang-query | ||
clang-rename | ||
clang-reorder-fields | ||
clang-tidy | ||
clangd | ||
include-fixer | ||
modularize | ||
pp-trace | ||
.clang-format | ||
CMakeLists.txt | ||
lit.cfg | ||
lit.site.cfg.in |