Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 (#7206)

* Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463

* fix config changes

* fix strictnull checks
This commit is contained in:
Anthony Dresser
2019-09-15 22:38:26 -07:00
committed by GitHub
parent fa6c52699e
commit ea0f9e6ce9
1226 changed files with 21541 additions and 17633 deletions

View File

@@ -19,7 +19,6 @@ import { Schemas } from 'vs/base/common/network';
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
import { VSBuffer } from 'vs/base/common/buffer';
import { TextSnapshotReadable } from 'vs/workbench/services/textfile/common/textfiles';
import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
export interface IBackupFilesModel {
resolve(backupRoot: URI): Promise<IBackupFilesModel>;
@@ -106,7 +105,7 @@ export class BackupFilesModel implements IBackupFilesModel {
export class BackupFileService implements IBackupFileService {
_serviceBrand!: ServiceIdentifier<IBackupFileService>;
_serviceBrand: undefined;
private impl: IBackupFileService;
@@ -114,7 +113,7 @@ export class BackupFileService implements IBackupFileService {
@IWorkbenchEnvironmentService private environmentService: IWorkbenchEnvironmentService,
@IFileService protected fileService: IFileService
) {
this.initialize();
this.impl = this.initialize();
}
protected hashPath(resource: URI): string {
@@ -123,13 +122,13 @@ export class BackupFileService implements IBackupFileService {
return hash(str).toString(16);
}
private initialize(): void {
private initialize(): IBackupFileService {
const backupWorkspaceResource = this.environmentService.configuration.backupWorkspaceResource;
if (backupWorkspaceResource) {
this.impl = new BackupFileServiceImpl(backupWorkspaceResource, this.hashPath, this.fileService);
} else {
this.impl = new InMemoryBackupFileService(this.hashPath);
return new BackupFileServiceImpl(backupWorkspaceResource, this.hashPath, this.fileService);
}
return new InMemoryBackupFileService(this.hashPath);
}
reinitialize(): void {
@@ -188,7 +187,7 @@ class BackupFileServiceImpl implements IBackupFileService {
private static readonly PREAMBLE_META_SEPARATOR = ' '; // using a character that is know to be escaped in a URI as separator
private static readonly PREAMBLE_MAX_LENGTH = 10000;
_serviceBrand!: ServiceIdentifier<IBackupFileService>;
_serviceBrand: undefined;
private backupWorkspacePath!: URI;
@@ -398,7 +397,7 @@ class BackupFileServiceImpl implements IBackupFileService {
export class InMemoryBackupFileService implements IBackupFileService {
_serviceBrand!: ServiceIdentifier<IBackupFileService>;
_serviceBrand: undefined;
private backups: Map<string, ITextSnapshot> = new Map();