diff --git a/src/vs/code/electron-main/windows.ts b/src/vs/code/electron-main/windows.ts index 9f033a30534..15056fd45fb 100644 --- a/src/vs/code/electron-main/windows.ts +++ b/src/vs/code/electron-main/windows.ts @@ -607,7 +607,6 @@ export class WindowsManager implements IWindowsService { // Add any existing backup workspaces if (openConfig.restoreBackups) { - // TODO: Ensure the workspaces being added actually have backups this.backupService.getWorkspaceBackupPaths().forEach(ws => { iPathsToOpen.push(this.toIPath(ws)); }); @@ -746,7 +745,6 @@ export class WindowsManager implements IWindowsService { iPathsToOpen.forEach(iPath => this.eventEmitter.emit(EventTypes.OPEN, iPath)); // Add to backups - console.log('iPathsToOpen', iPathsToOpen); this.backupService.pushWorkspaceBackupPaths(iPathsToOpen.map((path) => { return path.workspacePath; })); diff --git a/src/vs/platform/backup/node/backupService.ts b/src/vs/platform/backup/node/backupService.ts index 077015009fc..a7760211d4b 100644 --- a/src/vs/platform/backup/node/backupService.ts +++ b/src/vs/platform/backup/node/backupService.ts @@ -37,7 +37,7 @@ export class BackupService implements IBackupService { public getWorkspaceBackupPaths(): string[] { this.load(); - return Object.keys(this.fileContent.folderWorkspaces || Object.create(null)); + return Object.keys(this.fileContent.folderWorkspaces); } public clearWorkspaceBackupPaths(): void { @@ -84,11 +84,8 @@ export class BackupService implements IBackupService { const workspaceHash = crypto.createHash('md5').update(this.workspaceResource.fsPath).digest('hex'); const untitledDir = path.join(this.environmentService.backupHome, workspaceHash, 'untitled'); try { - const untitledFiles = fs.readdirSync(untitledDir).map(file => path.join(untitledDir, file)); - console.log('untitledFiles', untitledFiles); - return untitledFiles; + return fs.readdirSync(untitledDir).map(file => path.join(untitledDir, file)); } catch (ex) { - console.log('untitled backups do not exist'); return []; } } @@ -102,7 +99,6 @@ export class BackupService implements IBackupService { const workspaceHash = crypto.createHash('md5').update(this.workspaceResource.fsPath).digest('hex'); const backupName = crypto.createHash('md5').update(resource.fsPath).digest('hex'); const backupPath = path.join(this.environmentService.backupHome, workspaceHash, resource.scheme, backupName); - console.log('getBackupResource ' + Uri.file(backupPath)); return Uri.file(backupPath); } diff --git a/src/vs/workbench/common/editor/untitledEditorModel.ts b/src/vs/workbench/common/editor/untitledEditorModel.ts index 454167b3d76..df1f5fc2590 100644 --- a/src/vs/workbench/common/editor/untitledEditorModel.ts +++ b/src/vs/workbench/common/editor/untitledEditorModel.ts @@ -163,10 +163,8 @@ export class UntitledEditorModel extends StringEditorModel implements IEncodingS if (this.fileService.isHotExitEnabled()) { if (this.dirty) { - console.log('backup'); this.doBackup(); } else { - console.log('discard'); this.fileService.discardBackup(this.resource); } } @@ -189,7 +187,6 @@ export class UntitledEditorModel extends StringEditorModel implements IEncodingS this._onDidChangeEncoding.dispose(); this.cancelBackupPromises(); - console.log('discard'); this.fileService.discardBackup(this.resource); } diff --git a/src/vs/workbench/electron-browser/main.ts b/src/vs/workbench/electron-browser/main.ts index 1abe08d931b..f94821cb5a8 100644 --- a/src/vs/workbench/electron-browser/main.ts +++ b/src/vs/workbench/electron-browser/main.ts @@ -48,7 +48,6 @@ export function startup(configuration: IWindowConfiguration): TPromise { const filesToOpen = configuration.filesToOpen && configuration.filesToOpen.length ? toInputs(configuration.filesToOpen) : null; const filesToCreate = configuration.filesToCreate && configuration.filesToCreate.length ? toInputs(configuration.filesToCreate) : null; const filesToDiff = configuration.filesToDiff && configuration.filesToDiff.length ? toInputs(configuration.filesToDiff) : null; - const shellOptions: IOptions = { filesToOpen, filesToCreate, diff --git a/src/vs/workbench/parts/files/electron-browser/dirtyFilesTracker.ts b/src/vs/workbench/parts/files/electron-browser/dirtyFilesTracker.ts index 23a6d5b33b7..47a3caccbc8 100644 --- a/src/vs/workbench/parts/files/electron-browser/dirtyFilesTracker.ts +++ b/src/vs/workbench/parts/files/electron-browser/dirtyFilesTracker.ts @@ -78,7 +78,6 @@ export class DirtyFilesTracker implements IWorkbenchContribution { } private onTextFileDirty(e: TextFileModelChangeEvent): void { - if ((this.textFileService.getAutoSaveMode() !== AutoSaveMode.AFTER_SHORT_DELAY) && !this.isDocumentedEdited) { this.updateDocumentEdited(); // no indication needed when auto save is enabled for short delay } diff --git a/src/vs/workbench/services/files/node/fileService.ts b/src/vs/workbench/services/files/node/fileService.ts index f3e1da90faa..0cf572d7513 100644 --- a/src/vs/workbench/services/files/node/fileService.ts +++ b/src/vs/workbench/services/files/node/fileService.ts @@ -469,7 +469,6 @@ export class FileService implements IFileService { return TPromise.as(null); } - console.log(`Backing up to ${backupResource.fsPath}`); return this.updateContent(backupResource, content); } diff --git a/src/vs/workbench/services/textfile/common/textFileEditorModel.ts b/src/vs/workbench/services/textfile/common/textFileEditorModel.ts index e0a68abbce3..ac651f021a1 100644 --- a/src/vs/workbench/services/textfile/common/textFileEditorModel.ts +++ b/src/vs/workbench/services/textfile/common/textFileEditorModel.ts @@ -189,7 +189,6 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil public load(force?: boolean /* bypass any caches and really go to disk */): TPromise { diag('load() - enter', this.resource, new Date()); - console.log(`load model ${this.resource.fsPath}`); // It is very important to not reload the model when the model is dirty. We only want to reload the model from the disk // if no save is pending to avoid data loss. This might cause a save conflict in case the file has been modified on the disk @@ -267,7 +266,6 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil if (this.restoreResource) { // TODO: De-duplicate code - console.log(`Attempting to restore resource ${this.restoreResource.fsPath}`); this.createTextEditorModelPromise = this.textFileService.resolveTextContent(this.restoreResource, { acceptTextOnly: true, etag: etag, encoding: this.preferredEncoding }).then((restoreContent) => { return this.createTextEditorModel(restoreContent.value, content.resource).then(() => { this.createTextEditorModelPromise = null; @@ -347,7 +345,6 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil } if (this.fileService.isHotExitEnabled()) { - console.log('discard'); this.fileService.discardBackup(this.resource); } @@ -369,7 +366,6 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil } if (this.fileService.isHotExitEnabled()) { - console.log('backup'); this.doBackup(); } } @@ -794,7 +790,6 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil this.cancelAutoSavePromises(); this.cancelBackupPromises(); - console.log('discard'); this.fileService.discardBackup(this.resource); super.dispose();