krasimir added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:773
case tok::r_brace:
- // Lines can start with '}'.
- if (Tok->Previous)
+ // Lines can start with '}' except in text protos.
+ if (Tok->Previous || Style.Language == FormatStyle:
This revision was automatically updated to reflect the committed changes.
Closed by commit rC330016: [clang-format] Improve Incomplete detection for
(text) protos (authored by krasimir, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D44203?vs=142394&id=142396#toc
Repository:
krasimir updated this revision to Diff 142394.
krasimir marked an inline comment as done.
krasimir added a comment.
- Address review comments
Repository:
rC Clang
https://reviews.llvm.org/D44203
Files:
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestProto.cpp
unittests/Format/
sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.
Comment at: lib/Format/TokenAnnotator.cpp:773
case tok::r_brace:
- // Lines can start with '}'.
- if (Tok->Previous)
+ // Lines can start with '
krasimir added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:665
}
+ if ((Style.Language == FormatStyle::LK_Proto ||
+ Style.Language == FormatStyle::LK_TextProto) &&
sammccall wrote:
> I don't really understand what this is doi
krasimir updated this revision to Diff 141121.
krasimir marked 2 inline comments as done.
krasimir added a comment.
- Address review comments
Repository:
rC Clang
https://reviews.llvm.org/D44203
Files:
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestProto.cpp
unittests/Format/
sammccall added a comment.
I'm not familiar with clang-format internals, sorry if questions are dumb.
My first inclination is that doing something reasonable for incomplete inputs
makes sense, but it doesn't seem to be worth spending complexity on things that
are actually intended to not be pro
krasimir created this revision.
krasimir added a reviewer: sammccall.
Herald added subscribers: cfe-commits, klimek.
This patch improves detection of incomplete code for protos and text protos.
This is especially important for text protos in raw string literals, since they
might be partial strings