@@ -17,7 +17,7 @@ const suffix = ' failure or so.';
1717export class TraceServer {
1818 private server : ChildProcess | undefined ;
1919
20- private start ( context : vscode . ExtensionContext | undefined ) {
20+ private async start ( context : vscode . ExtensionContext | undefined ) {
2121 const from = this . getSettings ( ) ;
2222 const server = spawn ( this . getPath ( from ) , this . getArgs ( from ) ) ;
2323
@@ -26,8 +26,8 @@ export class TraceServer {
2626 return ;
2727 }
2828 this . server = server ;
29- context ?. workspaceState . update ( key , this . server . pid ) ;
30- this . waitFor ( context ) ;
29+ await context ?. workspaceState . update ( key , this . server . pid ) ;
30+ await this . waitFor ( context ) ;
3131 }
3232
3333 async stopOrReset ( context : vscode . ExtensionContext | undefined ) {
@@ -46,7 +46,7 @@ export class TraceServer {
4646 clearTimeout ( id ) ;
4747 } ) ;
4848 }
49- vscode . window . withProgress (
49+ await vscode . window . withProgress (
5050 {
5151 location : vscode . ProgressLocation . Notification ,
5252 title : prefix ,
@@ -67,7 +67,7 @@ export class TraceServer {
6767 } else {
6868 vscode . window . showWarningMessage ( not ) ;
6969 }
70- context ?. workspaceState . update ( key , none ) ;
70+ await context ?. workspaceState . update ( key , none ) ;
7171 this . server = undefined ;
7272 }
7373
@@ -77,14 +77,14 @@ export class TraceServer {
7777 const foreigner = await this . isUp ( ) ;
7878
7979 if ( stopped && ! foreigner ) {
80- this . start ( context ) ;
80+ await this . start ( context ) ;
8181 } else if ( foreigner ) {
8282 vscode . window . showWarningMessage ( prefix + ' not started as already running.' ) ;
8383 } else {
8484 // Not UP but there is still a pid stored.
8585 // Likely because Codium or so exited without one using the stop command prior.
86- context ?. workspaceState . update ( key , none ) ;
87- this . start ( context ) ;
86+ await context ?. workspaceState . update ( key , none ) ;
87+ await this . start ( context ) ;
8888 }
8989 }
9090
@@ -139,7 +139,7 @@ export class TraceServer {
139139 }
140140
141141 private async waitFor ( context : vscode . ExtensionContext | undefined ) {
142- vscode . window . withProgress (
142+ await vscode . window . withProgress (
143143 {
144144 location : vscode . ProgressLocation . Notification ,
145145 title : prefix ,
@@ -159,7 +159,7 @@ export class TraceServer {
159159 }
160160 if ( timeout ) {
161161 this . showError ( prefix + ' startup timed-out after ' + millis + 'ms.' ) ;
162- this . stopOrReset ( context ) ;
162+ await this . stopOrReset ( context ) ;
163163 break ;
164164 }
165165 }
0 commit comments