File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
plugins/hls-tactics-plugin/test Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ module Test.Hls
19
19
runSessionWithServerFormatter ,
20
20
runSessionWithServer' ,
21
21
waitForProgressDone ,
22
+ waitForAllProgressDone ,
22
23
PluginDescriptor ,
23
24
IdeState ,
24
25
)
@@ -195,3 +196,15 @@ waitForProgressDone = loop
195
196
_ -> Nothing
196
197
done <- null <$> getIncompleteProgressSessions
197
198
unless done loop
199
+
200
+ -- | Wait for all progress to be done
201
+ -- Needs at least one progress done notification to return
202
+ waitForAllProgressDone :: Session ()
203
+ waitForAllProgressDone = loop
204
+ where
205
+ loop = do
206
+ ~ () <- skipManyTill anyMessage $ satisfyMaybe $ \ case
207
+ FromServerMess SProgress (NotificationMessage _ _ (ProgressParams _ (End _))) -> Just ()
208
+ _ -> Nothing
209
+ done <- null <$> getIncompleteProgressSessions
210
+ unless done loop
Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ mkTest name fp line col ts = it name $ do
85
85
runSessionForTactics $ do
86
86
doc <- openDoc (fp <.> " hs" ) " haskell"
87
87
_ <- waitForDiagnostics
88
+ waitForAllProgressDone
88
89
actions <- getCodeActions doc $ pointRange line col
89
90
let titles = mapMaybe codeActionTitle actions
90
91
for_ ts $ \ (f, tc, var) -> do
You can’t perform that action at this time.
0 commit comments