Skip to content

Commit bffdb6a

Browse files
committed
Replace waitForAllProgressDone with waitForKickDone in resolveRequests for improved test synchronization
1 parent 5384ea7 commit bffdb6a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ghcide-test/exe/ResolveTests.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import Language.LSP.Test hiding (resolveCompletion)
2424
import Test.Hls (IdeState, SMethod (..), liftIO,
2525
mkPluginTestDescriptor,
2626
someMethodToMethodString,
27-
waitForAllProgressDone)
27+
waitForKickDone)
2828
import qualified Test.Hls.FileSystem as FS
2929
import Test.Tasty
3030
import Test.Tasty.HUnit
@@ -100,7 +100,7 @@ resolveRequests =
100100
, "data Foo = Foo { foo :: Int }"
101101
, "bar = Foo 4"
102102
]
103-
waitForAllProgressDone
103+
waitForKickDone
104104
items <- getCompletions doc (Position 2 7)
105105
let resolveCompItems = filter (\i -> "test item" `T.isPrefixOf` (i ^. J.label)) items
106106
liftIO $ assertEqual "There must be exactly two results" 2 (length resolveCompItems)
@@ -113,7 +113,7 @@ resolveRequests =
113113
, "data Foo = Foo { foo :: Int }"
114114
, "bar = Foo 4"
115115
]
116-
waitForAllProgressDone
116+
waitForKickDone
117117
-- Cant use 'getAllCodeActions', as this lsp-test function queries the diagnostic
118118
-- locations and we don't have diagnostics in these tests.
119119
cas <- Maybe.mapMaybe (preview _R) <$> getCodeActions doc (Range (Position 0 0) (Position 1 0))
@@ -128,7 +128,7 @@ resolveRequests =
128128
, "data Foo = Foo { foo :: Int }"
129129
, "bar = Foo 4"
130130
]
131-
waitForAllProgressDone
131+
waitForKickDone
132132
cd <- getCodeLenses doc
133133
let resolveCodeLenses = filter (\i -> case i ^. J.command of
134134
Just cmd -> "test item" `T.isPrefixOf` (cmd ^. J.title)

0 commit comments

Comments
 (0)