@@ -4107,7 +4107,8 @@ thLinkingTest unboxed = testCase name $ runWithExtraFiles dir $ \dir -> do
4107
4107
completionTests :: TestTree
4108
4108
completionTests
4109
4109
= testGroup " completion"
4110
- [ testGroup " non local" nonLocalCompletionTests
4110
+ [
4111
+ testGroup " non local" nonLocalCompletionTests
4111
4112
, testGroup " topLevel" topLevelCompletionTests
4112
4113
, testGroup " local" localCompletionTests
4113
4114
, testGroup " package" packageCompletionTests
@@ -4659,7 +4660,41 @@ projectCompletionTests =
4659
4660
compls <- getCompletions doc (Position 1 13 )
4660
4661
let item = head $ filter ((== " ALocalModule" ) . (^. Lens. label)) compls
4661
4662
liftIO $ do
4662
- item ^. Lens. label @?= " ALocalModule"
4663
+ item ^. Lens. label @?= " ALocalModule" ,
4664
+ testSession' " auto complete functions from qualified imports without alias" $ \ dir-> do
4665
+ liftIO $ writeFile (dir </> " hie.yaml" )
4666
+ " cradle: {direct: {arguments: [\" -Wmissing-signatures\" , \" A\" , \" B\" ]}}"
4667
+ _ <- createDoc " A.hs" " haskell" $ T. unlines
4668
+ [ " module A (anidentifier) where" ,
4669
+ " anidentifier = ()"
4670
+ ]
4671
+ _ <- waitForDiagnostics
4672
+ doc <- createDoc " B.hs" " haskell" $ T. unlines
4673
+ [ " module B where" ,
4674
+ " import qualified A" ,
4675
+ " A."
4676
+ ]
4677
+ compls <- getCompletions doc (Position 2 2 )
4678
+ let item = head compls
4679
+ liftIO $ do
4680
+ item ^. L. label @?= " anidentifier" ,
4681
+ testSession' " auto complete functions from qualified imports with alias" $ \ dir-> do
4682
+ liftIO $ writeFile (dir </> " hie.yaml" )
4683
+ " cradle: {direct: {arguments: [\" -Wmissing-signatures\" , \" A\" , \" B\" ]}}"
4684
+ _ <- createDoc " A.hs" " haskell" $ T. unlines
4685
+ [ " module A (anidentifier) where" ,
4686
+ " anidentifier = ()"
4687
+ ]
4688
+ _ <- waitForDiagnostics
4689
+ doc <- createDoc " B.hs" " haskell" $ T. unlines
4690
+ [ " module B where" ,
4691
+ " import qualified A as Alias" ,
4692
+ " foo = Alias."
4693
+ ]
4694
+ compls <- getCompletions doc (Position 2 12 )
4695
+ let item = head compls
4696
+ liftIO $ do
4697
+ item ^. L. label @?= " anidentifier"
4663
4698
]
4664
4699
4665
4700
highlightTests :: TestTree
0 commit comments