@@ -559,7 +559,7 @@ export interface Client {
559559 handleConfigurationEditUICommand ( ) : void ;
560560 handleAddToIncludePathCommand ( path : string ) : void ;
561561 onInterval ( ) : void ;
562- dispose ( ) : Thenable < void > ;
562+ dispose ( ) : void ;
563563 addFileAssociations ( fileAssociations : string , is_c : boolean ) : void ;
564564 sendDidChangeSettings ( settings : any ) : void ;
565565}
@@ -3102,33 +3102,34 @@ export class DefaultClient implements Client {
31023102 }
31033103 }
31043104
3105- public dispose ( ) : Thenable < void > {
3106- const promise : Thenable < void > = ( this . languageClient && clientCollection . Count === 0 ) ? this . languageClient . stop ( ) : Promise . resolve ( ) ;
3107- return promise . then ( ( ) => {
3108- this . disposables . forEach ( ( d ) => d . dispose ( ) ) ;
3109- this . disposables = [ ] ;
3110- if ( this . documentFormattingProviderDisposable ) {
3111- this . documentFormattingProviderDisposable . dispose ( ) ;
3112- this . documentFormattingProviderDisposable = undefined ;
3113- }
3114- if ( this . formattingRangeProviderDisposable ) {
3115- this . formattingRangeProviderDisposable . dispose ( ) ;
3116- this . formattingRangeProviderDisposable = undefined ;
3117- }
3118- if ( this . onTypeFormattingProviderDisposable ) {
3119- this . onTypeFormattingProviderDisposable . dispose ( ) ;
3120- this . onTypeFormattingProviderDisposable = undefined ;
3121- }
3122- if ( this . codeFoldingProviderDisposable ) {
3123- this . codeFoldingProviderDisposable . dispose ( ) ;
3124- this . codeFoldingProviderDisposable = undefined ;
3125- }
3126- if ( this . semanticTokensProviderDisposable ) {
3127- this . semanticTokensProviderDisposable . dispose ( ) ;
3128- this . semanticTokensProviderDisposable = undefined ;
3129- }
3130- this . model . dispose ( ) ;
3131- } ) ;
3105+ public dispose ( ) : void {
3106+ this . disposables . forEach ( ( d ) => d . dispose ( ) ) ;
3107+ this . disposables = [ ] ;
3108+ if ( this . documentFormattingProviderDisposable ) {
3109+ this . documentFormattingProviderDisposable . dispose ( ) ;
3110+ this . documentFormattingProviderDisposable = undefined ;
3111+ }
3112+ if ( this . formattingRangeProviderDisposable ) {
3113+ this . formattingRangeProviderDisposable . dispose ( ) ;
3114+ this . formattingRangeProviderDisposable = undefined ;
3115+ }
3116+ if ( this . onTypeFormattingProviderDisposable ) {
3117+ this . onTypeFormattingProviderDisposable . dispose ( ) ;
3118+ this . onTypeFormattingProviderDisposable = undefined ;
3119+ }
3120+ if ( this . codeFoldingProviderDisposable ) {
3121+ this . codeFoldingProviderDisposable . dispose ( ) ;
3122+ this . codeFoldingProviderDisposable = undefined ;
3123+ }
3124+ if ( this . semanticTokensProviderDisposable ) {
3125+ this . semanticTokensProviderDisposable . dispose ( ) ;
3126+ this . semanticTokensProviderDisposable = undefined ;
3127+ }
3128+ this . model . dispose ( ) ;
3129+ }
3130+
3131+ public static stopLanguageClient ( ) : Thenable < void > {
3132+ return languageClient ? languageClient . stop ( ) : Promise . resolve ( ) ;
31323133 }
31333134
31343135 public handleReferencesIcon ( ) : void {
@@ -3254,10 +3255,9 @@ class NullClient implements Client {
32543255 handleConfigurationEditUICommand ( ) : void { }
32553256 handleAddToIncludePathCommand ( path : string ) : void { }
32563257 onInterval ( ) : void { }
3257- dispose ( ) : Thenable < void > {
3258+ dispose ( ) : void {
32583259 this . booleanEvent . dispose ( ) ;
32593260 this . stringEvent . dispose ( ) ;
3260- return Promise . resolve ( ) ;
32613261 }
32623262 addFileAssociations ( fileAssociations : string , is_c : boolean ) : void { }
32633263 sendDidChangeSettings ( settings : any ) : void { }
0 commit comments