File tree Expand file tree Collapse file tree 2 files changed +2
-19
lines changed Expand file tree Collapse file tree 2 files changed +2
-19
lines changed Original file line number Diff line number Diff line change @@ -366,28 +366,11 @@ contextTests = testGroup "contexts" [
366366 , testCase " completes qualified type suggestions" $ runSession hlsCommand fullCaps " test/testdata/completion" $ do
367367 doc <- openDoc " Context.hs" " haskell"
368368 _ <- waitForDiagnosticsFrom doc
369- let te = TextEdit (Range (Position 2 17 ) (Position 2 17 )) " -> Conc."
370- _ <- applyEdit doc te
371- -- The module doesn't parse right now. So we are using stale data. HLS
372- -- can give us completions for "Conc." but it can't tell that we are in
373- -- a context where we expect a type.
374369 compls <- getCompletions doc (Position 2 26 )
375370 liftIO $ do
376- -- forkOn is an inappropriate completion in a type context.
377- compls `shouldContainCompl` " forkOn"
371+ compls `shouldNotContainCompl` " forkOn"
378372 compls `shouldContainCompl` " MVar"
379373 compls `shouldContainCompl` " Chan"
380- let te' = TextEdit (Range (Position 2 26 ) (Position 2 26 )) " MVar"
381- _ <- applyEdit doc te'
382- -- The module can now be parsed. Wait until it has been.
383- _ <- waitForDiagnosticsFrom doc
384- -- HLS can see that we are expecting a type.
385- compls' <- getCompletions doc (Position 2 26 )
386- liftIO $ do
387- -- forkOn is gone.
388- compls' `shouldNotContainCompl` " forkOn"
389- compls' `shouldContainCompl` " MVar"
390- compls' `shouldContainCompl` " Chan"
391374 ]
392375
393376shouldContainCompl :: [CompletionItem ] -> T. Text -> Assertion
Original file line number Diff line number Diff line change 11module Context where
22import Control.Concurrent as Conc
3- foo :: Int -> Int
3+ foo :: Int -> Int -> Conc. MVar
44foo x = abs $ id 42
You can’t perform that action at this time.
0 commit comments