Skip to content

Commit a002932

Browse files
committed
Clean up pass
1 parent 9d4ec99 commit a002932

7 files changed

Lines changed: 2 additions & 19 deletions

File tree

src/vs/code/electron-main/windows.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,6 @@ export class WindowsManager implements IWindowsService {
607607

608608
// Add any existing backup workspaces
609609
if (openConfig.restoreBackups) {
610-
// TODO: Ensure the workspaces being added actually have backups
611610
this.backupService.getWorkspaceBackupPaths().forEach(ws => {
612611
iPathsToOpen.push(this.toIPath(ws));
613612
});
@@ -746,7 +745,6 @@ export class WindowsManager implements IWindowsService {
746745
iPathsToOpen.forEach(iPath => this.eventEmitter.emit(EventTypes.OPEN, iPath));
747746

748747
// Add to backups
749-
console.log('iPathsToOpen', iPathsToOpen);
750748
this.backupService.pushWorkspaceBackupPaths(iPathsToOpen.map((path) => {
751749
return path.workspacePath;
752750
}));

src/vs/platform/backup/node/backupService.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class BackupService implements IBackupService {
3737

3838
public getWorkspaceBackupPaths(): string[] {
3939
this.load();
40-
return Object.keys(this.fileContent.folderWorkspaces || Object.create(null));
40+
return Object.keys(this.fileContent.folderWorkspaces);
4141
}
4242

4343
public clearWorkspaceBackupPaths(): void {
@@ -84,11 +84,8 @@ export class BackupService implements IBackupService {
8484
const workspaceHash = crypto.createHash('md5').update(this.workspaceResource.fsPath).digest('hex');
8585
const untitledDir = path.join(this.environmentService.backupHome, workspaceHash, 'untitled');
8686
try {
87-
const untitledFiles = fs.readdirSync(untitledDir).map(file => path.join(untitledDir, file));
88-
console.log('untitledFiles', untitledFiles);
89-
return untitledFiles;
87+
return fs.readdirSync(untitledDir).map(file => path.join(untitledDir, file));
9088
} catch (ex) {
91-
console.log('untitled backups do not exist');
9289
return [];
9390
}
9491
}
@@ -102,7 +99,6 @@ export class BackupService implements IBackupService {
10299
const workspaceHash = crypto.createHash('md5').update(this.workspaceResource.fsPath).digest('hex');
103100
const backupName = crypto.createHash('md5').update(resource.fsPath).digest('hex');
104101
const backupPath = path.join(this.environmentService.backupHome, workspaceHash, resource.scheme, backupName);
105-
console.log('getBackupResource ' + Uri.file(backupPath));
106102
return Uri.file(backupPath);
107103
}
108104

src/vs/workbench/common/editor/untitledEditorModel.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,8 @@ export class UntitledEditorModel extends StringEditorModel implements IEncodingS
163163

164164
if (this.fileService.isHotExitEnabled()) {
165165
if (this.dirty) {
166-
console.log('backup');
167166
this.doBackup();
168167
} else {
169-
console.log('discard');
170168
this.fileService.discardBackup(this.resource);
171169
}
172170
}
@@ -189,7 +187,6 @@ export class UntitledEditorModel extends StringEditorModel implements IEncodingS
189187
this._onDidChangeEncoding.dispose();
190188

191189
this.cancelBackupPromises();
192-
console.log('discard');
193190
this.fileService.discardBackup(this.resource);
194191
}
195192

src/vs/workbench/electron-browser/main.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ export function startup(configuration: IWindowConfiguration): TPromise<void> {
4848
const filesToOpen = configuration.filesToOpen && configuration.filesToOpen.length ? toInputs(configuration.filesToOpen) : null;
4949
const filesToCreate = configuration.filesToCreate && configuration.filesToCreate.length ? toInputs(configuration.filesToCreate) : null;
5050
const filesToDiff = configuration.filesToDiff && configuration.filesToDiff.length ? toInputs(configuration.filesToDiff) : null;
51-
5251
const shellOptions: IOptions = {
5352
filesToOpen,
5453
filesToCreate,

src/vs/workbench/parts/files/electron-browser/dirtyFilesTracker.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ export class DirtyFilesTracker implements IWorkbenchContribution {
7878
}
7979

8080
private onTextFileDirty(e: TextFileModelChangeEvent): void {
81-
8281
if ((this.textFileService.getAutoSaveMode() !== AutoSaveMode.AFTER_SHORT_DELAY) && !this.isDocumentedEdited) {
8382
this.updateDocumentEdited(); // no indication needed when auto save is enabled for short delay
8483
}

src/vs/workbench/services/files/node/fileService.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,6 @@ export class FileService implements IFileService {
469469
return TPromise.as(null);
470470
}
471471

472-
console.log(`Backing up to ${backupResource.fsPath}`);
473472
return this.updateContent(backupResource, content);
474473
}
475474

src/vs/workbench/services/textfile/common/textFileEditorModel.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
189189

190190
public load(force?: boolean /* bypass any caches and really go to disk */): TPromise<EditorModel> {
191191
diag('load() - enter', this.resource, new Date());
192-
console.log(`load model ${this.resource.fsPath}`);
193192

194193
// It is very important to not reload the model when the model is dirty. We only want to reload the model from the disk
195194
// 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
267266

268267
if (this.restoreResource) {
269268
// TODO: De-duplicate code
270-
console.log(`Attempting to restore resource ${this.restoreResource.fsPath}`);
271269
this.createTextEditorModelPromise = this.textFileService.resolveTextContent(this.restoreResource, { acceptTextOnly: true, etag: etag, encoding: this.preferredEncoding }).then((restoreContent) => {
272270
return this.createTextEditorModel(restoreContent.value, content.resource).then(() => {
273271
this.createTextEditorModelPromise = null;
@@ -347,7 +345,6 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
347345
}
348346

349347
if (this.fileService.isHotExitEnabled()) {
350-
console.log('discard');
351348
this.fileService.discardBackup(this.resource);
352349
}
353350

@@ -369,7 +366,6 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
369366
}
370367

371368
if (this.fileService.isHotExitEnabled()) {
372-
console.log('backup');
373369
this.doBackup();
374370
}
375371
}
@@ -794,7 +790,6 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
794790
this.cancelAutoSavePromises();
795791
this.cancelBackupPromises();
796792

797-
console.log('discard');
798793
this.fileService.discardBackup(this.resource);
799794

800795
super.dispose();

0 commit comments

Comments
 (0)