Skip to content

Commit 840b9d6

Browse files
committed
Add failing test for variables in hovers
Witnesses #2716.
1 parent 016ccde commit 840b9d6

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

ghcide/test/data/hover/GotoHover.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,6 @@ aa2 = $(id [| True |])
6161

6262
hole :: Int
6363
hole = _
64+
65+
hole2 :: a -> Maybe a
66+
hole2 = _

ghcide/test/exe/Main.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4111,6 +4111,7 @@ findDefinitionAndHoverTests = let
41114111
outL45 = Position 49 3 ; outSig = [ExpectHoverText ["outer", "Bool"], mkR 50 0 50 5]
41124112
innL48 = Position 52 5 ; innSig = [ExpectHoverText ["inner", "Char"], mkR 49 2 49 7]
41134113
holeL60 = Position 62 7 ; hleInfo = [ExpectHoverText ["_ ::"]]
4114+
holeL65 = Position 65 8 ; hleInfo2 = [ExpectHoverText ["_ :: a -> Maybe a"]]
41144115
cccL17 = Position 17 16 ; docLink = [ExpectHoverText ["[Documentation](file:///"]]
41154116
imported = Position 56 13 ; importedSig = getDocUri "Foo.hs" >>= \foo -> return [ExpectHoverText ["foo", "Foo", "Haddock"], mkL foo 5 0 5 3]
41164117
reexported = Position 55 14 ; reexportedSig = getDocUri "Bar.hs" >>= \bar -> return [ExpectHoverText ["Bar", "Bar", "Haddock"], mkL bar 3 0 3 14]
@@ -4165,6 +4166,11 @@ findDefinitionAndHoverTests = let
41654166
, test no yes outL45 outSig "top-level signature #767"
41664167
, test broken broken innL48 innSig "inner signature #767"
41674168
, test no yes holeL60 hleInfo "hole without internal name #831"
4169+
, if ghcVersion >= GHC92 then
4170+
-- Broken on GHC 9.2 and above due to printing of uniques
4171+
test no yes holeL65 [] "hole with variable"
4172+
else
4173+
test no yes holeL65 hleInfo2 "hole with variable"
41684174
, test no skip cccL17 docLink "Haddock html links"
41694175
, testM yes yes imported importedSig "Imported symbol"
41704176
, testM yes yes reexported reexportedSig "Imported symbol (reexported)"

0 commit comments

Comments
 (0)