@@ -197,6 +197,7 @@ incomingCallsTests =
197
197
testCase " xdata unavailable" $
198
198
runSessionWithServer plugin testDataDir $ do
199
199
doc <- createDoc " A.hs" " haskell" $ T. unlines [" a=3" , " b=a" ]
200
+ waitForKickDone
200
201
[item] <- Test. prepareCallHierarchy (mkPrepareCallHierarchyParam doc 1 0 )
201
202
let expected = [CallHierarchyIncomingCall item (List [mkRange 1 2 1 3 ])]
202
203
Test. prepareCallHierarchy (mkPrepareCallHierarchyParam doc 0 0 ) >>=
@@ -321,6 +322,7 @@ outgoingCallsTests =
321
322
testCase " xdata unavailable" $ withTempDir $ \ dir ->
322
323
runSessionWithServer plugin dir $ do
323
324
doc <- createDoc " A.hs" " haskell" $ T. unlines [" a=3" , " b=a" ]
325
+ waitForKickDone
324
326
[item] <- Test. prepareCallHierarchy (mkPrepareCallHierarchyParam doc 0 1 )
325
327
let expected = [CallHierarchyOutgoingCall item (List [mkRange 1 2 1 3 ])]
326
328
Test. prepareCallHierarchy (mkPrepareCallHierarchyParam doc 1 0 ) >>=
@@ -424,6 +426,7 @@ incomingCallTestCase :: T.Text -> Int -> Int -> [(Int, Int)] -> [Range] -> Asser
424
426
incomingCallTestCase contents queryX queryY positions ranges = withTempDir $ \ dir ->
425
427
runSessionWithServer plugin dir $ do
426
428
doc <- createDoc " A.hs" " haskell" contents
429
+ waitForKickDone
427
430
items <- concatMapM (\ ((x, y), range) ->
428
431
Test. prepareCallHierarchy (mkPrepareCallHierarchyParam doc x y)
429
432
<&> map (, range)
@@ -443,9 +446,11 @@ incomingCallMultiFileTestCase :: FilePath -> Int -> Int -> M.Map FilePath [((Int
443
446
incomingCallMultiFileTestCase filepath queryX queryY mp =
444
447
runSessionWithServer plugin testDataDir $ do
445
448
doc <- openDoc filepath " haskell"
446
- items <- fmap concat $ sequence $ M. elems $ M. mapWithKey (\ fp pr ->
447
- openDoc fp " haskell" >>= \ p ->
448
- concatMapM (\ ((x, y), range) ->
449
+ waitForKickDone
450
+ items <- fmap concat $ sequence $ M. elems $ M. mapWithKey (\ fp pr -> do
451
+ p <- openDoc fp " haskell"
452
+ waitForKickDone
453
+ concatMapM (\ ((x, y), range) ->
449
454
Test. prepareCallHierarchy (mkPrepareCallHierarchyParam p x y)
450
455
<&> map (, range)
451
456
) pr) mp
@@ -463,6 +468,7 @@ outgoingCallTestCase :: T.Text -> Int -> Int -> [(Int, Int)] -> [Range] -> Asser
463
468
outgoingCallTestCase contents queryX queryY positions ranges = withTempDir $ \ dir ->
464
469
runSessionWithServer plugin dir $ do
465
470
doc <- createDoc " A.hs" " haskell" contents
471
+ waitForKickDone
466
472
items <- concatMapM (\ ((x, y), range) ->
467
473
Test. prepareCallHierarchy (mkPrepareCallHierarchyParam doc x y)
468
474
<&> map (, range)
@@ -481,9 +487,11 @@ outgoingCallMultiFileTestCase :: FilePath -> Int -> Int -> M.Map FilePath [((Int
481
487
outgoingCallMultiFileTestCase filepath queryX queryY mp =
482
488
runSessionWithServer plugin testDataDir $ do
483
489
doc <- openDoc filepath " haskell"
484
- items <- fmap concat $ sequence $ M. elems $ M. mapWithKey (\ fp pr ->
485
- openDoc fp " haskell" >>= \ p ->
486
- concatMapM (\ ((x, y), range) ->
490
+ waitForKickDone
491
+ items <- fmap concat $ sequence $ M. elems $ M. mapWithKey (\ fp pr -> do
492
+ p <- openDoc fp " haskell"
493
+ waitForKickDone
494
+ concatMapM (\ ((x, y), range) ->
487
495
Test. prepareCallHierarchy (mkPrepareCallHierarchyParam p x y)
488
496
<&> map (, range)
489
497
) pr) mp
@@ -500,6 +508,7 @@ oneCaseWithCreate :: T.Text -> Int -> Int -> (Uri -> CallHierarchyItem) -> Asser
500
508
oneCaseWithCreate contents queryX queryY expected = withTempDir $ \ dir ->
501
509
runSessionWithServer plugin dir $ do
502
510
doc <- createDoc " A.hs" " haskell" contents
511
+ waitForKickDone
503
512
Test. prepareCallHierarchy (mkPrepareCallHierarchyParam doc queryX queryY) >>=
504
513
\ case
505
514
[item] -> liftIO $ item @?= expected (doc ^. L. uri)
0 commit comments