Very long chained calls in array literals are indented weirdly
This commit is contained in:
parent
4947beec6b
commit
026a58e273
|
@ -726,6 +726,8 @@ private:
|
|||
indents.pop();
|
||||
if (indents.topIs(tok!"("))
|
||||
indents.pop();
|
||||
if (indents.topIs(tok!"."))
|
||||
indents.pop();
|
||||
|
||||
if (onNextLine)
|
||||
{
|
||||
|
@ -1440,7 +1442,8 @@ private:
|
|||
if (ufcsWrap || linebreakHints.canFind(index) || onNextLine
|
||||
|| (linebreakHints.length == 0 && currentLineLength + nextTokenLength() > config.max_line_length))
|
||||
{
|
||||
pushWrapIndent();
|
||||
if (!indents.topIs(tok!"."))
|
||||
indents.push(tok!".");
|
||||
if (!peekBackIs(tok!"comment"))
|
||||
newline();
|
||||
if (ufcsWrap || onNextLine)
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
void main()
|
||||
{
|
||||
const a1 = [
|
||||
builder.rebuild!((x, y, z) => x + y + z)
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x),
|
||||
];
|
||||
|
||||
const a2 = [
|
||||
builder.rebuild!(x => x)
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x),
|
||||
builder.rebuild!(x => x)
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x),
|
||||
];
|
||||
|
||||
foo([
|
||||
line1,
|
||||
value_line2_bla_bla_bla.propertyCallBlaBlaBla(a, b, c)
|
||||
.propertyCallBlaBlaBla(a, b, c, d).propertyCallBlaBlaBla(a, b, c)
|
||||
.propertyCallBlaBlaBla(a, b, c).value,
|
||||
]);
|
||||
}
|
||||
|
||||
void foo()
|
||||
{
|
||||
afdsafds.asdf.flub;
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
void main()
|
||||
{
|
||||
const a1 = [
|
||||
builder
|
||||
.rebuild!((x, y, z) => x + y + z)
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x),
|
||||
];
|
||||
|
||||
const a2 = [
|
||||
builder
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x),
|
||||
builder
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x),
|
||||
];
|
||||
|
||||
foo([
|
||||
line1,
|
||||
value_line2_bla_bla_bla.propertyCallBlaBlaBla(a, b, c)
|
||||
.propertyCallBlaBlaBla(a, b, c, d).propertyCallBlaBlaBla(a, b, c)
|
||||
.propertyCallBlaBlaBla(a, b, c).value,
|
||||
]);
|
||||
}
|
||||
|
||||
void foo()
|
||||
{
|
||||
afdsafds
|
||||
.asdf
|
||||
.flub;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
void main()
|
||||
{
|
||||
const a1 = [
|
||||
builder
|
||||
.rebuild!((x, y, z) => x + y + z)
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x),
|
||||
];
|
||||
|
||||
const a2 = [
|
||||
builder
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x),
|
||||
builder
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x),
|
||||
];
|
||||
|
||||
foo([
|
||||
line1,
|
||||
value_line2_bla_bla_bla.propertyCallBlaBlaBla(a, b, c)
|
||||
.propertyCallBlaBlaBla(a, b, c, d).propertyCallBlaBlaBla(a, b, c)
|
||||
.propertyCallBlaBlaBla(a, b, c).value,
|
||||
]);
|
||||
}
|
||||
|
||||
void foo() {
|
||||
afdsafds
|
||||
.asdf
|
||||
.flub;
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
--keep_line_breaks=true
|
|
@ -0,0 +1,33 @@
|
|||
void main()
|
||||
{
|
||||
const a1 = [
|
||||
builder
|
||||
.rebuild!((x, y, z) => x + y + z)
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x),
|
||||
];
|
||||
|
||||
const a2 = [
|
||||
builder
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x),
|
||||
builder
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x),
|
||||
];
|
||||
|
||||
foo([
|
||||
line1,
|
||||
value_line2_bla_bla_bla.propertyCallBlaBlaBla(a, b, c)
|
||||
.propertyCallBlaBlaBla(a, b, c, d).propertyCallBlaBlaBla(a, b, c)
|
||||
.propertyCallBlaBlaBla(a, b, c).value,
|
||||
]);
|
||||
}
|
||||
|
||||
void foo() {
|
||||
afdsafds
|
||||
.asdf
|
||||
.flub;
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
void main()
|
||||
{
|
||||
const a1 = [
|
||||
builder.rebuild!((x, y, z) => x + y + z)
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x),
|
||||
];
|
||||
|
||||
const a2 = [
|
||||
builder.rebuild!(x => x)
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x),
|
||||
builder.rebuild!(x => x)
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x),
|
||||
];
|
||||
|
||||
foo([
|
||||
line1,
|
||||
value_line2_bla_bla_bla.propertyCallBlaBlaBla(a, b, c)
|
||||
.propertyCallBlaBlaBla(a, b, c, d).propertyCallBlaBlaBla(a, b, c)
|
||||
.propertyCallBlaBlaBla(a, b, c).value,
|
||||
]);
|
||||
}
|
||||
|
||||
void foo()
|
||||
{
|
||||
afdsafds.asdf.flub;
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
void main()
|
||||
{
|
||||
const a1 = [
|
||||
builder
|
||||
.rebuild!((x, y, z) => x + y + z)
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x),
|
||||
];
|
||||
|
||||
const a2 = [
|
||||
builder
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x),
|
||||
builder
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x),
|
||||
];
|
||||
|
||||
foo([
|
||||
line1,
|
||||
value_line2_bla_bla_bla.propertyCallBlaBlaBla(a, b, c)
|
||||
.propertyCallBlaBlaBla(a, b, c, d).propertyCallBlaBlaBla(a, b, c)
|
||||
.propertyCallBlaBlaBla(a, b, c).value,
|
||||
]);
|
||||
}
|
||||
|
||||
void foo()
|
||||
{
|
||||
afdsafds
|
||||
.asdf
|
||||
.flub;
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
void main() {
|
||||
const a1 = [
|
||||
builder.rebuild!((x, y, z) => x + y + z)
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x),
|
||||
];
|
||||
|
||||
const a2 = [
|
||||
builder.rebuild!(x => x)
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x),
|
||||
builder.rebuild!(x => x)
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x),
|
||||
];
|
||||
|
||||
foo([
|
||||
line1,
|
||||
value_line2_bla_bla_bla.propertyCallBlaBlaBla(a, b, c)
|
||||
.propertyCallBlaBlaBla(a, b, c, d).propertyCallBlaBlaBla(a, b, c)
|
||||
.propertyCallBlaBlaBla(a, b, c).value,
|
||||
]);
|
||||
}
|
||||
|
||||
void foo() {
|
||||
afdsafds.asdf.flub;
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
void main() {
|
||||
const a1 = [
|
||||
builder
|
||||
.rebuild!((x, y, z) => x + y + z)
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x),
|
||||
];
|
||||
|
||||
const a2 = [
|
||||
builder
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x),
|
||||
builder
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x)
|
||||
.rebuild!(x => x),
|
||||
];
|
||||
|
||||
foo([
|
||||
line1,
|
||||
value_line2_bla_bla_bla.propertyCallBlaBlaBla(a, b, c)
|
||||
.propertyCallBlaBlaBla(a, b, c, d).propertyCallBlaBlaBla(a, b, c)
|
||||
.propertyCallBlaBlaBla(a, b, c).value,
|
||||
]);
|
||||
}
|
||||
|
||||
void foo() {
|
||||
afdsafds
|
||||
.asdf
|
||||
.flub;
|
||||
}
|
Loading…
Reference in New Issue