mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
* #4363: Reopen notebook editors when ADS launched * Code review changes
This commit is contained in:
@@ -28,6 +28,7 @@ import { notebookModeId } from 'sql/common/constants';
|
||||
import { ITextFileService, ISaveOptions } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { LocalContentManager } from 'sql/workbench/services/notebook/node/localContentManager';
|
||||
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
|
||||
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
|
||||
|
||||
export type ModeViewSaveHandler = (handle: number) => Thenable<boolean>;
|
||||
|
||||
@@ -142,6 +143,7 @@ export class NotebookInput extends EditorInput {
|
||||
|
||||
constructor(private _title: string,
|
||||
private resource: URI,
|
||||
private _textInput: UntitledEditorInput,
|
||||
@ITextModelService private textModelService: ITextModelService,
|
||||
@IUntitledEditorService untitledEditorService: IUntitledEditorService,
|
||||
@IInstantiationService private instantiationService: IInstantiationService,
|
||||
@@ -154,6 +156,10 @@ export class NotebookInput extends EditorInput {
|
||||
this.assignProviders();
|
||||
}
|
||||
|
||||
public get textInput(): UntitledEditorInput {
|
||||
return this._textInput;
|
||||
}
|
||||
|
||||
public confirmSave(): TPromise<ConfirmResult> {
|
||||
return this._model.confirmSave();
|
||||
}
|
||||
@@ -258,7 +264,7 @@ export class NotebookInput extends EditorInput {
|
||||
} else {
|
||||
let textOrUntitledEditorModel: UntitledEditorModel | IEditorModel;
|
||||
if (this.resource.scheme === Schemas.untitled) {
|
||||
textOrUntitledEditorModel = await this._untitledEditorService.loadOrCreate({ resource: this.resource, modeId: notebookModeId });
|
||||
textOrUntitledEditorModel = await this._textInput.resolve();
|
||||
}
|
||||
else {
|
||||
const textEditorModelReference = await this.textModelService.createModelReference(this.resource);
|
||||
|
||||
Reference in New Issue
Block a user