mirror of
https://github.com/haskell/ghcide.git
synced 2024-12-12 02:24:13 +03:00
parent
821c7f6ffa
commit
f8e6ab171f
@ -142,12 +142,16 @@ spansAtPoint :: Position -> [SpanInfo] -> [SpanInfo]
|
|||||||
spansAtPoint pos = filter atp where
|
spansAtPoint pos = filter atp where
|
||||||
line = _line pos
|
line = _line pos
|
||||||
cha = _character pos
|
cha = _character pos
|
||||||
atp SpanInfo{..} = spaninfoStartLine <= line
|
atp SpanInfo{..} =
|
||||||
&& spaninfoEndLine >= line
|
startsBeforePosition && endsAfterPosition
|
||||||
&& spaninfoStartCol <= cha
|
where
|
||||||
-- The end col points to the column after the
|
startLineCmp = compare spaninfoStartLine line
|
||||||
-- last character so we use > instead of >=
|
endLineCmp = compare spaninfoEndLine line
|
||||||
&& spaninfoEndCol > cha
|
|
||||||
|
startsBeforePosition = startLineCmp == LT || (startLineCmp == EQ && spaninfoStartCol <= cha)
|
||||||
|
-- The end col points to the column after the
|
||||||
|
-- last character so we use > instead of >=
|
||||||
|
endsAfterPosition = endLineCmp == GT || (endLineCmp == EQ && spaninfoEndCol > cha)
|
||||||
|
|
||||||
showName :: Outputable a => a -> T.Text
|
showName :: Outputable a => a -> T.Text
|
||||||
showName = T.pack . prettyprint
|
showName = T.pack . prettyprint
|
||||||
|
@ -954,7 +954,7 @@ findDefinitionAndHoverTests = let
|
|||||||
, test broken broken fffL8 fff "field in record construction #71"
|
, test broken broken fffL8 fff "field in record construction #71"
|
||||||
, test yes yes fffL14 fff "field name used as accessor" -- 120 in Calculate.hs
|
, test yes yes fffL14 fff "field name used as accessor" -- 120 in Calculate.hs
|
||||||
, test yes yes aaaL14 aaa "top-level name" -- 120
|
, test yes yes aaaL14 aaa "top-level name" -- 120
|
||||||
, test broken broken dcL7 tcDC "data constructor record #247"
|
, test yes yes dcL7 tcDC "data constructor record #247"
|
||||||
, test yes yes dcL12 tcDC "data constructor plain" -- 121
|
, test yes yes dcL12 tcDC "data constructor plain" -- 121
|
||||||
, test yes yes tcL6 tcData "type constructor #248" -- 147
|
, test yes yes tcL6 tcData "type constructor #248" -- 147
|
||||||
, test broken yes xtcL5 xtc "type constructor external #248,249"
|
, test broken yes xtcL5 xtc "type constructor external #248,249"
|
||||||
|
Loading…
Reference in New Issue
Block a user