@@ -1026,6 +1026,7 @@ findDefinitionAndHoverTests = let
1026
1026
ExpectRange expectedRange -> checkHoverRange expectedRange rangeInHover msg
1027
1027
ExpectHoverRange expectedRange -> checkHoverRange expectedRange rangeInHover msg
1028
1028
ExpectHoverText snippets -> liftIO $ traverse_ (`assertFoundIn` msg) snippets
1029
+ ExpectHoverExcludeText snippets -> liftIO $ traverse_ (`assertNotFoundIn` msg) snippets
1029
1030
ExpectHoverTextRegex re -> liftIO $ assertBool (" Regex not found in " <> T. unpack msg) (msg =~ re :: Bool )
1030
1031
ExpectNoHover -> liftIO $ assertFailure $ " Expected no hover but got " <> show hover
1031
1032
_ -> pure () -- all other expectations not relevant to hover
@@ -1054,6 +1055,11 @@ findDefinitionAndHoverTests = let
1054
1055
(T. unpack $ " failed to find: `" <> part <> " ` in hover message:\n " <> whole)
1055
1056
(part `T.isInfixOf` whole)
1056
1057
1058
+ assertNotFoundIn :: T. Text -> T. Text -> Assertion
1059
+ assertNotFoundIn part whole = assertBool
1060
+ (T. unpack $ " found unexpected: `" <> part <> " ` in hover message:\n " <> whole)
1061
+ (not . T. isInfixOf part $ whole)
1062
+
1057
1063
sourceFilePath = T. unpack sourceFileName
1058
1064
sourceFileName = " GotoHover.hs"
1059
1065
@@ -1130,6 +1136,7 @@ findDefinitionAndHoverTests = let
1130
1136
imported = Position 56 13 ; importedSig = getDocUri " Foo.hs" >>= \ foo -> return [ExpectHoverText [" foo" , " Foo" , " Haddock" ], mkL foo 5 0 5 3 ]
1131
1137
reexported = Position 55 14 ; reexportedSig = getDocUri " Bar.hs" >>= \ bar -> return [ExpectHoverText [" Bar" , " Bar" , " Haddock" ], mkL bar 3 (if ghcVersion >= GHC94 then 5 else 0 ) 3 (if ghcVersion >= GHC94 then 8 else 14 )]
1132
1138
thLocL57 = Position 59 10 ; thLoc = [ExpectHoverText [" Identity" ]]
1139
+ cmtL68 = Position 67 0 ; lackOfdEq = [ExpectHoverExcludeText [" $dEq" ]]
1133
1140
in
1134
1141
mkFindTests
1135
1142
-- def hover look expect
@@ -1173,6 +1180,7 @@ findDefinitionAndHoverTests = let
1173
1180
, test no broken chrL36 litC " literal Char in hover info #1016"
1174
1181
, test no broken txtL8 litT " literal Text in hover info #1016"
1175
1182
, test no broken lstL43 litL " literal List in hover info #1016"
1183
+ , test yes yes cmtL68 lackOfdEq " no Core symbols #3280"
1176
1184
, if ghcVersion >= GHC90 then
1177
1185
test no yes docL41 constr " type constraint in hover info #1012"
1178
1186
else
@@ -2354,6 +2362,7 @@ data Expect
2354
2362
-- | ExpectDefRange Range -- Only gotoDef should report this range
2355
2363
| ExpectHoverRange Range -- Only hover should report this range
2356
2364
| ExpectHoverText [T. Text ] -- the hover message must contain these snippets
2365
+ | ExpectHoverExcludeText [T. Text ] -- the hover message must _not_ contain these snippets
2357
2366
| ExpectHoverTextRegex T. Text -- the hover message must match this pattern
2358
2367
| ExpectExternFail -- definition lookup in other file expected to fail
2359
2368
| ExpectNoDefinitions
0 commit comments