mirror of
https://github.com/haskell/ghcide.git
synced 2024-12-03 05:23:25 +03:00
parent
821c7f6ffa
commit
f8e6ab171f
@ -142,12 +142,16 @@ spansAtPoint :: Position -> [SpanInfo] -> [SpanInfo]
|
||||
spansAtPoint pos = filter atp where
|
||||
line = _line pos
|
||||
cha = _character pos
|
||||
atp SpanInfo{..} = spaninfoStartLine <= line
|
||||
&& spaninfoEndLine >= line
|
||||
&& spaninfoStartCol <= cha
|
||||
-- The end col points to the column after the
|
||||
-- last character so we use > instead of >=
|
||||
&& spaninfoEndCol > cha
|
||||
atp SpanInfo{..} =
|
||||
startsBeforePosition && endsAfterPosition
|
||||
where
|
||||
startLineCmp = compare spaninfoStartLine line
|
||||
endLineCmp = compare spaninfoEndLine line
|
||||
|
||||
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 = T.pack . prettyprint
|
||||
|
@ -954,7 +954,7 @@ findDefinitionAndHoverTests = let
|
||||
, 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 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 tcL6 tcData "type constructor #248" -- 147
|
||||
, test broken yes xtcL5 xtc "type constructor external #248,249"
|
||||
|
Loading…
Reference in New Issue
Block a user