mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-29 01:25:37 -05:00
Watch for on load event (#12309)
This commit is contained in:
@@ -36,6 +36,7 @@ import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { INotification, INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import * as nls from 'vs/nls';
|
||||
import { NotebookModel } from 'sql/workbench/services/notebook/browser/models/notebookModel';
|
||||
|
||||
export type ModeViewSaveHandler = (handle: number) => Thenable<boolean>;
|
||||
|
||||
@@ -87,6 +88,12 @@ export class NotebookEditorModel extends EditorModel {
|
||||
let dirty = this.textEditorModel instanceof ResourceEditorModel ? false : this.textEditorModel.isDirty();
|
||||
this.setDirty(dirty);
|
||||
}));
|
||||
this._register(this.textEditorModel.onDidLoad(async (e) => {
|
||||
if (this.textEditorModel instanceof TextFileEditorModel) {
|
||||
let model = this.getNotebookModel() as NotebookModel;
|
||||
await model.loadContents(model.trustedMode, true);
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
this._dirty = this.textEditorModel instanceof ResourceEditorModel ? false : this.textEditorModel.isDirty();
|
||||
|
||||
Reference in New Issue
Block a user