@@ -4283,8 +4283,8 @@ canonicalizeLocation (Location uri range) = Location <$> canonicalizeUri uri <*>
4283
4283
findDefinitionAndHoverTests :: TestTree
4284
4284
findDefinitionAndHoverTests = let
4285
4285
4286
- tst :: (TextDocumentIdentifier -> Position -> Session a , a -> Session [Expect ] -> Session () ) -> Position -> Session [Expect ] -> String -> TestTree
4287
- tst (get, check) pos targetRange title = testSessionWithExtraFiles " hover" title $ \ dir -> do
4286
+ tst :: (TextDocumentIdentifier -> Position -> Session a , a -> Session [Expect ] -> Session () ) -> Position -> String -> Session [Expect ] -> String -> TestTree
4287
+ tst (get, check) pos sfp targetRange title = testSessionWithExtraFiles " hover" title $ \ dir -> do
4288
4288
4289
4289
-- Dirty the cache to check that definitions work even in the presence of iface files
4290
4290
liftIO $ runInDir dir $ do
@@ -4294,7 +4294,7 @@ findDefinitionAndHoverTests = let
4294
4294
_ <- getHover fooDoc $ Position 4 3
4295
4295
closeDoc fooDoc
4296
4296
4297
- doc <- openTestDataDoc (dir </> sourceFilePath )
4297
+ doc <- openTestDataDoc (dir </> sfp )
4298
4298
waitForProgressDone
4299
4299
found <- get doc pos
4300
4300
check found targetRange
@@ -4352,16 +4352,25 @@ findDefinitionAndHoverTests = let
4352
4352
[ ( " GotoHover.hs" , [(DsError , (62 , 7 ), " Found hole: _" )])
4353
4353
, ( " GotoHover.hs" , [(DsError , (65 , 8 ), " Found hole: _" )])
4354
4354
]
4355
- , testGroup " type-definition" typeDefinitionTests ]
4356
-
4357
- typeDefinitionTests = [ tst (getTypeDefinitions, checkDefs) aaaL14 (pure tcData) " Saturated data con"
4358
- , tst (getTypeDefinitions, checkDefs) aL20 (pure [ExpectNoDefinitions ]) " Polymorphic variable" ]
4355
+ , testGroup " type-definition" typeDefinitionTests
4356
+ , testGroup " hover-record-dot-syntax" recordDotSyntaxTests ]
4357
+
4358
+ typeDefinitionTests = [ tst (getTypeDefinitions, checkDefs) aaaL14 sourceFilePath (pure tcData) " Saturated data con"
4359
+ , tst (getTypeDefinitions, checkDefs) aL20 sourceFilePath (pure [ExpectNoDefinitions ]) " Polymorphic variable" ]
4360
+
4361
+ recordDotSyntaxTests
4362
+ | ghcVersion == GHC92 =
4363
+ [ tst (getHover, checkHover) (Position 19 24 ) (T. unpack " RecordDotSyntax.hs" ) (pure [ExpectHoverText [" x :: MyRecord" ]]) " hover over parent"
4364
+ , tst (getHover, checkHover) (Position 19 25 ) (T. unpack " RecordDotSyntax.hs" ) (pure [ExpectHoverText [" _ :: MyChild" ]]) " hover over dot shows child"
4365
+ , tst (getHover, checkHover) (Position 19 26 ) (T. unpack " RecordDotSyntax.hs" ) (pure [ExpectHoverText [" _ :: MyChild" ]]) " hover over child"
4366
+ ]
4367
+ | otherwise = []
4359
4368
4360
4369
test runDef runHover look expect = testM runDef runHover look (return expect)
4361
4370
4362
4371
testM runDef runHover look expect title =
4363
- ( runDef $ tst def look expect title
4364
- , runHover $ tst hover look expect title ) where
4372
+ ( runDef $ tst def look sourceFilePath expect title
4373
+ , runHover $ tst hover look sourceFilePath expect title ) where
4365
4374
def = (getDefinitions, checkDefs)
4366
4375
hover = (getHover , checkHover)
4367
4376
0 commit comments