@@ -8,8 +8,8 @@ import type { ElixirLS } from "../../extension";
88import { WorkspaceMode } from "../../project" ;
99import {
1010 getExtension ,
11- sleep ,
1211 waitForLanguageClientManagerUpdate ,
12+ waitForNoLanguageClientManagerUpdate ,
1313 waitForWorkspaceUpdate ,
1414} from "../utils" ;
1515
@@ -180,10 +180,10 @@ suite("Multi root workspace tests", () => {
180180 const fileUri = vscode . Uri . file (
181181 path . join ( fixturesPath , "sample_umbrella" , "apps" , "child2" , "mix.exs" ) ,
182182 ) ;
183- const document = await vscode . workspace . openTextDocument ( fileUri ) ;
184- await vscode . window . showTextDocument ( document ) ;
185-
186- await sleep ( 3000 ) ;
183+ await waitForNoLanguageClientManagerUpdate ( extension , async ( ) => {
184+ const document = await vscode . workspace . openTextDocument ( fileUri ) ;
185+ await vscode . window . showTextDocument ( document ) ;
186+ } ) ;
187187
188188 assert . ok ( ! extension . exports . languageClientManager . defaultClient ) ;
189189 assert . equal ( extension . exports . languageClientManager . clients . size , 2 ) ;
@@ -196,7 +196,7 @@ suite("Multi root workspace tests", () => {
196196 vscode . workspace . updateWorkspaceFolders ( addedWorkspaceFolder . index , 1 ) ;
197197 } ) ;
198198
199- await sleep ( 3000 ) ;
199+ await waitForNoLanguageClientManagerUpdate ( extension , ( ) => { } ) ;
200200
201201 assert . equal ( extension . exports . languageClientManager . clients . size , 2 ) ;
202202 } ) . timeout ( 30000 ) ;
0 commit comments