Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/generation/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9793,8 +9793,8 @@ fn allows_inline_multi_line<'a>(node: Node<'a>, context: &Context<'a>, has_sibli
_ => allows_inline_multi_line(as_expr.type_ann.into(), context, has_siblings),
}
}
Node::ArrowExpr(arrow) => matches!(arrow.body, BlockStmtOrExpr::BlockStmt(_)),
Node::FnExpr(_)
| Node::ArrowExpr(_)
| Node::ObjectLit(_)
| Node::ArrayLit(_)
| Node::ObjectPat(_)
Expand Down
45 changes: 45 additions & 0 deletions tests/specs/issues/issue0686.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
~~ lineWidth: 80, indentWidth: 2, memberExpression.linePerExpression: true ~~
== generator ==
const createTestData = () =>
function*() {
const startingFrom = yield* Effect.map(DateTime.now, now => DateTime.startOf(now, "day"));

return HashSet.make(DateTime.toEpochMillis(startingFrom));
};


[expect]
const createTestData = () =>
function*() {
const startingFrom = yield* Effect.map(
DateTime.now,
now => DateTime.startOf(now, "day"),
);

return HashSet.make(DateTime.toEpochMillis(startingFrom));
};

== function ==
const func = () =>
function() {
const startingFrom = Effect.map(DateTime.now, now => DateTime.startOf(now, 'day'))

return myObj
.myMethod({
missionType: otherObj.prop.nested,
});
};

[expect]
const func = () =>
function() {
const startingFrom = Effect.map(
DateTime.now,
now => DateTime.startOf(now, "day"),
);

return myObj
.myMethod({
missionType: otherObj.prop.nested,
});
};
46 changes: 46 additions & 0 deletions tests/specs/issues/issue753.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
~~ lineWidth: 80, indentWidth: 2, memberExpression.linePerExpression: true ~~
== function args ==
const startingFrom = Mylib.map(DateTime.now, now => DateTime.startOf(now, "day"));

const func = () =>
function() {
const startingFrom = Mylib.map(DateTime.now, now => DateTime.startOf(now, "day"));
}


[expect]
const startingFrom = Mylib.map(
DateTime.now,
now => DateTime.startOf(now, "day"),
);

const func = () =>
function() {
const startingFrom = Mylib.map(
DateTime.now,
now => DateTime.startOf(now, "day"),
);
};

== function args same line length ==
const startingFroom = Mylib.map(DateTime.now, now => DateTime.startOf(now, "day"));

const func = () =>
function() {
const startingF = Mylib.map(DateTime.now, now => DateTime.startOf(now, "day"));
}


[expect]
const startingFroom = Mylib.map(
DateTime.now,
now => DateTime.startOf(now, "day"),
);

const func = () =>
function() {
const startingF = Mylib.map(
DateTime.now,
now => DateTime.startOf(now, "day"),
);
};