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" [
366
366
, testCase " completes qualified type suggestions" $ runSession hlsCommand fullCaps " test/testdata/completion" $ do
367
367
doc <- openDoc " Context.hs" " haskell"
368
368
_ <- 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.
374
369
compls <- getCompletions doc (Position 2 26 )
375
370
liftIO $ do
376
- -- forkOn is an inappropriate completion in a type context.
377
- compls `shouldContainCompl` " forkOn"
371
+ compls `shouldNotContainCompl` " forkOn"
378
372
compls `shouldContainCompl` " MVar"
379
373
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"
391
374
]
392
375
393
376
shouldContainCompl :: [CompletionItem ] -> T. Text -> Assertion
Original file line number Diff line number Diff line change 1
1
module Context where
2
2
import Control.Concurrent as Conc
3
- foo :: Int -> Int
3
+ foo :: Int -> Int -> Conc. MVar
4
4
foo x = abs $ id 42
You can’t perform that action at this time.
0 commit comments