diff options
author | Sam McCall <sam.mccall@gmail.com> | 2019-06-10 14:26:21 +0000 |
---|---|---|
committer | Sam McCall <sam.mccall@gmail.com> | 2019-06-10 14:26:21 +0000 |
commit | 25c6257ba0280bc1722721d32adc47d0998fed27 (patch) | |
tree | 86610a1d3ce607d590ceacf2f22c6b979a9d6dd5 /llvm/lib/ExecutionEngine/Interpreter/Execution.cpp | |
parent | dd4f253c4d8f6debb91c04d3b3965b133169f0e2 (diff) | |
download | bcm5719-llvm-25c6257ba0280bc1722721d32adc47d0998fed27.tar.gz bcm5719-llvm-25c6257ba0280bc1722721d32adc47d0998fed27.zip |
[clangd] Revamp textDocument/onTypeFormatting.
Summary:
The existing implementation (which triggers on }) is fairly simple and
has flaws:
- doesn't trigger frequently/regularly enough (particularly in editors that type the }
for you)
- often reformats too much code around the edit
- has jarring cases that I don't have clear ideas for fixing
This implementation is designed to trigger on newline, which feels to me more
intuitive than } or ;.
It does have allow for reformatting after other characters - it has a
basic behavior and a model for adding specialized behavior for
particular characters. But at least initially I'd stick to advertising
\n in the capabilities.
This also handles comment splitting: when you insert a line break inside
a line comment, it will make the new line into an aligned line comment.
Working on tests, but want people to patch it in and try it - it's hard to
see if "feel" is right purely by looking at a test.
Reviewers: ilya-biryukov, hokein
Subscribers: mgorny, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60605
llvm-svn: 362939
Diffstat (limited to 'llvm/lib/ExecutionEngine/Interpreter/Execution.cpp')
0 files changed, 0 insertions, 0 deletions