#4565: Open notebook from Dashboard - can't close dirty notebook (#4568)

* #4565:"Don't save" doesn't close editor -Dashboard

* Misc change
This commit is contained in:
Raj
2019-03-17 08:03:43 -07:00
committed by Chris LaFreniere
parent b9d0602f55
commit 25b1d4b673

View File

@@ -32,7 +32,6 @@ import { NotebookChangeType, CellTypes } from 'sql/parts/notebook/models/contrac
import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilitiesService';
import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService';
import { notebookModeId } from 'sql/common/constants';
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
class MainThreadNotebookEditor extends Disposable {
private _contentChangedEmitter = new Emitter<NotebookContentChange>();
@@ -371,7 +370,8 @@ export class MainThreadNotebookDocumentsAndEditors extends Disposable implements
};
let isUntitled: boolean = uri.scheme === Schemas.untitled;
const fileInput: UntitledEditorInput = isUntitled ? this._untitledEditorService.createOrGet(uri, notebookModeId) : undefined;
const fileInput = isUntitled ? this._untitledEditorService.createOrGet(uri, notebookModeId) :
this._editorService.createInput({resource: uri, language: notebookModeId});
let input = this._instantiationService.createInstance(NotebookInput, path.basename(uri.fsPath), uri, fileInput);
input.isTrusted = isUntitled;
input.defaultKernel = options.defaultKernel;