mirror of
https://github.com/haskell/ghcide.git
synced 2024-12-04 15:52:08 +03:00
87f449d2c5
The bug was caused by broken transitivity of the comparison function used to sort spans. Nested spans were meant to be sorted in innermost-first order, with the first (innermost) one being used to get type information about the symbol at a given position. Because the comparison function considered any two non-nested spans to be EQ, the sort could incorrectly conclude (by transitivity) that two nested spans were equal, and thus leave them in incorrect relative order. This resulted in the innermost span sometimes not appearing at the front of the list of spans which enclose a given point, and hover reporting the type of a bigger expression in which the point appeared. The solution imposes ordering on non-nested spans by comparing their starting positions, thus fixing transitivity. Fixes #237 (... probably along with a bunch of other little bugs caused by the same mistake). |
||
---|---|---|
.. | ||
cabal/Development/IDE/Test | ||
data | ||
exe | ||
manual/lhs | ||
src/Development/IDE |