@@ -97,10 +97,13 @@ export class LanguageClientManager implements LanguageClient {
9797
9898 private handleClose = ( ) => {
9999 if ( this . isDisposed ( ) ) {
100- return CloseAction . DoNotRestart
100+ return {
101+ action : CloseAction . DoNotRestart
102+ }
103+ }
104+ return {
105+ action : CloseAction . Restart
101106 }
102-
103- return CloseAction . Restart
104107 }
105108
106109 private handleError = ( error : Error ) => {
@@ -110,7 +113,9 @@ export class LanguageClientManager implements LanguageClient {
110113 this . onErrorEmitter . fire ( error )
111114 this . updateStatus ( 'error' )
112115
113- return ErrorAction . Continue
116+ return {
117+ action : ErrorAction . Continue
118+ }
114119 }
115120
116121 public async start ( ) : Promise < void > {
@@ -126,7 +131,7 @@ export class LanguageClientManager implements LanguageClient {
126131 }
127132 }
128133
129- private _start ( ) : void {
134+ private async _start ( ) : Promise < void > {
130135 const onServerResponse = new Emitter < void > ( )
131136
132137 const languageClient = createLanguageClient (
@@ -207,7 +212,7 @@ export class LanguageClientManager implements LanguageClient {
207212 switch ( state . newState ) {
208213 case State . Starting : {
209214 this . updateStatus ( 'connecting' )
210- readyPromise = languageClient . onReady ( ) . then ( async ( ) => {
215+ readyPromise = Promise . resolve ( ) . then ( async ( ) => {
211216 const disposableCollection = new DisposableCollection ( )
212217
213218 let readyPromise : Promise < void >
@@ -261,11 +266,11 @@ export class LanguageClientManager implements LanguageClient {
261266 this . languageClient . registerFeature ( new InitializeTextDocumentFeature ( this ) )
262267 }
263268
264- this . languageClient . start ( )
269+ await this . languageClient . start ( )
265270 }
266271
267- sendNotification < P > ( type : NotificationType < P > , params ?: P ) : void {
268- this . languageClient ! . sendNotification ( type , params )
272+ async sendNotification < P > ( type : NotificationType < P > , params ?: P ) : Promise < void > {
273+ await this . languageClient ! . sendNotification ( type , params )
269274 }
270275
271276 sendRequest < P , R , E > ( type : RequestType < P , R , E > , params : P ) : Promise < R > {
0 commit comments