Notebook Views (#13465)

* Add notebook editor

Introduce notebook editor component to allow for separate notebook displays in order to accomodate notebook views

* Localize notebook views configuration title

* Refactor view mode and remove the views configuration while it is unused

* Only fire view mode changed event when the value has been changed

* Remove notebook views contribution
This commit is contained in:
Daniel Grajeda
2020-12-27 14:08:27 -07:00
committed by GitHub
parent f314a9e1e6
commit 11f236ade1
8 changed files with 254 additions and 88 deletions

View File

@@ -5,7 +5,7 @@
import { nb, IConnectionProfile } from 'azdata';
import * as vsEvent from 'vs/base/common/event';
import { INotebookModel, ICellModel, IClientSession, NotebookContentChange, ISingleNotebookEditOperation, MoveDirection } from 'sql/workbench/services/notebook/browser/models/modelInterfaces';
import { INotebookModel, ICellModel, IClientSession, NotebookContentChange, ISingleNotebookEditOperation, MoveDirection, ViewMode } from 'sql/workbench/services/notebook/browser/models/modelInterfaces';
import { INotebookFindModel } from 'sql/workbench/contrib/notebook/browser/models/notebookFindModel';
import { NotebookChangeType, CellType } from 'sql/workbench/services/notebook/common/contracts';
import { INotebookManager, INotebookService, INotebookEditor, ILanguageMagic, INotebookProvider, INavigationProvider, INotebookParams, INotebookSection, ICellEditorProvider, NotebookRange } from 'sql/workbench/services/notebook/browser/notebookService';
@@ -94,6 +94,12 @@ export class NotebookModelStub implements INotebookModel {
findCellIndex(cellModel: ICellModel): number {
throw new Error('Method not implemented.');
}
get viewMode() {
throw new Error('Method not implemented.');
}
set viewMode(mode: ViewMode) {
throw new Error('Method not implemented.');
}
addCell(cellType: CellType, index?: number): void {
throw new Error('Method not implemented.');
}
@@ -439,6 +445,7 @@ export class FutureStub implements nb.IFuture {
export class NotebookComponentStub implements INotebookEditor {
cellEditors: ICellEditorProvider[];
viewMode: string;
deltaDecorations(newDecorationRange: NotebookRange, oldDecorationRange: NotebookRange): void {
throw new Error('Method not implemented.');
}
@@ -651,6 +658,7 @@ export class NotebookEditorStub implements INotebookEditor {
cellEditors: CellEditorProviderStub[];
modelReady: Promise<INotebookModel>;
model: INotebookModel;
viewMode: string;
isDirty(): boolean {
throw new Error('Method not implemented.');
}