1
1
mirror of https://github.com/google/ormolu.git synced 2024-11-27 13:13:23 +03:00
ormolu/data/examples
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
..
declaration Fix rendering of implicit parameter variables 2019-06-10 22:43:37 +02:00
import Implement more precise comment placement without ‘ghc-exactprint’ 2019-05-08 22:03:21 +02:00
module-header Implement handling of comments and printing of module headers 2019-02-21 18:15:27 +01:00
other Fix Haddock placement for function arguments 2019-06-11 22:21:41 +02:00