Skip to content

Revisit lambdas#3303

Draft
nojaf wants to merge 4 commits intofsprojects:mainfrom
nojaf:revisit-lambdas
Draft

Revisit lambdas#3303
nojaf wants to merge 4 commits intofsprojects:mainfrom
nojaf:revisit-lambdas

Conversation

@nojaf
Copy link
Contributor

@nojaf nojaf commented Mar 20, 2026

Related to #3279

nojaf added 4 commits March 13, 2026 14:02
Add requiresMultilineToPreserveSemantics helper and apply it to the
Expr.SameInfixApps code path. Chained infix expressions (e.g. |>, <*|)
with an open-ended leading or intermediate expression (lambda,
if-then-else) now stay multiline instead of collapsing to a single
line with parentheses, preventing semantic changes.
Replace parenthesis wrapping with comma-leading multiline layout when a
non-last tuple element is open-ended (lambda, if-then-else, match,
try-with, try-finally). This removes wrapInfixAppRhsInParenIfNeeded
and the ad-hoc containsLambdaOrMatchExpr check in genTupleMultiline,
replacing both with requiresMultilineToPreserveSemantics.

Also extends isOpenEndedExpression to include match, function,
try-with, and try-finally expressions.
match e with
| Expr.Lambda _
| Expr.IfThen _
| Expr.IfThenElse _

Check notice

Code scanning / Ionide.Analyzers.Cli

Short description about ReturnStructPartialActivePatternAnalyzer Note

Consider adding [<return: Struct>] to partial active pattern.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant