mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-01 17:23:35 -05:00
* #3920: Notebooks file save * Missed in merge * #4290: Untitled save and native dirty implementation * Misc changes * Content Manager, notebooks extension and commented failed unit tests * Removing modelLoaded event
This commit is contained in:
@@ -8,19 +8,18 @@
|
||||
import { nb, connection } from 'azdata';
|
||||
|
||||
import { localize } from 'vs/nls';
|
||||
import { Event, Emitter, forEach } from 'vs/base/common/event';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
|
||||
import { CellModel } from './cell';
|
||||
import { IClientSession, INotebookModel, IDefaultConnection, INotebookModelOptions, ICellModel, notebookConstants, NotebookContentChange } from './modelInterfaces';
|
||||
import { NotebookChangeType, CellType, CellTypes } from 'sql/parts/notebook/models/contracts';
|
||||
import { IClientSession, INotebookModel, IDefaultConnection, INotebookModelOptions, ICellModel, NotebookContentChange } from './modelInterfaces';
|
||||
import { NotebookChangeType, CellType } from 'sql/parts/notebook/models/contracts';
|
||||
import { nbversion } from '../notebookConstants';
|
||||
import * as notebookUtils from '../notebookUtils';
|
||||
import { INotebookManager, SQL_NOTEBOOK_PROVIDER, DEFAULT_NOTEBOOK_PROVIDER } from 'sql/workbench/services/notebook/common/notebookService';
|
||||
import { NotebookContexts } from 'sql/parts/notebook/models/notebookContexts';
|
||||
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
|
||||
import { INotification, Severity } from 'vs/platform/notification/common/notification';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { ISingleNotebookEditOperation } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
|
||||
@@ -130,6 +129,7 @@ export class NotebookModel extends Disposable implements INotebookModel {
|
||||
return this._contentChangedEmitter.event;
|
||||
}
|
||||
|
||||
|
||||
public get isSessionReady(): boolean {
|
||||
return !!this._activeClientSession;
|
||||
}
|
||||
@@ -253,10 +253,11 @@ export class NotebookModel extends Disposable implements INotebookModel {
|
||||
try {
|
||||
this._trustedMode = isTrusted;
|
||||
let contents = null;
|
||||
if (this._notebookOptions.notebookUri.scheme !== Schemas.untitled) {
|
||||
// TODO: separate ContentManager from NotebookManager
|
||||
contents = await this.notebookManagers[0].contentManager.getNotebookContents(this._notebookOptions.notebookUri);
|
||||
|
||||
if (this._notebookOptions && this._notebookOptions.contentManager) {
|
||||
contents = await this._notebookOptions.contentManager.loadContent();
|
||||
}
|
||||
|
||||
let factory = this._notebookOptions.factory;
|
||||
// if cells already exist, create them with language info (if it is saved)
|
||||
this._cells = [];
|
||||
|
||||
Reference in New Issue
Block a user