@@ -78,7 +78,7 @@ let nbProcess : ChildProcess | null = null;
78
78
let debugPort : number = - 1 ;
79
79
let debugHash : string | undefined ;
80
80
let consoleLog : boolean = ! ! process . env [ 'ENABLE_CONSOLE_LOG' ] ;
81
- let deactivated = false ;
81
+ let deactivated : boolean = true ;
82
82
export class NbLanguageClient extends LanguageClient {
83
83
private _treeViewService : TreeViewService ;
84
84
@@ -327,8 +327,8 @@ class InitialPromise extends Promise<NbLanguageClient> {
327
327
}
328
328
329
329
export function activate ( context : ExtensionContext ) : VSNetBeansAPI {
330
+ deactivated = false ;
330
331
let log = vscode . window . createOutputChannel ( SERVER_NAME ) ;
331
- deactivated = false ;
332
332
var clientResolve : ( x : NbLanguageClient ) => void ;
333
333
var clientReject : ( err : any ) => void ;
334
334
@@ -517,14 +517,16 @@ export function activate(context: ExtensionContext): VSNetBeansAPI {
517
517
518
518
const userDir = path . join ( storagePath , "userdir" ) ;
519
519
if ( userDir && fs . existsSync ( userDir ) ) {
520
- const confirmation = await vscode . window . showInformationMessage ( 'Are you sure you want to delete cache for this workspace and reload the window?' ,
520
+ const confirmation = await vscode . window . showInformationMessage ( 'Are you sure you want to delete cache for this workspace and reload the window ?' ,
521
521
'Yes' , 'Cancel' ) ;
522
522
if ( confirmation === 'Yes' ) {
523
- stopClient ( client ) . then ( ( ) => killNbProcess ( false , log ) ) . then ( ( ) => {
524
- fs . promises . rmdir ( userDir , { recursive : true } ) ;
525
- vscode . commands . executeCommand ( 'workbench.action.reloadWindow' )
526
- } ) ;
527
- }
523
+ stopClient ( client ) . then ( ( ) => { deactivated = true ;
524
+ return killNbProcess ( false , log ) ; } )
525
+ . then ( ( ) => fs . promises . rmdir ( userDir , { recursive : true } ) )
526
+ . then ( ( ) => vscode . window . showInformationMessage ( "Cache deleted successfully" , 'Reload window' ) ,
527
+ ( err ) => vscode . window . showErrorMessage ( 'Error deleting the cache' , 'Reload window' ) )
528
+ . then ( ( ) => { vscode . commands . executeCommand ( "workbench.action.reloadWindow" ) } ) ;
529
+ }
528
530
} else {
529
531
vscode . window . showErrorMessage ( 'Cannot find userdir path' ) ;
530
532
}
@@ -1422,7 +1424,6 @@ function stopClient(clientPromise: Promise<LanguageClient>): Thenable<void> {
1422
1424
}
1423
1425
1424
1426
export function deactivate ( ) : Thenable < void > {
1425
- deactivated = true ;
1426
1427
if ( nbProcess != null ) {
1427
1428
nbProcess . kill ( ) ;
1428
1429
}
0 commit comments