Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I know I changed existing tests. I'm not sure what we really want here.
If you have ideas, I'm open to suggestions.
The fix looks ok, butr I don't understand the cause of the side effect? is it explicitly aligning to the v of auto v?
It's adding two spaces inside the auto v = ..., because of aligned declaration (identifier v, additional 1 space) and aligned assignment operator (=, 1 more space).
Unless the test cases are wrong, they should not be changed. The original test case looked correct to me as it was doing a continuation indent between type{ and }.
This is born out by setting ContinuationIndentWidth: 8
int i = 0; float i2 = 0; auto v = type{ i = 1, // (i = 2), // i = 3 // };
So maybe the original test is correct..
Could we resolve this with just
// Continued braced list. if (Changes[ScopeStart - 2].Tok->isNot(tok::identifier) && Changes[ScopeStart - 1].Tok->is(tok::l_brace) && Changes[i].Tok->isNot(tok::r_brace)) return true;
This seems to have caused a strange indentation problem, see https://github.com/llvm/llvm-project/issues/55161
Since this patch landed a couple of months back, I don't think we need to rush to revert it.