@@ -4254,6 +4254,7 @@ findDefinitionAndHoverTests = let
42544254 ExpectRange expectedRange -> checkHoverRange expectedRange rangeInHover msg
42554255 ExpectHoverRange expectedRange -> checkHoverRange expectedRange rangeInHover msg
42564256 ExpectHoverText snippets -> liftIO $ traverse_ (`assertFoundIn` msg) snippets
4257+ ExpectHoverTextRegex re -> liftIO $ assertBool (" Regex not found in " <> T. unpack msg) (msg =~ re :: Bool )
42574258 ExpectNoHover -> liftIO $ assertFailure $ " Expected no hover but got " <> show hover
42584259 _ -> pure () -- all other expectations not relevant to hover
42594260 _ -> liftIO $ assertFailure $ " test not expecting this kind of hover info" <> show hover
@@ -4344,7 +4345,7 @@ findDefinitionAndHoverTests = let
43444345 innL48 = Position 52 5 ; innSig = [ExpectHoverText [" inner" , " Char" ], mkR 49 2 49 7 ]
43454346 holeL60 = Position 62 7 ; hleInfo = [ExpectHoverText [" _ ::" ]]
43464347 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 " ]
43484349 imported = Position 56 13 ; importedSig = getDocUri " Foo.hs" >>= \ foo -> return [ExpectHoverText [" foo" , " Foo" , " Haddock" ], mkL foo 5 0 5 3 ]
43494350 reexported = Position 55 14 ; reexportedSig = getDocUri " Bar.hs" >>= \ bar -> return [ExpectHoverText [" Bar" , " Bar" , " Haddock" ], mkL bar 3 0 3 14 ]
43504351 thLocL57 = Position 59 10 ; thLoc = [ExpectHoverText [" Identity" ]]
@@ -4399,7 +4400,7 @@ findDefinitionAndHoverTests = let
43994400 , test broken broken innL48 innSig " inner signature #767"
44004401 , test no yes holeL60 hleInfo " hole without internal name #831"
44014402 , 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"
44034404 , testM yes yes imported importedSig " Imported symbol"
44044405 , testM yes yes reexported reexportedSig " Imported symbol (reexported)"
44054406 , if | ghcVersion == GHC90 && isWindows ->
@@ -5743,6 +5744,7 @@ data Expect
57435744-- | ExpectDefRange Range -- Only gotoDef should report this range
57445745 | ExpectHoverRange Range -- Only hover should report this range
57455746 | ExpectHoverText [T. Text ] -- the hover message must contain these snippets
5747+ | ExpectHoverTextRegex T. Text -- the hover message must match this pattern
57465748 | ExpectExternFail -- definition lookup in other file expected to fail
57475749 | ExpectNoDefinitions
57485750 | ExpectNoHover
0 commit comments