@@ -4254,6 +4254,7 @@ findDefinitionAndHoverTests = let
4254
4254
ExpectRange expectedRange -> checkHoverRange expectedRange rangeInHover msg
4255
4255
ExpectHoverRange expectedRange -> checkHoverRange expectedRange rangeInHover msg
4256
4256
ExpectHoverText snippets -> liftIO $ traverse_ (`assertFoundIn` msg) snippets
4257
+ ExpectHoverTextRegex re -> liftIO $ assertBool (" Regex not found in " <> T. unpack msg) (msg =~ re :: Bool )
4257
4258
ExpectNoHover -> liftIO $ assertFailure $ " Expected no hover but got " <> show hover
4258
4259
_ -> pure () -- all other expectations not relevant to hover
4259
4260
_ -> liftIO $ assertFailure $ " test not expecting this kind of hover info" <> show hover
@@ -4344,7 +4345,7 @@ findDefinitionAndHoverTests = let
4344
4345
innL48 = Position 52 5 ; innSig = [ExpectHoverText [" inner" , " Char" ], mkR 49 2 49 7 ]
4345
4346
holeL60 = Position 62 7 ; hleInfo = [ExpectHoverText [" _ ::" ]]
4346
4347
holeL65 = Position 65 8 ; hleInfo2 = [ExpectHoverText [" _ :: a -> Maybe a" ]]
4347
- cccL17 = Position 17 16 ; docLink = [ExpectHoverText [ " [Documentation](file:/// " ] ]
4348
+ cccL17 = Position 17 16 ; docLink = [ExpectHoverTextRegex " \\ *Defined in 'GHC.Types' \\ * \\ * \\ (ghc-prim-[0-9.]+ \\ ) \\ * \n\n " ]
4348
4349
imported = Position 56 13 ; importedSig = getDocUri " Foo.hs" >>= \ foo -> return [ExpectHoverText [" foo" , " Foo" , " Haddock" ], mkL foo 5 0 5 3 ]
4349
4350
reexported = Position 55 14 ; reexportedSig = getDocUri " Bar.hs" >>= \ bar -> return [ExpectHoverText [" Bar" , " Bar" , " Haddock" ], mkL bar 3 0 3 14 ]
4350
4351
thLocL57 = Position 59 10 ; thLoc = [ExpectHoverText [" Identity" ]]
@@ -4399,7 +4400,7 @@ findDefinitionAndHoverTests = let
4399
4400
, test broken broken innL48 innSig " inner signature #767"
4400
4401
, test no yes holeL60 hleInfo " hole without internal name #831"
4401
4402
, test no yes holeL65 hleInfo2 " hole with variable"
4402
- , test no skip cccL17 docLink " Haddock html links"
4403
+ , test no yes cccL17 docLink " Haddock html links"
4403
4404
, testM yes yes imported importedSig " Imported symbol"
4404
4405
, testM yes yes reexported reexportedSig " Imported symbol (reexported)"
4405
4406
, if | ghcVersion == GHC90 && isWindows ->
@@ -5743,6 +5744,7 @@ data Expect
5743
5744
-- | ExpectDefRange Range -- Only gotoDef should report this range
5744
5745
| ExpectHoverRange Range -- Only hover should report this range
5745
5746
| ExpectHoverText [T. Text ] -- the hover message must contain these snippets
5747
+ | ExpectHoverTextRegex T. Text -- the hover message must match this pattern
5746
5748
| ExpectExternFail -- definition lookup in other file expected to fail
5747
5749
| ExpectNoDefinitions
5748
5750
| ExpectNoHover
0 commit comments