File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed
src/Development/IDE/Spans Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -142,12 +142,16 @@ spansAtPoint :: Position -> [SpanInfo] -> [SpanInfo]
142
142
spansAtPoint pos = filter atp where
143
143
line = _line pos
144
144
cha = _character pos
145
- atp SpanInfo {.. } = spaninfoStartLine <= line
146
- && spaninfoEndLine >= line
147
- && spaninfoStartCol <= cha
148
- -- The end col points to the column after the
149
- -- last character so we use > instead of >=
150
- && spaninfoEndCol > cha
145
+ atp SpanInfo {.. } =
146
+ startsBeforePosition && endsAfterPosition
147
+ where
148
+ startLineCmp = compare spaninfoStartLine line
149
+ endLineCmp = compare spaninfoEndLine line
150
+
151
+ startsBeforePosition = startLineCmp == LT || (startLineCmp == EQ && spaninfoStartCol <= cha)
152
+ -- The end col points to the column after the
153
+ -- last character so we use > instead of >=
154
+ endsAfterPosition = endLineCmp == GT || (endLineCmp == EQ && spaninfoEndCol > cha)
151
155
152
156
showName :: Outputable a => a -> T. Text
153
157
showName = T. pack . prettyprint
Original file line number Diff line number Diff line change @@ -954,7 +954,7 @@ findDefinitionAndHoverTests = let
954
954
, test broken broken fffL8 fff " field in record construction #71"
955
955
, test yes yes fffL14 fff " field name used as accessor" -- 120 in Calculate.hs
956
956
, test yes yes aaaL14 aaa " top-level name" -- 120
957
- , test broken broken dcL7 tcDC " data constructor record #247"
957
+ , test yes yes dcL7 tcDC " data constructor record #247"
958
958
, test yes yes dcL12 tcDC " data constructor plain" -- 121
959
959
, test yes yes tcL6 tcData " type constructor #248" -- 147
960
960
, test broken yes xtcL5 xtc " type constructor external #248,249"
You can’t perform that action at this time.
0 commit comments