1
1
mirror of https://github.com/google/ormolu.git synced 2024-12-11 21:09:47 +03:00
ormolu/data/examples/other
mrkkrp 803f76aab9 Fix Haddock placement for function arguments
I'm not sure it's perfect, but it fixes the original issue and all the tests
pass.

The problem was in entering with locate (or some version of it) the same
span twice. So the algorithm saw an element with identical enclosing element
and the ‘commentFollowsElt’ function got confused.

The solution is two first augment registration of enclosing spans to allow
us to keep more than one item there. Then we can filter out spans which are
just copies of current reference span to get to the “real” enclosing span.

It seems to make sense to attach comments to child element if it starts
exactly at the same position of parent element, hence the distance between
start of enclosing/reference span and start of comment is the same, thus
changing ‘>’ to ‘>=’ in ‘commentFollowsElt’.
2019-06-11 22:21:41 +02:00
..
argument-comment-out.hs Fix Haddock placement for function arguments 2019-06-11 22:21:41 +02:00
argument-comment.hs Fix Haddock placement for function arguments 2019-06-11 22:21:41 +02:00
multiline-comments-reindent-out.hs Implement more precise comment placement without ‘ghc-exactprint’ 2019-05-08 22:03:21 +02:00
multiline-comments-reindent.hs Implement more precise comment placement without ‘ghc-exactprint’ 2019-05-08 22:03:21 +02:00