Skip to content

Stop operators from being indented past do.#6

Merged
georgefst merged 1 commit intomasterfrom
fix-tests
Jun 22, 2020
Merged

Stop operators from being indented past do.#6
georgefst merged 1 commit intomasterfrom
fix-tests

Conversation

@georgefst
Copy link
Collaborator

The more I've thought about this, it seems that the behaviour causing the remaining test failure at #1 is really very specific to that sort of expression (a do block in the LHS of an infix operator). And frankly I'd be suspicious of code that looked like that anyway - before today I wouldn't have been confident at a glance of how that parses.

So I figure it's better to treat it as the unusual edge case it is. #5 seems overkill, since, as one fix led to another, the changes became more pervasive than we'd want, in terms of behaviour and LOC. This patch gets straight to the point, and is thus much smaller in both senses.

Previous behaviour caused AST changes on formatting in cases like `infix/do.hs`.
@georgefst georgefst linked an issue Jun 16, 2020 that may be closed by this pull request
@georgefst
Copy link
Collaborator Author

As a more general point, I think we probably want to keep code changes small for the foreseeable future, in order to continue to merge in improvements from ormolu. This could quickly become a maintenance nightmare otherwise, since in particular, as I discovered while working on this, idempotence is a rather fragile thing.

And it would be great if, once we have some configurability, we could fully simulate the behaviour of ormolu itself. Especially in light of the discussion at haskell/haskell-language-server#161.

@georgefst georgefst requested a review from parsonsmatt June 19, 2020 12:06
@georgefst georgefst merged commit 2cf6b4d into master Jun 22, 2020
@georgefst georgefst deleted the fix-tests branch June 23, 2020 00:33
@georgefst georgefst mentioned this pull request Oct 1, 2020
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.

Fix the test suite

1 participant