@@ -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,11 +4345,10 @@ 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" ]]
4351
- doc36 = Position 36 20 ; multiDoc = [ExpectHoverText [" \n\n [Documentation](file:///" ]]
4352
4352
in
4353
4353
mkFindTests
4354
4354
-- def hover look expect
@@ -4400,7 +4400,7 @@ findDefinitionAndHoverTests = let
4400
4400
, test broken broken innL48 innSig " inner signature #767"
4401
4401
, test no yes holeL60 hleInfo " hole without internal name #831"
4402
4402
, test no yes holeL65 hleInfo2 " hole with variable"
4403
- , test no skip cccL17 docLink " Haddock html links"
4403
+ , test no yes cccL17 docLink " Haddock html links"
4404
4404
, testM yes yes imported importedSig " Imported symbol"
4405
4405
, testM yes yes reexported reexportedSig " Imported symbol (reexported)"
4406
4406
, if | ghcVersion == GHC90 && isWindows ->
@@ -4411,7 +4411,6 @@ findDefinitionAndHoverTests = let
4411
4411
test no broken thLocL57 thLoc " TH Splice Hover"
4412
4412
| otherwise ->
4413
4413
test no yes thLocL57 thLoc " TH Splice Hover"
4414
- , test yes yes doc36 multiDoc " two newlines before document"
4415
4414
]
4416
4415
where yes, broken :: (TestTree -> Maybe TestTree )
4417
4416
yes = Just -- test should run and pass
@@ -5745,6 +5744,7 @@ data Expect
5745
5744
-- | ExpectDefRange Range -- Only gotoDef should report this range
5746
5745
| ExpectHoverRange Range -- Only hover should report this range
5747
5746
| ExpectHoverText [T. Text ] -- the hover message must contain these snippets
5747
+ | ExpectHoverTextRegex T. Text -- the hover message must match this pattern
5748
5748
| ExpectExternFail -- definition lookup in other file expected to fail
5749
5749
| ExpectNoDefinitions
5750
5750
| ExpectNoHover
0 commit comments