@@ -510,28 +510,28 @@ export function activate(context: ExtensionContext): VSNetBeansAPI {
510
510
511
511
context . subscriptions . push ( vscode . commands . registerCommand ( COMMAND_PREFIX + ".delete.cache" , async ( ) => {
512
512
const storagePath = context . storageUri ?. fsPath ;
513
- if ( ! storagePath ) {
513
+ if ( ! storagePath ) {
514
514
vscode . window . showErrorMessage ( 'Cannot find workspace path' ) ;
515
515
return ;
516
516
}
517
-
517
+
518
518
const userDir = path . join ( storagePath , "userdir" ) ;
519
519
if ( userDir && fs . existsSync ( userDir ) ) {
520
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
- try {
524
- await stopClient ( client ) ;
525
- deactivated = true ;
526
- await killNbProcess ( false , log ) ;
527
- await fs . promises . rmdir ( userDir , { recursive : true } ) ;
528
- await vscode . window . showInformationMessage ( "Cache deleted successfully" , 'Reload window' ) ;
529
- } catch ( err ) {
530
- await vscode . window . showErrorMessage ( 'Error deleting the cache' , 'Reload window' ) ;
531
- } finally {
532
- vscode . commands . executeCommand ( "workbench.action.reloadWindow" ) ;
533
- }
523
+ try {
524
+ await stopClient ( client ) ;
525
+ deactivated = true ;
526
+ await killNbProcess ( false , log ) ;
527
+ await fs . promises . rmdir ( userDir , { recursive : true } ) ;
528
+ await vscode . window . showInformationMessage ( "Cache deleted successfully" , 'Reload window' ) ;
529
+ } catch ( err ) {
530
+ await vscode . window . showErrorMessage ( 'Error deleting the cache' , 'Reload window' ) ;
531
+ } finally {
532
+ vscode . commands . executeCommand ( "workbench.action.reloadWindow" ) ;
534
533
}
534
+ }
535
535
} else {
536
536
vscode . window . showErrorMessage ( 'Cannot find userdir path' ) ;
537
537
}
0 commit comments