1
1
mirror of https://github.com/google/ormolu.git synced 2024-11-23 14:16:24 +03:00
ormolu/data
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
..
examples Fix Haddock placement for function arguments 2019-06-11 22:21:41 +02:00
printer Implement pretty printing combinators 2019-01-28 19:26:13 +01:00