Skip to content

Do not hang record constructors#492

Merged
mrkkrp merged 1 commit intomasterfrom
mk/fix-447
Jan 9, 2020
Merged

Do not hang record constructors#492
mrkkrp merged 1 commit intomasterfrom
mk/fix-447

Conversation

@mrkkrp
Copy link
Copy Markdown
Member

@mrkkrp mrkkrp commented Jan 9, 2020

Close #447.

Previously we hanged record constructors but not record updates. It looks
like unlike other hanging constructions (lambdas, case expressions, and
do-blocks), record constructors and updates should rather be placed
normally. Indeed, when we stop hanging them, many constructions start to
look more reasonable and predictable (see the updated test cases).

Yet the change is not enough to fix the problem in general case: it is
enough to replace the record with a e.g. do-block to get the same failure.
To correct that we adjust what should fit in one line for hanging placement
to fire: now we consider the span between beginning of function and the
start of potentially-hanging construction.

Previously we hanged record constructors but not record updates. It looks
like unlike other hanging constructions (lambdas, case expressions, and
do-blocks), record constructors and updates should rather be placed
normally. Indeed, when we stop hanging them, many constructions start to
look more reasonable and predictable (see the updated test cases).

Yet the change is not enough to fix the problem in general case: it is
enough to replace the record with a e.g. do-block to get the same failure.
To correct that we adjust what should fit in one line for hanging placement
to fire: now we consider the span between beginning of function and the
start of potentially-hanging construction.
@mrkkrp mrkkrp merged commit 1eefa97 into master Jan 9, 2020
@mrkkrp mrkkrp deleted the mk/fix-447 branch January 9, 2020 19:43
@georgefst georgefst mentioned this pull request Sep 27, 2020
13 tasks
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.

Invalid formatting of indented record with comment

1 participant