Details
- Reviewers
djasper
Diff Detail
Event Timeline
include/clang/Format/Format.h | ||
---|---|---|
550 | I would not call this "skipped lines" as that might lead to confusion. Especially, if you format: "int a; f (;" the "line" will not be skipped entirely. And at some stage we actually might decide that we can't fix everything in an unwrapped line, but might still be able to do something. I think the one bit we are trying to get out here is something like "FoundUnrecoverableError". | |
lib/Format/UnwrappedLineFormatter.cpp | ||
481 | Don't use else after return. | |
lib/Format/UnwrappedLineFormatter.h | ||
73 | I don't see the point in renaming this, but ok. | |
76 | I think this is a bit of an anti-pattern:
All of these hint at this not being a useful separation. If you want to decrease indentation and want to use early exits, I think a local lambda might be the better choice here. If you are solely trying to make this function shorter, I don't think it is worth it. | |
unittests/Format/FormatTest.cpp | ||
70 | I don't think it makes sense to allow for combinations of style and ExpectSkippedLines. Skipped lines should be independent of the style. Lets instead introduce a separate function. Maybe veryFormatWithError or something? | |
91 | I don't think it makes sense to test this. No crash tests are rare and whether we also discover an unrecoverable syntax error or not isn't really of interest. |
Replaced SkippedLines with IncomleteFormat.
Undid refactoring. Will do larger refactoring in subsequent change.
Updating D9532: Implements a way to retrieve information about whether some lines were
not formatted due to syntax errors.
I would not call this "skipped lines" as that might lead to confusion. Especially, if you format:
the "line" will not be skipped entirely. And at some stage we actually might decide that we can't fix everything in an unwrapped line, but might still be able to do something.
I think the one bit we are trying to get out here is something like "FoundUnrecoverableError".