mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-12 02:58:31 -05:00
Merge from vscode 1ec43773e37997841c5af42b33ddb180e9735bf2
This commit is contained in:
@@ -165,6 +165,10 @@ export class BackupFileService implements IBackupFileService {
|
||||
return this.impl.discardBackup(resource);
|
||||
}
|
||||
|
||||
discardBackups(): Promise<void> {
|
||||
return this.impl.discardBackups();
|
||||
}
|
||||
|
||||
getBackups(): Promise<URI[]> {
|
||||
return this.impl.getBackups();
|
||||
}
|
||||
@@ -260,6 +264,14 @@ class BackupFileServiceImpl extends Disposable implements IBackupFileService {
|
||||
});
|
||||
}
|
||||
|
||||
async discardBackups(): Promise<void> {
|
||||
const model = await this.ready;
|
||||
|
||||
await this.deleteIgnoreFileNotFound(this.backupWorkspacePath);
|
||||
|
||||
model.clear();
|
||||
}
|
||||
|
||||
discardBackup(resource: URI): Promise<void> {
|
||||
const backupResource = this.toBackupResource(resource);
|
||||
|
||||
@@ -429,6 +441,10 @@ export class InMemoryBackupFileService implements IBackupFileService {
|
||||
this.backups.delete(this.toBackupResource(resource).toString());
|
||||
}
|
||||
|
||||
async discardBackups(): Promise<void> {
|
||||
this.backups.clear();
|
||||
}
|
||||
|
||||
toBackupResource(resource: URI): URI {
|
||||
return URI.file(join(resource.scheme, this.hashPath(resource)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user