Incorrect break caused by and cause of column-violation #159
Labels
No Label
blocked: dependency
blocked: info-needed
bug
duplicate
enhancement
fixed in HEAD
help wanted
hs:arrows
hs:brackets
hs:classes
hs:comments
hs:do-notation
hs:guards
hs:lists
hs:operators
hs:patterns
hs:records
hs:types
invalid
language extension support
layouting
needs confirmation
priority: high
priority: low
question
revisit before next release
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: hexagoxel/brittany#159
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
I'm encountering a case where Brittany gets the line-breaks of an
it "" . f $ do
expression wrong, which seems to be both caused by, and the cause of, a trailing comment going past our column limit many expressions away.Here's what it gets wrong:
It should look like this:
(This has been extracted from a larger test case, so forgive the redundant
do
s and lack of context on what any of this means.)It seems to be caused by the trailing
-- still
which is a column violoation but only when theit
formatting is incorrect.If we remove it, Brittany gets things right:
We can also force Brittany to get things right by removing one of the lines (either one will do):
So somehow the number of expressions in that last
do
matters as well.I'm a bit baffled :)
And here's our config for reference
Interesting, thanks for reporting.
Fixed in
3c5670d5cd
.This was connected to forcing a multi-line layout for sequences of operator applications, e.g.
where there is a single-line layout but we don't want it due to the comments. This "layouting rule" also prevented the put-things-in-same-line in
it .. . withGraph .. $ do ..
because thedo
part contained, somewhere below, a comment.Fix was to be less eager when searching for comments, i.e. we now ignore comments on the last element of such a operator sequence.