Revert hot exit compeletely

Due to issues #14151, #14149 & #14182
This commit is contained in:
Daniel Imms
2016-10-21 12:38:43 -07:00
parent 9381f1facc
commit 9d68196168
31 changed files with 64 additions and 1219 deletions

View File

@@ -28,7 +28,6 @@ export class UntitledEditorInput extends AbstractUntitledEditorInput {
public static SCHEMA: string = 'untitled';
private resource: URI;
private restoreResource: URI;
private hasAssociatedFilePath: boolean;
private modeId: string;
private cachedModel: UntitledEditorModel;
@@ -47,6 +46,7 @@ export class UntitledEditorInput extends AbstractUntitledEditorInput {
@ITextFileService private textFileService: ITextFileService
) {
super();
this.resource = resource;
this.hasAssociatedFilePath = hasAssociatedFilePath;
this.modeId = modeId;
@@ -66,10 +66,6 @@ export class UntitledEditorInput extends AbstractUntitledEditorInput {
return this.resource;
}
public setRestoreResource(resource: URI): void {
this.restoreResource = resource;
}
public getName(): string {
return this.hasAssociatedFilePath ? paths.basename(this.resource.fsPath) : this.resource.fsPath;
}
@@ -134,25 +130,17 @@ export class UntitledEditorInput extends AbstractUntitledEditorInput {
return TPromise.as(this.cachedModel);
}
// Otherwise Create Model and load, restoring from backup if necessary
let restorePromise: TPromise<string>;
if (this.restoreResource) {
restorePromise = this.textFileService.resolveTextContent(this.restoreResource).then(rawTextContent => rawTextContent.value.lines.join('\n'));
} else {
restorePromise = TPromise.as('');
}
// Otherwise Create Model and load
const model = this.createModel();
return model.load().then((resolvedModel: UntitledEditorModel) => {
this.cachedModel = resolvedModel;
return restorePromise.then(content => {
const model = this.createModel(content);
return model.load().then((resolvedModel: UntitledEditorModel) => {
this.cachedModel = resolvedModel;
return this.cachedModel;
});
return this.cachedModel;
});
}
private createModel(content: string): UntitledEditorModel {
private createModel(): UntitledEditorModel {
const content = '';
const model = this.instantiationService.createInstance(UntitledEditorModel, content, this.modeId, this.resource, this.hasAssociatedFilePath);
// re-emit some events from the model