diff --git a/build/gulpfile.hygiene.js b/build/gulpfile.hygiene.js index f04f3bf518..b9e07473e6 100644 --- a/build/gulpfile.hygiene.js +++ b/build/gulpfile.hygiene.js @@ -136,17 +136,17 @@ const copyrightFilter = [ '!src/sql/workbench/parts/notebook/common/models/renderMimeInterfaces.ts', '!src/sql/workbench/parts/notebook/common/models/outputProcessor.ts', '!src/sql/workbench/parts/notebook/common/models/mimemodel.ts', - '!src/sql/workbench/parts/notebook/electron-browser/cellViews/media/*.css', + '!src/sql/workbench/parts/notebook/browser/cellViews/media/*.css', '!src/sql/base/browser/ui/table/plugins/rowSelectionModel.plugin.ts', '!src/sql/base/browser/ui/table/plugins/rowDetailView.ts', '!src/sql/base/browser/ui/table/plugins/headerFilter.plugin.ts', '!src/sql/base/browser/ui/table/plugins/checkboxSelectColumn.plugin.ts', '!src/sql/base/browser/ui/table/plugins/cellSelectionModel.plugin.ts', '!src/sql/base/browser/ui/table/plugins/autoSizeColumns.plugin.ts', - '!src/sql/workbench/parts/notebook/electron-browser/outputs/sanitizer.ts', - '!src/sql/workbench/parts/notebook/electron-browser/outputs/renderers.ts', - '!src/sql/workbench/parts/notebook/electron-browser/outputs/registry.ts', - '!src/sql/workbench/parts/notebook/electron-browser/outputs/factories.ts', + '!src/sql/workbench/parts/notebook/browser/outputs/sanitizer.ts', + '!src/sql/workbench/parts/notebook/browser/outputs/renderers.ts', + '!src/sql/workbench/parts/notebook/browser/outputs/registry.ts', + '!src/sql/workbench/parts/notebook/browser/outputs/factories.ts', '!src/sql/workbench/parts/notebook/common/models/nbformat.ts', '!extensions/markdown-language-features/media/tomorrow.css', '!src/sql/workbench/browser/modelComponents/media/highlight.css', diff --git a/src/sql/workbench/api/browser/mainThreadNotebook.ts b/src/sql/workbench/api/browser/mainThreadNotebook.ts index 393cb66d4a..4a504e72b6 100644 --- a/src/sql/workbench/api/browser/mainThreadNotebook.ts +++ b/src/sql/workbench/api/browser/mainThreadNotebook.ts @@ -13,9 +13,10 @@ import { URI } from 'vs/base/common/uri'; import { INotebookService, INotebookProvider, INotebookManager } from 'sql/workbench/services/notebook/common/notebookService'; import { INotebookManagerDetails, INotebookSessionDetails, INotebookKernelDetails, FutureMessageType, INotebookFutureDetails, INotebookFutureDone } from 'sql/workbench/api/common/sqlExtHostTypes'; -import { LocalContentManager } from 'sql/workbench/services/notebook/node/localContentManager'; +import { LocalContentManager } from 'sql/workbench/services/notebook/common/localContentManager'; import { Deferred } from 'sql/base/common/promise'; -import { FutureInternal } from 'sql/workbench/parts/notebook/node/models/modelInterfaces'; +import { FutureInternal } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; +import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @extHostNamedCustomer(SqlMainContext.MainThreadNotebook) export class MainThreadNotebook extends Disposable implements MainThreadNotebookShape { @@ -26,7 +27,8 @@ export class MainThreadNotebook extends Disposable implements MainThreadNotebook constructor( extHostContext: IExtHostContext, - @INotebookService private notebookService: INotebookService + @INotebookService private notebookService: INotebookService, + @IInstantiationService private readonly instantiationService: IInstantiationService ) { super(); if (extHostContext) { @@ -48,7 +50,7 @@ export class MainThreadNotebook extends Disposable implements MainThreadNotebook main: this, ext: this._proxy }; - let notebookProvider = new NotebookProviderWrapper(proxy, providerId, handle); + let notebookProvider = this.instantiationService.createInstance(NotebookProviderWrapper, proxy, providerId, handle); this._providers.set(handle, notebookProvider); this.notebookService.registerProvider(providerId, notebookProvider); } @@ -87,7 +89,12 @@ interface Proxies { class NotebookProviderWrapper extends Disposable implements INotebookProvider { private _notebookUriToManagerMap = new Map(); - constructor(private _proxy: Proxies, public readonly providerId, public readonly providerHandle: number) { + constructor( + private _proxy: Proxies, + public readonly providerId, + public readonly providerHandle: number, + @IInstantiationService private readonly instantiationService: IInstantiationService + ) { super(); } @@ -100,7 +107,7 @@ class NotebookProviderWrapper extends Disposable implements INotebookProvider { let uriString = notebookUri.toString(); let manager = this._notebookUriToManagerMap.get(uriString); if (!manager) { - manager = new NotebookManagerWrapper(this._proxy, this.providerId, notebookUri); + manager = this.instantiationService.createInstance(NotebookManagerWrapper, this._proxy, this.providerId, notebookUri); await manager.initialize(this.providerHandle); this._notebookUriToManagerMap.set(uriString, manager); } @@ -121,13 +128,14 @@ class NotebookManagerWrapper implements INotebookManager { constructor(private _proxy: Proxies, public readonly providerId, - private notebookUri: URI + private notebookUri: URI, + @IInstantiationService private readonly instantiationService: IInstantiationService ) { } public async initialize(providerHandle: number): Promise { this.managerDetails = await this._proxy.ext.$getNotebookManager(providerHandle, this.notebookUri); let managerHandle = this.managerDetails.handle; - this._contentManager = this.managerDetails.hasContentManager ? new ContentManagerWrapper(managerHandle, this._proxy) : new LocalContentManager(); + this._contentManager = this.managerDetails.hasContentManager ? new ContentManagerWrapper(managerHandle, this._proxy) : this.instantiationService.createInstance(LocalContentManager); this._serverManager = this.managerDetails.hasServerManager ? new ServerManagerWrapper(managerHandle, this._proxy) : undefined; this._sessionManager = new SessionManagerWrapper(managerHandle, this._proxy); return this; diff --git a/src/sql/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.ts b/src/sql/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.ts index c87c544e7a..c4978afa06 100644 --- a/src/sql/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.ts +++ b/src/sql/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.ts @@ -21,11 +21,11 @@ import { SqlMainContext, MainThreadNotebookDocumentsAndEditorsShape, SqlExtHostContext, ExtHostNotebookDocumentsAndEditorsShape, INotebookDocumentsAndEditorsDelta, INotebookEditorAddData, INotebookShowOptions, INotebookModelAddedData, INotebookModelChangedData } from 'sql/workbench/api/common/sqlExtHost.protocol'; -import { NotebookInput } from 'sql/workbench/parts/notebook/node/notebookInput'; +import { NotebookInput } from 'sql/workbench/parts/notebook/common/models/notebookInput'; import { INotebookService, INotebookEditor, IProviderInfo } from 'sql/workbench/services/notebook/common/notebookService'; import { ISingleNotebookEditOperation, NotebookChangeKind } from 'sql/workbench/api/common/sqlExtHostTypes'; import { disposed } from 'vs/base/common/errors'; -import { ICellModel, NotebookContentChange, INotebookModel } from 'sql/workbench/parts/notebook/node/models/modelInterfaces'; +import { ICellModel, NotebookContentChange, INotebookModel } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; import { NotebookChangeType, CellTypes } from 'sql/workbench/parts/notebook/common/models/contracts'; import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilitiesService'; import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; diff --git a/src/sql/workbench/common/customInputConverter.ts b/src/sql/workbench/common/customInputConverter.ts index 31ce881554..93fdd8e829 100644 --- a/src/sql/workbench/common/customInputConverter.ts +++ b/src/sql/workbench/common/customInputConverter.ts @@ -12,7 +12,7 @@ import { QueryResultsInput } from 'sql/workbench/parts/query/common/queryResults import { QueryInput } from 'sql/workbench/parts/query/common/queryInput'; import { IQueryEditorOptions } from 'sql/workbench/services/queryEditor/common/queryEditorService'; import { QueryPlanInput } from 'sql/workbench/parts/queryPlan/common/queryPlanInput'; -import { NotebookInput } from 'sql/workbench/parts/notebook/node/notebookInput'; +import { NotebookInput } from 'sql/workbench/parts/notebook/common/models/notebookInput'; import { INotebookService } from 'sql/workbench/services/notebook/common/notebookService'; import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput'; import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput'; diff --git a/src/sql/workbench/parts/dashboard/browser/widgets/explorer/explorerTree.ts b/src/sql/workbench/parts/dashboard/browser/widgets/explorer/explorerTree.ts index 6bc2e8f2a0..3daf53c652 100644 --- a/src/sql/workbench/parts/dashboard/browser/widgets/explorer/explorerTree.ts +++ b/src/sql/workbench/parts/dashboard/browser/widgets/explorer/explorerTree.ts @@ -33,7 +33,7 @@ import { $ } from 'vs/base/browser/dom'; import { ExecuteCommandAction } from 'vs/platform/actions/common/actions'; import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { IEditorProgressService } from 'vs/platform/progress/common/progress'; -import { NewNotebookAction } from 'sql/workbench/parts/notebook/electron-browser/notebookActions'; +import { NewNotebookAction } from 'sql/workbench/parts/notebook/browser/notebookActions'; export class ObjectMetadataWrapper implements ObjectMetadata { public metadataType: MetadataType; diff --git a/src/sql/workbench/parts/dataExplorer/electron-browser/nodeCommands.ts b/src/sql/workbench/parts/dataExplorer/electron-browser/nodeCommands.ts index a25931e45c..f4c2f96942 100644 --- a/src/sql/workbench/parts/dataExplorer/electron-browser/nodeCommands.ts +++ b/src/sql/workbench/parts/dataExplorer/electron-browser/nodeCommands.ts @@ -16,7 +16,7 @@ import { IViewsRegistry, Extensions } from 'vs/workbench/common/views'; import { IProgressService } from 'vs/platform/progress/common/progress'; import { Registry } from 'vs/platform/registry/common/platform'; import { BackupAction, RestoreAction } from 'sql/workbench/common/actions'; -import { NewNotebookAction } from 'sql/workbench/parts/notebook/electron-browser/notebookActions'; +import { NewNotebookAction } from 'sql/workbench/parts/notebook/browser/notebookActions'; export const DISCONNECT_COMMAND_ID = 'dataExplorer.disconnect'; export const MANAGE_COMMAND_ID = 'dataExplorer.manage'; diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellToggleMoreActions.ts b/src/sql/workbench/parts/notebook/browser/cellToggleMoreActions.ts similarity index 95% rename from src/sql/workbench/parts/notebook/electron-browser/cellToggleMoreActions.ts rename to src/sql/workbench/parts/notebook/browser/cellToggleMoreActions.ts index b47b8c148f..f4250c6bb6 100644 --- a/src/sql/workbench/parts/notebook/electron-browser/cellToggleMoreActions.ts +++ b/src/sql/workbench/parts/notebook/browser/cellToggleMoreActions.ts @@ -13,12 +13,12 @@ import { INotificationService, Severity } from 'vs/platform/notification/common/ import * as DOM from 'vs/base/browser/dom'; import { INotebookService } from 'sql/workbench/services/notebook/common/notebookService'; -import { CellActionBase, CellContext } from 'sql/workbench/parts/notebook/electron-browser/cellViews/codeActions'; +import { CellActionBase, CellContext } from 'sql/workbench/parts/notebook/browser/cellViews/codeActions'; import { CellTypes, CellType } from 'sql/workbench/parts/notebook/common/models/contracts'; -import { NotebookModel } from 'sql/workbench/parts/notebook/node/models/notebookModel'; -import { ICellModel } from 'sql/workbench/parts/notebook/node/models/modelInterfaces'; +import { NotebookModel } from 'sql/workbench/parts/notebook/common/models/notebookModel'; +import { ICellModel } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; import { ToggleMoreWidgetAction } from 'sql/workbench/parts/dashboard/browser/core/actions'; -import { CellModel } from 'sql/workbench/parts/notebook/node/models/cell'; +import { CellModel } from 'sql/workbench/parts/notebook/common/models/cell'; export const HIDDEN_CLASS = 'actionhidden'; diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/code.component.html b/src/sql/workbench/parts/notebook/browser/cellViews/code.component.html similarity index 100% rename from src/sql/workbench/parts/notebook/electron-browser/cellViews/code.component.html rename to src/sql/workbench/parts/notebook/browser/cellViews/code.component.html diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/code.component.ts b/src/sql/workbench/parts/notebook/browser/cellViews/code.component.ts similarity index 97% rename from src/sql/workbench/parts/notebook/electron-browser/cellViews/code.component.ts rename to src/sql/workbench/parts/notebook/browser/cellViews/code.component.ts index 8281112273..b900b02dd6 100644 --- a/src/sql/workbench/parts/notebook/electron-browser/cellViews/code.component.ts +++ b/src/sql/workbench/parts/notebook/browser/cellViews/code.component.ts @@ -8,11 +8,11 @@ import { OnInit, Component, Input, Inject, ElementRef, ViewChild, Output, EventE import { AngularDisposable } from 'sql/base/browser/lifecycle'; import { QueryTextEditor } from 'sql/workbench/browser/modelComponents/queryTextEditor'; -import { CellToggleMoreActions } from 'sql/workbench/parts/notebook/electron-browser/cellToggleMoreActions'; -import { ICellModel, notebookConstants, CellExecutionState } from 'sql/workbench/parts/notebook/node/models/modelInterfaces'; +import { CellToggleMoreActions } from 'sql/workbench/parts/notebook/browser/cellToggleMoreActions'; +import { ICellModel, notebookConstants, CellExecutionState } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; import { Taskbar } from 'sql/base/browser/ui/taskbar/taskbar'; -import { RunCellAction, CellContext } from 'sql/workbench/parts/notebook/electron-browser/cellViews/codeActions'; -import { NotebookModel } from 'sql/workbench/parts/notebook/node/models/notebookModel'; +import { RunCellAction, CellContext } from 'sql/workbench/parts/notebook/browser/cellViews/codeActions'; +import { NotebookModel } from 'sql/workbench/parts/notebook/common/models/notebookModel'; import { IColorTheme, IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; import * as themeColors from 'vs/workbench/common/theme'; @@ -29,7 +29,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur import { Event, Emitter } from 'vs/base/common/event'; import { CellTypes } from 'sql/workbench/parts/notebook/common/models/contracts'; import { OVERRIDE_EDITOR_THEMING_SETTING } from 'sql/workbench/services/notebook/common/notebookService'; -import * as notebookUtils from 'sql/workbench/parts/notebook/node/models/notebookUtils'; +import * as notebookUtils from 'sql/workbench/parts/notebook/common/models/notebookUtils'; import { UntitledEditorModel } from 'vs/workbench/common/editor/untitledEditorModel'; import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement'; import { ILogService } from 'vs/platform/log/common/log'; diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/code.css b/src/sql/workbench/parts/notebook/browser/cellViews/code.css similarity index 100% rename from src/sql/workbench/parts/notebook/electron-browser/cellViews/code.css rename to src/sql/workbench/parts/notebook/browser/cellViews/code.css diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/codeActions.ts b/src/sql/workbench/parts/notebook/browser/cellViews/codeActions.ts similarity index 96% rename from src/sql/workbench/parts/notebook/electron-browser/cellViews/codeActions.ts rename to src/sql/workbench/parts/notebook/browser/cellViews/codeActions.ts index 5a2fc7ac94..afc983e9c9 100644 --- a/src/sql/workbench/parts/notebook/electron-browser/cellViews/codeActions.ts +++ b/src/sql/workbench/parts/notebook/browser/cellViews/codeActions.ts @@ -9,10 +9,10 @@ import { IDisposable } from 'vs/base/common/lifecycle'; import * as types from 'vs/base/common/types'; import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; -import { NotebookModel } from 'sql/workbench/parts/notebook/node/models/notebookModel'; -import { ICellModel, CellExecutionState } from 'sql/workbench/parts/notebook/node/models/modelInterfaces'; +import { NotebookModel } from 'sql/workbench/parts/notebook/common/models/notebookModel'; +import { ICellModel, CellExecutionState } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement'; -import { MultiStateAction, IMultiStateData } from 'sql/workbench/parts/notebook/electron-browser/notebookActions'; +import { MultiStateAction, IMultiStateData } from 'sql/workbench/parts/notebook/browser/notebookActions'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { ILogService } from 'vs/platform/log/common/log'; import { getErrorMessage } from 'vs/base/common/errors'; diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/codeCell.component.html b/src/sql/workbench/parts/notebook/browser/cellViews/codeCell.component.html similarity index 100% rename from src/sql/workbench/parts/notebook/electron-browser/cellViews/codeCell.component.html rename to src/sql/workbench/parts/notebook/browser/cellViews/codeCell.component.html diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/codeCell.component.ts b/src/sql/workbench/parts/notebook/browser/cellViews/codeCell.component.ts similarity index 91% rename from src/sql/workbench/parts/notebook/electron-browser/cellViews/codeCell.component.ts rename to src/sql/workbench/parts/notebook/browser/cellViews/codeCell.component.ts index f1fa451486..31294a4529 100644 --- a/src/sql/workbench/parts/notebook/electron-browser/cellViews/codeCell.component.ts +++ b/src/sql/workbench/parts/notebook/browser/cellViews/codeCell.component.ts @@ -5,9 +5,9 @@ import { nb } from 'azdata'; import { OnInit, Component, Input, Inject, forwardRef, ChangeDetectorRef, SimpleChange, OnChanges, HostListener } from '@angular/core'; -import { CellView } from 'sql/workbench/parts/notebook/electron-browser/cellViews/interfaces'; -import { ICellModel } from 'sql/workbench/parts/notebook/node/models/modelInterfaces'; -import { NotebookModel } from 'sql/workbench/parts/notebook/node/models/notebookModel'; +import { CellView } from 'sql/workbench/parts/notebook/browser/cellViews/interfaces'; +import { ICellModel } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; +import { NotebookModel } from 'sql/workbench/parts/notebook/common/models/notebookModel'; import { Deferred } from 'sql/base/common/promise'; diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/interfaces.ts b/src/sql/workbench/parts/notebook/browser/cellViews/interfaces.ts similarity index 100% rename from src/sql/workbench/parts/notebook/electron-browser/cellViews/interfaces.ts rename to src/sql/workbench/parts/notebook/browser/cellViews/interfaces.ts diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/linkHandler.directive.ts b/src/sql/workbench/parts/notebook/browser/cellViews/linkHandler.directive.ts similarity index 100% rename from src/sql/workbench/parts/notebook/electron-browser/cellViews/linkHandler.directive.ts rename to src/sql/workbench/parts/notebook/browser/cellViews/linkHandler.directive.ts diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/media/dark/execute_cell_inverse.svg b/src/sql/workbench/parts/notebook/browser/cellViews/media/dark/execute_cell_inverse.svg similarity index 100% rename from src/sql/workbench/parts/notebook/electron-browser/cellViews/media/dark/execute_cell_inverse.svg rename to src/sql/workbench/parts/notebook/browser/cellViews/media/dark/execute_cell_inverse.svg diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/media/dark/stop_cell_solidanimation_inverse.svg b/src/sql/workbench/parts/notebook/browser/cellViews/media/dark/stop_cell_solidanimation_inverse.svg old mode 100755 new mode 100644 similarity index 100% rename from src/sql/workbench/parts/notebook/electron-browser/cellViews/media/dark/stop_cell_solidanimation_inverse.svg rename to src/sql/workbench/parts/notebook/browser/cellViews/media/dark/stop_cell_solidanimation_inverse.svg diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/media/highlight.css b/src/sql/workbench/parts/notebook/browser/cellViews/media/highlight.css similarity index 100% rename from src/sql/workbench/parts/notebook/electron-browser/cellViews/media/highlight.css rename to src/sql/workbench/parts/notebook/browser/cellViews/media/highlight.css diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/media/light/execute_cell.svg b/src/sql/workbench/parts/notebook/browser/cellViews/media/light/execute_cell.svg similarity index 100% rename from src/sql/workbench/parts/notebook/electron-browser/cellViews/media/light/execute_cell.svg rename to src/sql/workbench/parts/notebook/browser/cellViews/media/light/execute_cell.svg diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/media/light/execute_cell_error.svg b/src/sql/workbench/parts/notebook/browser/cellViews/media/light/execute_cell_error.svg old mode 100755 new mode 100644 similarity index 100% rename from src/sql/workbench/parts/notebook/electron-browser/cellViews/media/light/execute_cell_error.svg rename to src/sql/workbench/parts/notebook/browser/cellViews/media/light/execute_cell_error.svg diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/media/light/stop_cell_solidanimation.svg b/src/sql/workbench/parts/notebook/browser/cellViews/media/light/stop_cell_solidanimation.svg old mode 100755 new mode 100644 similarity index 100% rename from src/sql/workbench/parts/notebook/electron-browser/cellViews/media/light/stop_cell_solidanimation.svg rename to src/sql/workbench/parts/notebook/browser/cellViews/media/light/stop_cell_solidanimation.svg diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/media/markdown.css b/src/sql/workbench/parts/notebook/browser/cellViews/media/markdown.css similarity index 100% rename from src/sql/workbench/parts/notebook/electron-browser/cellViews/media/markdown.css rename to src/sql/workbench/parts/notebook/browser/cellViews/media/markdown.css diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/media/output.css b/src/sql/workbench/parts/notebook/browser/cellViews/media/output.css similarity index 100% rename from src/sql/workbench/parts/notebook/electron-browser/cellViews/media/output.css rename to src/sql/workbench/parts/notebook/browser/cellViews/media/output.css diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/output.component.html b/src/sql/workbench/parts/notebook/browser/cellViews/output.component.html similarity index 100% rename from src/sql/workbench/parts/notebook/electron-browser/cellViews/output.component.html rename to src/sql/workbench/parts/notebook/browser/cellViews/output.component.html diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/output.component.ts b/src/sql/workbench/parts/notebook/browser/cellViews/output.component.ts similarity index 97% rename from src/sql/workbench/parts/notebook/electron-browser/cellViews/output.component.ts rename to src/sql/workbench/parts/notebook/browser/cellViews/output.component.ts index 12317432a6..431dd21f36 100644 --- a/src/sql/workbench/parts/notebook/electron-browser/cellViews/output.component.ts +++ b/src/sql/workbench/parts/notebook/browser/cellViews/output.component.ts @@ -9,12 +9,12 @@ import { OnInit, Component, Input, Inject, ElementRef, ViewChild, SimpleChange, import { AngularDisposable } from 'sql/base/browser/lifecycle'; import { Event } from 'vs/base/common/event'; import { nb } from 'azdata'; -import { ICellModel } from 'sql/workbench/parts/notebook/node/models/modelInterfaces'; +import { ICellModel } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; import * as outputProcessor from 'sql/workbench/parts/notebook/common/models/outputProcessor'; import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService'; import * as DOM from 'vs/base/browser/dom'; import { ComponentHostDirective } from 'sql/workbench/parts/dashboard/browser/core/componentHost.directive'; -import { Extensions, IMimeComponent, IMimeComponentRegistry } from 'sql/workbench/parts/notebook/electron-browser/outputs/mimeRegistry'; +import { Extensions, IMimeComponent, IMimeComponentRegistry } from 'sql/workbench/parts/notebook/browser/outputs/mimeRegistry'; import * as colors from 'vs/platform/theme/common/colorRegistry'; import * as themeColors from 'vs/workbench/common/theme'; import { Registry } from 'vs/platform/registry/common/platform'; diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/outputArea.component.html b/src/sql/workbench/parts/notebook/browser/cellViews/outputArea.component.html similarity index 100% rename from src/sql/workbench/parts/notebook/electron-browser/cellViews/outputArea.component.html rename to src/sql/workbench/parts/notebook/browser/cellViews/outputArea.component.html diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/outputArea.component.ts b/src/sql/workbench/parts/notebook/browser/cellViews/outputArea.component.ts similarity index 96% rename from src/sql/workbench/parts/notebook/electron-browser/cellViews/outputArea.component.ts rename to src/sql/workbench/parts/notebook/browser/cellViews/outputArea.component.ts index 0405933e10..2f0b2d294d 100644 --- a/src/sql/workbench/parts/notebook/electron-browser/cellViews/outputArea.component.ts +++ b/src/sql/workbench/parts/notebook/browser/cellViews/outputArea.component.ts @@ -6,7 +6,7 @@ import 'vs/css!./code'; import 'vs/css!./outputArea'; import { OnInit, Component, Input, Inject, ElementRef, ViewChild, forwardRef, ChangeDetectorRef } from '@angular/core'; import { AngularDisposable } from 'sql/base/browser/lifecycle'; -import { ICellModel } from 'sql/workbench/parts/notebook/node/models/modelInterfaces'; +import { ICellModel } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; import * as themeColors from 'vs/workbench/common/theme'; import { IWorkbenchThemeService, IColorTheme } from 'vs/workbench/services/themes/common/workbenchThemeService'; import { URI } from 'vs/base/common/uri'; diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/outputArea.css b/src/sql/workbench/parts/notebook/browser/cellViews/outputArea.css similarity index 100% rename from src/sql/workbench/parts/notebook/electron-browser/cellViews/outputArea.css rename to src/sql/workbench/parts/notebook/browser/cellViews/outputArea.css diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/placeholder.css b/src/sql/workbench/parts/notebook/browser/cellViews/placeholder.css similarity index 100% rename from src/sql/workbench/parts/notebook/electron-browser/cellViews/placeholder.css rename to src/sql/workbench/parts/notebook/browser/cellViews/placeholder.css diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/placeholderCell.component.html b/src/sql/workbench/parts/notebook/browser/cellViews/placeholderCell.component.html similarity index 100% rename from src/sql/workbench/parts/notebook/electron-browser/cellViews/placeholderCell.component.html rename to src/sql/workbench/parts/notebook/browser/cellViews/placeholderCell.component.html diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/placeholderCell.component.ts b/src/sql/workbench/parts/notebook/browser/cellViews/placeholderCell.component.ts similarity index 88% rename from src/sql/workbench/parts/notebook/electron-browser/cellViews/placeholderCell.component.ts rename to src/sql/workbench/parts/notebook/browser/cellViews/placeholderCell.component.ts index 49ec5d6a0e..767547bc35 100644 --- a/src/sql/workbench/parts/notebook/electron-browser/cellViews/placeholderCell.component.ts +++ b/src/sql/workbench/parts/notebook/browser/cellViews/placeholderCell.component.ts @@ -5,9 +5,9 @@ import 'vs/css!./placeholder'; import { OnInit, Component, Input, Inject, forwardRef, ElementRef, ChangeDetectorRef, OnDestroy, ViewChild, SimpleChange, OnChanges } from '@angular/core'; -import { CellView } from 'sql/workbench/parts/notebook/electron-browser/cellViews/interfaces'; -import { ICellModel } from 'sql/workbench/parts/notebook/node/models/modelInterfaces'; -import { NotebookModel } from 'sql/workbench/parts/notebook/node/models/notebookModel'; +import { CellView } from 'sql/workbench/parts/notebook/browser/cellViews/interfaces'; +import { ICellModel } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; +import { NotebookModel } from 'sql/workbench/parts/notebook/common/models/notebookModel'; import { localize } from 'vs/nls'; import { CellType } from 'sql/workbench/parts/notebook/common/models/contracts'; diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/stdin.component.ts b/src/sql/workbench/parts/notebook/browser/cellViews/stdin.component.ts similarity index 98% rename from src/sql/workbench/parts/notebook/electron-browser/cellViews/stdin.component.ts rename to src/sql/workbench/parts/notebook/browser/cellViews/stdin.component.ts index bb459fb411..c335f9aca7 100644 --- a/src/sql/workbench/parts/notebook/electron-browser/cellViews/stdin.component.ts +++ b/src/sql/workbench/parts/notebook/browser/cellViews/stdin.component.ts @@ -23,7 +23,7 @@ import { InputBox } from 'sql/base/browser/ui/inputBox/inputBox'; import { attachInputBoxStyler } from 'sql/platform/theme/common/styler'; import { AngularDisposable } from 'sql/base/browser/lifecycle'; import { Deferred } from 'sql/base/common/promise'; -import { ICellModel, CellExecutionState } from 'sql/workbench/parts/notebook/node/models/modelInterfaces'; +import { ICellModel, CellExecutionState } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; export const STDIN_SELECTOR: string = 'stdin-component'; @Component({ diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/stdin.css b/src/sql/workbench/parts/notebook/browser/cellViews/stdin.css similarity index 100% rename from src/sql/workbench/parts/notebook/electron-browser/cellViews/stdin.css rename to src/sql/workbench/parts/notebook/browser/cellViews/stdin.css diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/textCell.component.html b/src/sql/workbench/parts/notebook/browser/cellViews/textCell.component.html similarity index 100% rename from src/sql/workbench/parts/notebook/electron-browser/cellViews/textCell.component.html rename to src/sql/workbench/parts/notebook/browser/cellViews/textCell.component.html diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/textCell.component.ts b/src/sql/workbench/parts/notebook/browser/cellViews/textCell.component.ts similarity index 95% rename from src/sql/workbench/parts/notebook/electron-browser/cellViews/textCell.component.ts rename to src/sql/workbench/parts/notebook/browser/cellViews/textCell.component.ts index 0ca1783b70..a511292c5f 100644 --- a/src/sql/workbench/parts/notebook/electron-browser/cellViews/textCell.component.ts +++ b/src/sql/workbench/parts/notebook/browser/cellViews/textCell.component.ts @@ -22,14 +22,14 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur import { toDisposable } from 'vs/base/common/lifecycle'; import { IMarkdownRenderResult } from 'vs/editor/contrib/markdown/markdownRenderer'; import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { NotebookMarkdownRenderer } from 'sql/workbench/parts/notebook/outputs/notebookMarkdown'; -import { CellView } from 'sql/workbench/parts/notebook/electron-browser/cellViews/interfaces'; -import { ICellModel } from 'sql/workbench/parts/notebook/node/models/modelInterfaces'; -import { NotebookModel } from 'sql/workbench/parts/notebook/node/models/notebookModel'; -import { ISanitizer, defaultSanitizer } from 'sql/workbench/parts/notebook/electron-browser/outputs/sanitizer'; -import { CellToggleMoreActions } from 'sql/workbench/parts/notebook/electron-browser/cellToggleMoreActions'; +import { NotebookMarkdownRenderer } from 'sql/workbench/parts/notebook/browser/outputs/notebookMarkdown'; +import { CellView } from 'sql/workbench/parts/notebook/browser/cellViews/interfaces'; +import { ICellModel } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; +import { NotebookModel } from 'sql/workbench/parts/notebook/common/models/notebookModel'; +import { ISanitizer, defaultSanitizer } from 'sql/workbench/parts/notebook/browser/outputs/sanitizer'; +import { CellToggleMoreActions } from 'sql/workbench/parts/notebook/browser/cellToggleMoreActions'; import { CommonServiceInterface } from 'sql/platform/bootstrap/browser/commonServiceInterface.service'; -import { useInProcMarkdown, convertVscodeResourceToFileInSubDirectories } from 'sql/workbench/parts/notebook/node/models/notebookUtils'; +import { useInProcMarkdown, convertVscodeResourceToFileInSubDirectories } from 'sql/workbench/parts/notebook/common/models/notebookUtils'; export const TEXT_SELECTOR: string = 'text-cell-component'; const USER_SELECT_CLASS = 'actionselect'; diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/textCell.css b/src/sql/workbench/parts/notebook/browser/cellViews/textCell.css similarity index 100% rename from src/sql/workbench/parts/notebook/electron-browser/cellViews/textCell.css rename to src/sql/workbench/parts/notebook/browser/cellViews/textCell.css diff --git a/src/sql/workbench/parts/notebook/electron-browser/notebook.component.html b/src/sql/workbench/parts/notebook/browser/notebook.component.html similarity index 100% rename from src/sql/workbench/parts/notebook/electron-browser/notebook.component.html rename to src/sql/workbench/parts/notebook/browser/notebook.component.html diff --git a/src/sql/workbench/parts/notebook/electron-browser/notebook.component.ts b/src/sql/workbench/parts/notebook/browser/notebook.component.ts similarity index 97% rename from src/sql/workbench/parts/notebook/electron-browser/notebook.component.ts rename to src/sql/workbench/parts/notebook/browser/notebook.component.ts index 27337eac00..15dca69885 100644 --- a/src/sql/workbench/parts/notebook/electron-browser/notebook.component.ts +++ b/src/sql/workbench/parts/notebook/browser/notebook.component.ts @@ -23,24 +23,24 @@ import * as DOM from 'vs/base/browser/dom'; import { AngularDisposable } from 'sql/base/browser/lifecycle'; import { CellTypes, CellType } from 'sql/workbench/parts/notebook/common/models/contracts'; -import { ICellModel, IModelFactory, INotebookModel, NotebookContentChange } from 'sql/workbench/parts/notebook/node/models/modelInterfaces'; +import { ICellModel, IModelFactory, INotebookModel, NotebookContentChange } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement'; import { INotebookService, INotebookParams, INotebookManager, INotebookEditor, DEFAULT_NOTEBOOK_PROVIDER, SQL_NOTEBOOK_PROVIDER, INotebookSection, INavigationProvider } from 'sql/workbench/services/notebook/common/notebookService'; -import { NotebookModel } from 'sql/workbench/parts/notebook/node/models/notebookModel'; -import { ModelFactory } from 'sql/workbench/parts/notebook/node/models/modelFactory'; -import * as notebookUtils from 'sql/workbench/parts/notebook/node/models/notebookUtils'; +import { NotebookModel } from 'sql/workbench/parts/notebook/common/models/notebookModel'; +import { ModelFactory } from 'sql/workbench/parts/notebook/common/models/modelFactory'; +import * as notebookUtils from 'sql/workbench/parts/notebook/common/models/notebookUtils'; import { Deferred } from 'sql/base/common/promise'; import { IConnectionProfile } from 'sql/platform/connection/common/interfaces'; import { Taskbar } from 'sql/base/browser/ui/taskbar/taskbar'; -import { KernelsDropdown, AttachToDropdown, AddCellAction, TrustedAction, RunAllCellsAction, ClearAllOutputsAction } from 'sql/workbench/parts/notebook/electron-browser/notebookActions'; +import { KernelsDropdown, AttachToDropdown, AddCellAction, TrustedAction, RunAllCellsAction, ClearAllOutputsAction } from 'sql/workbench/parts/notebook/browser/notebookActions'; import { IObjectExplorerService } from 'sql/workbench/services/objectExplorer/common/objectExplorerService'; import * as TaskUtilities from 'sql/workbench/common/taskUtilities'; import { ISingleNotebookEditOperation } from 'sql/workbench/api/common/sqlExtHostTypes'; import { IConnectionDialogService } from 'sql/workbench/services/connection/common/connectionDialogService'; import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilitiesService'; -import { CellMagicMapper } from 'sql/workbench/parts/notebook/node/models/cellMagicMapper'; +import { CellMagicMapper } from 'sql/workbench/parts/notebook/common/models/cellMagicMapper'; import { IExtensionsViewlet, VIEWLET_ID } from 'vs/workbench/contrib/extensions/common/extensions'; -import { CellModel } from 'sql/workbench/parts/notebook/node/models/cell'; +import { CellModel } from 'sql/workbench/parts/notebook/common/models/cell'; import { FileOperationError, FileOperationResult } from 'vs/platform/files/common/files'; import { isValidBasename } from 'vs/base/common/extpath'; import { basename } from 'vs/base/common/resources'; diff --git a/src/sql/workbench/parts/notebook/electron-browser/notebook.contribution.ts b/src/sql/workbench/parts/notebook/browser/notebook.contribution.ts similarity index 91% rename from src/sql/workbench/parts/notebook/electron-browser/notebook.contribution.ts rename to src/sql/workbench/parts/notebook/browser/notebook.contribution.ts index 0b04700750..17d85c97bc 100644 --- a/src/sql/workbench/parts/notebook/electron-browser/notebook.contribution.ts +++ b/src/sql/workbench/parts/notebook/browser/notebook.contribution.ts @@ -8,24 +8,22 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actions'; import { SyncActionDescriptor, registerAction } from 'vs/platform/actions/common/actions'; -import { NotebookInput } from 'sql/workbench/parts/notebook/node/notebookInput'; -import { NotebookEditor } from 'sql/workbench/parts/notebook/electron-browser/notebookEditor'; -import { NewNotebookAction } from 'sql/workbench/parts/notebook/electron-browser/notebookActions'; +import { NotebookInput } from 'sql/workbench/parts/notebook/common/models/notebookInput'; +import { NotebookEditor } from 'sql/workbench/parts/notebook/browser/notebookEditor'; +import { NewNotebookAction } from 'sql/workbench/parts/notebook/browser/notebookActions'; import { KeyMod } from 'vs/editor/common/standalone/standaloneBase'; import { KeyCode } from 'vs/base/common/keyCodes'; import { IConfigurationRegistry, Extensions as ConfigExtensions } from 'vs/platform/configuration/common/configurationRegistry'; import { localize } from 'vs/nls'; -import product from 'vs/platform/product/node/product'; -import { GridOutputComponent } from 'sql/workbench/parts/notebook/outputs/gridOutput.component'; -import { PlotlyOutputComponent } from 'sql/workbench/parts/notebook/outputs/plotlyOutput.component'; -import { registerComponentType } from 'sql/workbench/parts/notebook/electron-browser/outputs/mimeRegistry'; -import { MimeRendererComponent } from 'sql/workbench/parts/notebook/electron-browser/outputs/mimeRenderer.component'; -import { MarkdownOutputComponent } from 'sql/workbench/parts/notebook/electron-browser/outputs/markdownOutput.component'; +import { GridOutputComponent } from 'sql/workbench/parts/notebook/browser/outputs/gridOutput.component'; +import { PlotlyOutputComponent } from 'sql/workbench/parts/notebook/browser/outputs/plotlyOutput.component'; +import { registerComponentType } from 'sql/workbench/parts/notebook/browser/outputs/mimeRegistry'; +import { MimeRendererComponent } from 'sql/workbench/parts/notebook/browser/outputs/mimeRenderer.component'; +import { MarkdownOutputComponent } from 'sql/workbench/parts/notebook/browser/outputs/markdownOutput.component'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; +import { URI } from 'vs/base/common/uri'; import { IWorkspaceEditingService } from 'vs/workbench/services/workspace/common/workspaceEditing'; -import { IFileDialogService } from 'vs/platform/dialogs/common/dialogs'; import { IWindowService } from 'vs/platform/windows/common/windows'; -import { Uri } from 'vscode'; // Model View editor registration const viewModelEditorDescriptor = new EditorDescriptor( @@ -53,7 +51,7 @@ actionRegistry.registerWorkbenchAction( registerAction({ id: 'workbench.action.setWorkspaceAndOpen', - handler: async (accessor, options: { forceNewWindow: boolean, folderPath: Uri }) => { + handler: async (accessor, options: { forceNewWindow: boolean, folderPath: URI }) => { const viewletService = accessor.get(IViewletService); const workspaceEditingService = accessor.get(IWorkspaceEditingService); const windowService = accessor.get(IWindowService); diff --git a/src/sql/workbench/parts/notebook/electron-browser/notebook.module.ts b/src/sql/workbench/parts/notebook/browser/notebook.module.ts similarity index 83% rename from src/sql/workbench/parts/notebook/electron-browser/notebook.module.ts rename to src/sql/workbench/parts/notebook/browser/notebook.module.ts index 49d634965c..389dc0d21c 100644 --- a/src/sql/workbench/parts/notebook/electron-browser/notebook.module.ts +++ b/src/sql/workbench/parts/notebook/browser/notebook.module.ts @@ -12,22 +12,22 @@ import { ComponentHostDirective } from 'sql/workbench/parts/dashboard/browser/co import { providerIterator } from 'sql/platform/bootstrap/browser/bootstrapService'; import { CommonServiceInterface } from 'sql/platform/bootstrap/browser/commonServiceInterface.service'; import { EditableDropDown } from 'sql/platform/browser/editableDropdown/editableDropdown.component'; -import { NotebookComponent } from 'sql/workbench/parts/notebook/electron-browser/notebook.component'; +import { NotebookComponent } from 'sql/workbench/parts/notebook/browser/notebook.component'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { CodeComponent } from 'sql/workbench/parts/notebook/electron-browser/cellViews/code.component'; -import { CodeCellComponent } from 'sql/workbench/parts/notebook/electron-browser/cellViews/codeCell.component'; -import { TextCellComponent } from 'sql/workbench/parts/notebook/electron-browser/cellViews/textCell.component'; -import { OutputAreaComponent } from 'sql/workbench/parts/notebook/electron-browser/cellViews/outputArea.component'; -import { OutputComponent } from 'sql/workbench/parts/notebook/electron-browser/cellViews/output.component'; -import { StdInComponent } from 'sql/workbench/parts/notebook/electron-browser/cellViews/stdin.component'; -import { PlaceholderCellComponent } from 'sql/workbench/parts/notebook/electron-browser/cellViews/placeholderCell.component'; +import { CodeComponent } from 'sql/workbench/parts/notebook/browser/cellViews/code.component'; +import { CodeCellComponent } from 'sql/workbench/parts/notebook/browser/cellViews/codeCell.component'; +import { TextCellComponent } from 'sql/workbench/parts/notebook/browser/cellViews/textCell.component'; +import { OutputAreaComponent } from 'sql/workbench/parts/notebook/browser/cellViews/outputArea.component'; +import { OutputComponent } from 'sql/workbench/parts/notebook/browser/cellViews/output.component'; +import { StdInComponent } from 'sql/workbench/parts/notebook/browser/cellViews/stdin.component'; +import { PlaceholderCellComponent } from 'sql/workbench/parts/notebook/browser/cellViews/placeholderCell.component'; import LoadingSpinner from 'sql/workbench/browser/modelComponents/loadingSpinner.component'; import { Checkbox } from 'sql/base/browser/ui/checkbox/checkbox.component'; import { SelectBox } from 'sql/platform/browser/selectBox/selectBox.component'; import { InputBox } from 'sql/platform/browser/inputbox/inputBox.component'; -import { IMimeComponentRegistry, Extensions } from 'sql/workbench/parts/notebook/electron-browser/outputs/mimeRegistry'; +import { IMimeComponentRegistry, Extensions } from 'sql/workbench/parts/notebook/browser/outputs/mimeRegistry'; import { Registry } from 'vs/platform/registry/common/platform'; -import { LinkHandlerDirective } from 'sql/workbench/parts/notebook/electron-browser/cellViews/linkHandler.directive'; +import { LinkHandlerDirective } from 'sql/workbench/parts/notebook/browser/cellViews/linkHandler.directive'; import { IBootstrapParams, ISelector } from 'sql/platform/bootstrap/common/bootstrapParams'; export const NotebookModule = (params, selector: string, instantiationService: IInstantiationService): any => { diff --git a/src/sql/workbench/parts/notebook/electron-browser/notebookActions.ts b/src/sql/workbench/parts/notebook/browser/notebookActions.ts similarity index 98% rename from src/sql/workbench/parts/notebook/electron-browser/notebookActions.ts rename to src/sql/workbench/parts/notebook/browser/notebookActions.ts index 0b66be25d2..bde5c416dc 100644 --- a/src/sql/workbench/parts/notebook/electron-browser/notebookActions.ts +++ b/src/sql/workbench/parts/notebook/browser/notebookActions.ts @@ -16,15 +16,15 @@ import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilit import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile'; import { noKernel } from 'sql/workbench/services/notebook/common/sessionManager'; import { IConnectionDialogService } from 'sql/workbench/services/connection/common/connectionDialogService'; -import { NotebookModel } from 'sql/workbench/parts/notebook/node/models/notebookModel'; +import { NotebookModel } from 'sql/workbench/parts/notebook/common/models/notebookModel'; import { generateUri } from 'sql/platform/connection/common/utils'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { ILogService } from 'vs/platform/log/common/log'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { CellType } from 'sql/workbench/parts/notebook/common/models/contracts'; -import { NotebookComponent } from 'sql/workbench/parts/notebook/electron-browser/notebook.component'; +import { NotebookComponent } from 'sql/workbench/parts/notebook/browser/notebook.component'; import { getErrorMessage } from 'vs/base/common/errors'; -import { INotebookModel } from 'sql/workbench/parts/notebook/node/models/modelInterfaces'; +import { INotebookModel } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; const msgLoading = localize('loading', "Loading kernels..."); const msgChanging = localize('changing', "Changing kernel..."); diff --git a/src/sql/workbench/parts/notebook/electron-browser/notebookEditor.ts b/src/sql/workbench/parts/notebook/browser/notebookEditor.ts similarity index 94% rename from src/sql/workbench/parts/notebook/electron-browser/notebookEditor.ts rename to src/sql/workbench/parts/notebook/browser/notebookEditor.ts index 2eccbedbf0..a309154585 100644 --- a/src/sql/workbench/parts/notebook/electron-browser/notebookEditor.ts +++ b/src/sql/workbench/parts/notebook/browser/notebookEditor.ts @@ -11,9 +11,9 @@ import { bootstrapAngular } from 'sql/platform/bootstrap/browser/bootstrapServic import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { CancellationToken } from 'vs/base/common/cancellation'; -import { NotebookInput } from 'sql/workbench/parts/notebook/node/notebookInput'; -import { NotebookModule } from 'sql/workbench/parts/notebook/electron-browser/notebook.module'; -import { NOTEBOOK_SELECTOR } from 'sql/workbench/parts/notebook/electron-browser/notebook.component'; +import { NotebookInput } from 'sql/workbench/parts/notebook/common/models/notebookInput'; +import { NotebookModule } from 'sql/workbench/parts/notebook/browser/notebook.module'; +import { NOTEBOOK_SELECTOR } from 'sql/workbench/parts/notebook/browser/notebook.component'; import { INotebookParams } from 'sql/workbench/services/notebook/common/notebookService'; import { IStorageService } from 'vs/platform/storage/common/storage'; diff --git a/src/sql/workbench/parts/notebook/electron-browser/outputs/factories.ts b/src/sql/workbench/parts/notebook/browser/outputs/factories.ts similarity index 100% rename from src/sql/workbench/parts/notebook/electron-browser/outputs/factories.ts rename to src/sql/workbench/parts/notebook/browser/outputs/factories.ts diff --git a/src/sql/workbench/parts/notebook/outputs/gridOutput.component.ts b/src/sql/workbench/parts/notebook/browser/outputs/gridOutput.component.ts similarity index 98% rename from src/sql/workbench/parts/notebook/outputs/gridOutput.component.ts rename to src/sql/workbench/parts/notebook/browser/outputs/gridOutput.component.ts index 204fef150b..d04c293258 100644 --- a/src/sql/workbench/parts/notebook/outputs/gridOutput.component.ts +++ b/src/sql/workbench/parts/notebook/browser/outputs/gridOutput.component.ts @@ -23,8 +23,8 @@ import { IThemeService } from 'vs/platform/theme/common/themeService'; import { localize } from 'vs/nls'; import { IAction } from 'vs/base/common/actions'; import { AngularDisposable } from 'sql/base/browser/lifecycle'; -import { IMimeComponent } from 'sql/workbench/parts/notebook/electron-browser/outputs/mimeRegistry'; -import { ICellModel } from 'sql/workbench/parts/notebook/node/models/modelInterfaces'; +import { IMimeComponent } from 'sql/workbench/parts/notebook/browser/outputs/mimeRegistry'; +import { ICellModel } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; import { MimeModel } from 'sql/workbench/parts/notebook/common/models/mimemodel'; import { GridTableState } from 'sql/workbench/parts/query/common/gridPanelState'; import { GridTableBase } from 'sql/workbench/parts/query/browser/gridPanel'; diff --git a/src/sql/workbench/parts/notebook/electron-browser/outputs/markdownOutput.component.html b/src/sql/workbench/parts/notebook/browser/outputs/markdownOutput.component.html similarity index 100% rename from src/sql/workbench/parts/notebook/electron-browser/outputs/markdownOutput.component.html rename to src/sql/workbench/parts/notebook/browser/outputs/markdownOutput.component.html diff --git a/src/sql/workbench/parts/notebook/electron-browser/outputs/markdownOutput.component.ts b/src/sql/workbench/parts/notebook/browser/outputs/markdownOutput.component.ts similarity index 93% rename from src/sql/workbench/parts/notebook/electron-browser/outputs/markdownOutput.component.ts rename to src/sql/workbench/parts/notebook/browser/outputs/markdownOutput.component.ts index d1d44c6055..fd77c7fb5a 100644 --- a/src/sql/workbench/parts/notebook/electron-browser/outputs/markdownOutput.component.ts +++ b/src/sql/workbench/parts/notebook/browser/outputs/markdownOutput.component.ts @@ -9,16 +9,16 @@ import 'vs/css!../cellViews/media/highlight'; import { OnInit, Component, Input, Inject, forwardRef, ElementRef, ChangeDetectorRef, ViewChild } from '@angular/core'; import { ICommandService } from 'vs/platform/commands/common/commands'; -import { ISanitizer, defaultSanitizer } from 'sql/workbench/parts/notebook/electron-browser/outputs/sanitizer'; +import { ISanitizer, defaultSanitizer } from 'sql/workbench/parts/notebook/browser/outputs/sanitizer'; import { AngularDisposable } from 'sql/base/browser/lifecycle'; -import { IMimeComponent } from 'sql/workbench/parts/notebook/electron-browser/outputs/mimeRegistry'; +import { IMimeComponent } from 'sql/workbench/parts/notebook/browser/outputs/mimeRegistry'; import { INotebookService } from 'sql/workbench/services/notebook/common/notebookService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { NotebookMarkdownRenderer } from 'sql/workbench/parts/notebook/outputs/notebookMarkdown'; +import { NotebookMarkdownRenderer } from 'sql/workbench/parts/notebook/browser/outputs/notebookMarkdown'; import { MimeModel } from 'sql/workbench/parts/notebook/common/models/mimemodel'; -import { ICellModel } from 'sql/workbench/parts/notebook/node/models/modelInterfaces'; -import { useInProcMarkdown, convertVscodeResourceToFileInSubDirectories } from 'sql/workbench/parts/notebook/node/models/notebookUtils'; +import { ICellModel } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; +import { useInProcMarkdown, convertVscodeResourceToFileInSubDirectories } from 'sql/workbench/parts/notebook/common/models/notebookUtils'; import { URI } from 'vs/base/common/uri'; @Component({ diff --git a/src/sql/workbench/parts/notebook/electron-browser/outputs/mimeRegistry.ts b/src/sql/workbench/parts/notebook/browser/outputs/mimeRegistry.ts similarity index 98% rename from src/sql/workbench/parts/notebook/electron-browser/outputs/mimeRegistry.ts rename to src/sql/workbench/parts/notebook/browser/outputs/mimeRegistry.ts index 2bebfbcbee..64881fc130 100644 --- a/src/sql/workbench/parts/notebook/electron-browser/outputs/mimeRegistry.ts +++ b/src/sql/workbench/parts/notebook/browser/outputs/mimeRegistry.ts @@ -8,7 +8,7 @@ import * as platform from 'vs/platform/registry/common/platform'; import { ReadonlyJSONObject } from 'sql/workbench/parts/notebook/common/models/jsonext'; import { MimeModel } from 'sql/workbench/parts/notebook/common/models/mimemodel'; import * as types from 'vs/base/common/types'; -import { ICellModel } from 'sql/workbench/parts/notebook/node/models/modelInterfaces'; +import { ICellModel } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; export type FactoryIdentifier = string; diff --git a/src/sql/workbench/parts/notebook/electron-browser/outputs/mimeRenderer.component.ts b/src/sql/workbench/parts/notebook/browser/outputs/mimeRenderer.component.ts similarity index 95% rename from src/sql/workbench/parts/notebook/electron-browser/outputs/mimeRenderer.component.ts rename to src/sql/workbench/parts/notebook/browser/outputs/mimeRenderer.component.ts index 7443e447c4..146159e9ef 100644 --- a/src/sql/workbench/parts/notebook/electron-browser/outputs/mimeRenderer.component.ts +++ b/src/sql/workbench/parts/notebook/browser/outputs/mimeRenderer.component.ts @@ -3,12 +3,12 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IMimeComponent } from 'sql/workbench/parts/notebook/electron-browser/outputs/mimeRegistry'; +import { IMimeComponent } from 'sql/workbench/parts/notebook/browser/outputs/mimeRegistry'; import { AngularDisposable } from 'sql/base/browser/lifecycle'; import { ElementRef, forwardRef, Inject, Component, OnInit, Input } from '@angular/core'; import { MimeModel } from 'sql/workbench/parts/notebook/common/models/mimemodel'; import { INotebookService } from 'sql/workbench/services/notebook/common/notebookService'; -import { RenderMimeRegistry } from 'sql/workbench/parts/notebook/electron-browser/outputs/registry'; +import { RenderMimeRegistry } from 'sql/workbench/parts/notebook/browser/outputs/registry'; import { localize } from 'vs/nls'; @Component({ diff --git a/src/sql/workbench/parts/notebook/outputs/notebookMarkdown.ts b/src/sql/workbench/parts/notebook/browser/outputs/notebookMarkdown.ts similarity index 99% rename from src/sql/workbench/parts/notebook/outputs/notebookMarkdown.ts rename to src/sql/workbench/parts/notebook/browser/outputs/notebookMarkdown.ts index bcfbeaf9ce..3594e5863e 100644 --- a/src/sql/workbench/parts/notebook/outputs/notebookMarkdown.ts +++ b/src/sql/workbench/parts/notebook/browser/outputs/notebookMarkdown.ts @@ -6,7 +6,6 @@ import * as path from 'path'; import { URI } from 'vs/base/common/uri'; -import { dispose } from 'vs/base/common/lifecycle'; import { RenderOptions } from 'vs/base/browser/htmlContentRenderer'; import { IMarkdownString, removeMarkdownEscapes } from 'vs/base/common/htmlContent'; import { IMarkdownRenderResult } from 'vs/editor/contrib/markdown/markdownRenderer'; diff --git a/src/sql/workbench/parts/notebook/outputs/plotlyOutput.component.ts b/src/sql/workbench/parts/notebook/browser/outputs/plotlyOutput.component.ts similarity index 95% rename from src/sql/workbench/parts/notebook/outputs/plotlyOutput.component.ts rename to src/sql/workbench/parts/notebook/browser/outputs/plotlyOutput.component.ts index 20204fa6bf..a6ca256627 100644 --- a/src/sql/workbench/parts/notebook/outputs/plotlyOutput.component.ts +++ b/src/sql/workbench/parts/notebook/browser/outputs/plotlyOutput.component.ts @@ -9,8 +9,8 @@ import { IThemeService } from 'vs/platform/theme/common/themeService'; import { localize } from 'vs/nls'; import * as types from 'vs/base/common/types'; import { AngularDisposable } from 'sql/base/browser/lifecycle'; -import { IMimeComponent } from 'sql/workbench/parts/notebook/electron-browser/outputs/mimeRegistry'; -import { ICellModel } from 'sql/workbench/parts/notebook/node/models/modelInterfaces'; +import { IMimeComponent } from 'sql/workbench/parts/notebook/browser/outputs/mimeRegistry'; +import { ICellModel } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; import { MimeModel } from 'sql/workbench/parts/notebook/common/models/mimemodel'; import { getErrorMessage } from 'vs/base/common/errors'; diff --git a/src/sql/workbench/parts/notebook/electron-browser/outputs/registry.ts b/src/sql/workbench/parts/notebook/browser/outputs/registry.ts similarity index 100% rename from src/sql/workbench/parts/notebook/electron-browser/outputs/registry.ts rename to src/sql/workbench/parts/notebook/browser/outputs/registry.ts diff --git a/src/sql/workbench/parts/notebook/electron-browser/outputs/renderers.ts b/src/sql/workbench/parts/notebook/browser/outputs/renderers.ts similarity index 100% rename from src/sql/workbench/parts/notebook/electron-browser/outputs/renderers.ts rename to src/sql/workbench/parts/notebook/browser/outputs/renderers.ts diff --git a/src/sql/workbench/parts/notebook/electron-browser/outputs/sanitizer.ts b/src/sql/workbench/parts/notebook/browser/outputs/sanitizer.ts similarity index 100% rename from src/sql/workbench/parts/notebook/electron-browser/outputs/sanitizer.ts rename to src/sql/workbench/parts/notebook/browser/outputs/sanitizer.ts diff --git a/src/sql/workbench/parts/notebook/electron-browser/outputs/widgets.ts b/src/sql/workbench/parts/notebook/browser/outputs/widgets.ts similarity index 100% rename from src/sql/workbench/parts/notebook/electron-browser/outputs/widgets.ts rename to src/sql/workbench/parts/notebook/browser/outputs/widgets.ts diff --git a/src/sql/workbench/parts/notebook/node/models/cell.ts b/src/sql/workbench/parts/notebook/common/models/cell.ts similarity index 98% rename from src/sql/workbench/parts/notebook/node/models/cell.ts rename to src/sql/workbench/parts/notebook/common/models/cell.ts index 88cf9a97fc..49b02e3150 100644 --- a/src/sql/workbench/parts/notebook/node/models/cell.ts +++ b/src/sql/workbench/parts/notebook/common/models/cell.ts @@ -9,11 +9,10 @@ import { Event, Emitter } from 'vs/base/common/event'; import { URI } from 'vs/base/common/uri'; import { localize } from 'vs/nls'; -import * as notebookUtils from './notebookUtils'; +import * as notebookUtils from 'sql/workbench/parts/notebook/common/models/notebookUtils'; import { CellTypes, CellType, NotebookChangeType } from 'sql/workbench/parts/notebook/common/models/contracts'; -import { NotebookModel } from 'sql/workbench/parts/notebook/node/models/notebookModel'; -import { ICellModel, notebookConstants, IOutputChangedEvent } from 'sql/workbench/parts/notebook/node/models/modelInterfaces'; -import { ICellModelOptions, FutureInternal, CellExecutionState } from './modelInterfaces'; +import { NotebookModel } from 'sql/workbench/parts/notebook/common/models/notebookModel'; +import { ICellModel, notebookConstants, IOutputChangedEvent, FutureInternal, CellExecutionState, ICellModelOptions } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement'; import { IConnectionProfile } from 'sql/platform/connection/common/interfaces'; import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; diff --git a/src/sql/workbench/parts/notebook/node/models/cellMagicMapper.ts b/src/sql/workbench/parts/notebook/common/models/cellMagicMapper.ts similarity index 95% rename from src/sql/workbench/parts/notebook/node/models/cellMagicMapper.ts rename to src/sql/workbench/parts/notebook/common/models/cellMagicMapper.ts index 20deed1b71..ff91484ad0 100644 --- a/src/sql/workbench/parts/notebook/node/models/cellMagicMapper.ts +++ b/src/sql/workbench/parts/notebook/common/models/cellMagicMapper.ts @@ -3,7 +3,7 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ICellMagicMapper } from 'sql/workbench/parts/notebook/node/models/modelInterfaces'; +import { ICellMagicMapper } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; import { ILanguageMagic } from 'sql/workbench/services/notebook/common/notebookService'; const defaultKernel = '*'; diff --git a/src/sql/workbench/parts/notebook/node/models/clientSession.ts b/src/sql/workbench/parts/notebook/common/models/clientSession.ts similarity index 99% rename from src/sql/workbench/parts/notebook/node/models/clientSession.ts rename to src/sql/workbench/parts/notebook/common/models/clientSession.ts index 0488704db8..2128ec914b 100644 --- a/src/sql/workbench/parts/notebook/node/models/clientSession.ts +++ b/src/sql/workbench/parts/notebook/common/models/clientSession.ts @@ -9,13 +9,12 @@ import { nb } from 'azdata'; import { URI } from 'vs/base/common/uri'; import { Event, Emitter } from 'vs/base/common/event'; import { localize } from 'vs/nls'; +import { getErrorMessage } from 'vs/base/common/errors'; -import { IClientSession, IKernelPreference, IClientSessionOptions } from './modelInterfaces'; +import { IClientSession, IKernelPreference, IClientSessionOptions } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; import { Deferred } from 'sql/base/common/promise'; - import { INotebookManager } from 'sql/workbench/services/notebook/common/notebookService'; import { IConnectionProfile } from 'sql/platform/connection/common/interfaces'; -import { getErrorMessage } from 'vs/base/common/errors'; type KernelChangeHandler = (kernel: nb.IKernelChangedArgs) => Promise; /** diff --git a/src/sql/workbench/parts/notebook/node/models/modelFactory.ts b/src/sql/workbench/parts/notebook/common/models/modelFactory.ts similarity index 78% rename from src/sql/workbench/parts/notebook/node/models/modelFactory.ts rename to src/sql/workbench/parts/notebook/common/models/modelFactory.ts index 1b616f005d..f1d3c338c4 100644 --- a/src/sql/workbench/parts/notebook/node/models/modelFactory.ts +++ b/src/sql/workbench/parts/notebook/common/models/modelFactory.ts @@ -5,9 +5,9 @@ import { nb } from 'azdata'; -import { CellModel } from './cell'; -import { IClientSession, IClientSessionOptions, ICellModelOptions, ICellModel, IModelFactory } from './modelInterfaces'; -import { ClientSession } from './clientSession'; +import { CellModel } from 'sql/workbench/parts/notebook/common/models/cell'; +import { IClientSession, IClientSessionOptions, ICellModelOptions, ICellModel, IModelFactory } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; +import { ClientSession } from 'sql/workbench/parts/notebook/common/models/clientSession'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; export class ModelFactory implements IModelFactory { diff --git a/src/sql/workbench/parts/notebook/node/models/modelInterfaces.ts b/src/sql/workbench/parts/notebook/common/models/modelInterfaces.ts similarity index 99% rename from src/sql/workbench/parts/notebook/node/models/modelInterfaces.ts rename to src/sql/workbench/parts/notebook/common/models/modelInterfaces.ts index e862c57c69..2cf3bb5b34 100644 --- a/src/sql/workbench/parts/notebook/node/models/modelInterfaces.ts +++ b/src/sql/workbench/parts/notebook/common/models/modelInterfaces.ts @@ -16,11 +16,11 @@ import { INotebookManager, ILanguageMagic } from 'sql/workbench/services/noteboo import { IConnectionProfile } from 'sql/platform/connection/common/interfaces'; import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement'; import { ISingleNotebookEditOperation } from 'sql/workbench/api/common/sqlExtHostTypes'; -import { IStandardKernelWithProvider } from 'sql/workbench/parts/notebook/node/models/notebookUtils'; +import { IStandardKernelWithProvider } from 'sql/workbench/parts/notebook/common/models/notebookUtils'; import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile'; import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilitiesService'; import { localize } from 'vs/nls'; -import { NotebookModel } from 'sql/workbench/parts/notebook/node/models/notebookModel'; +import { NotebookModel } from 'sql/workbench/parts/notebook/common/models/notebookModel'; import { mssqlProviderName } from 'sql/platform/connection/common/constants'; export interface IClientSessionOptions { diff --git a/src/sql/workbench/parts/notebook/node/models/notebookContexts.ts b/src/sql/workbench/parts/notebook/common/models/notebookContexts.ts similarity index 99% rename from src/sql/workbench/parts/notebook/node/models/notebookContexts.ts rename to src/sql/workbench/parts/notebook/common/models/notebookContexts.ts index 1d46e4b17e..b3ad4f5b00 100644 --- a/src/sql/workbench/parts/notebook/node/models/notebookContexts.ts +++ b/src/sql/workbench/parts/notebook/common/models/notebookContexts.ts @@ -6,7 +6,7 @@ import { nb } from 'azdata'; import { localize } from 'vs/nls'; -import { IDefaultConnection, notebookConstants } from 'sql/workbench/parts/notebook/node/models/modelInterfaces'; +import { IDefaultConnection, notebookConstants } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement'; import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile'; import { IConnectionProfile } from 'sql/platform/connection/common/interfaces'; diff --git a/src/sql/workbench/parts/notebook/node/notebookInput.ts b/src/sql/workbench/parts/notebook/common/models/notebookInput.ts similarity index 96% rename from src/sql/workbench/parts/notebook/node/notebookInput.ts rename to src/sql/workbench/parts/notebook/common/models/notebookInput.ts index 55cd6bf9f0..f09cbe45a3 100644 --- a/src/sql/workbench/parts/notebook/node/notebookInput.ts +++ b/src/sql/workbench/parts/notebook/common/models/notebookInput.ts @@ -10,17 +10,17 @@ import { URI } from 'vs/base/common/uri'; import * as resources from 'vs/base/common/resources'; import * as azdata from 'azdata'; -import { IStandardKernelWithProvider, getProvidersForFileName, getStandardKernelsForProvider } from 'sql/workbench/parts/notebook/node/models/notebookUtils'; +import { IStandardKernelWithProvider, getProvidersForFileName, getStandardKernelsForProvider } from 'sql/workbench/parts/notebook/common/models/notebookUtils'; import { INotebookService, DEFAULT_NOTEBOOK_PROVIDER, IProviderInfo } from 'sql/workbench/services/notebook/common/notebookService'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ITextModelService } from 'vs/editor/common/services/resolverService'; -import { INotebookModel, IContentManager, NotebookContentChange } from 'sql/workbench/parts/notebook/node/models/modelInterfaces'; +import { INotebookModel, IContentManager, NotebookContentChange } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; import { TextFileEditorModel } from 'vs/workbench/services/textfile/common/textFileEditorModel'; import { Range } from 'vs/editor/common/core/range'; import { UntitledEditorModel } from 'vs/workbench/common/editor/untitledEditorModel'; import { Schemas } from 'vs/base/common/network'; import { ITextFileService, ISaveOptions, StateChange } from 'vs/workbench/services/textfile/common/textfiles'; -import { LocalContentManager } from 'sql/workbench/services/notebook/node/localContentManager'; +import { LocalContentManager } from 'sql/workbench/services/notebook/common/localContentManager'; import { IConnectionProfile } from 'sql/platform/connection/common/interfaces'; import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; @@ -198,7 +198,7 @@ export class NotebookInput extends EditorInput { public get contentManager(): IContentManager { if (!this._contentManager) { - this._contentManager = new NotebookEditorContentManager(this); + this._contentManager = this.instantiationService.createInstance(NotebookEditorContentManager, this); } return this._contentManager; } @@ -398,12 +398,14 @@ export class NotebookInput extends EditorInput { } class NotebookEditorContentManager implements IContentManager { - constructor(private notebookInput: NotebookInput) { + constructor( + private notebookInput: NotebookInput, + @IInstantiationService private readonly instantiationService: IInstantiationService) { } async loadContent(): Promise { let notebookEditorModel = await this.notebookInput.resolve(); - let contentManager = new LocalContentManager(); + let contentManager = this.instantiationService.createInstance(LocalContentManager); let contents = await contentManager.loadFromContentString(notebookEditorModel.contentString); return contents; } diff --git a/src/sql/workbench/parts/notebook/node/models/notebookModel.ts b/src/sql/workbench/parts/notebook/common/models/notebookModel.ts similarity index 99% rename from src/sql/workbench/parts/notebook/node/models/notebookModel.ts rename to src/sql/workbench/parts/notebook/common/models/notebookModel.ts index f00b857ed0..954593e777 100644 --- a/src/sql/workbench/parts/notebook/node/models/notebookModel.ts +++ b/src/sql/workbench/parts/notebook/common/models/notebookModel.ts @@ -9,13 +9,13 @@ import { localize } from 'vs/nls'; import { Event, Emitter } from 'vs/base/common/event'; import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import { IClientSession, INotebookModel, IDefaultConnection, INotebookModelOptions, ICellModel, NotebookContentChange, notebookConstants } from './modelInterfaces'; +import { IClientSession, INotebookModel, IDefaultConnection, INotebookModelOptions, ICellModel, NotebookContentChange, notebookConstants } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; import { NotebookChangeType, CellType, CellTypes } from 'sql/workbench/parts/notebook/common/models/contracts'; -import { nbversion } from '../../common/models/notebookConstants'; -import * as notebookUtils from './notebookUtils'; +import { nbversion } from 'sql/workbench/parts/notebook/common/models/notebookConstants'; +import * as notebookUtils from 'sql/workbench/parts/notebook/common/models/notebookUtils'; import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys'; import { INotebookManager, SQL_NOTEBOOK_PROVIDER, DEFAULT_NOTEBOOK_PROVIDER } from 'sql/workbench/services/notebook/common/notebookService'; -import { NotebookContexts } from 'sql/workbench/parts/notebook/node/models/notebookContexts'; +import { NotebookContexts } from 'sql/workbench/parts/notebook/common/models/notebookContexts'; import { IConnectionProfile } from 'sql/platform/connection/common/interfaces'; import { INotification, Severity, INotificationService } from 'vs/platform/notification/common/notification'; import { URI } from 'vs/base/common/uri'; diff --git a/src/sql/workbench/parts/notebook/node/models/notebookUtils.ts b/src/sql/workbench/parts/notebook/common/models/notebookUtils.ts similarity index 90% rename from src/sql/workbench/parts/notebook/node/models/notebookUtils.ts rename to src/sql/workbench/parts/notebook/common/models/notebookUtils.ts index ff29e0029d..86e95a0325 100644 --- a/src/sql/workbench/parts/notebook/node/models/notebookUtils.ts +++ b/src/sql/workbench/parts/notebook/common/models/notebookUtils.ts @@ -5,14 +5,10 @@ import * as path from 'path'; import { nb } from 'azdata'; -import * as os from 'os'; -import * as pfs from 'vs/base/node/pfs'; -import { localize } from 'vs/nls'; import { DEFAULT_NOTEBOOK_PROVIDER, DEFAULT_NOTEBOOK_FILETYPE, INotebookService } from 'sql/workbench/services/notebook/common/notebookService'; import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile'; -import { IOutputChannel } from 'vs/workbench/contrib/output/common/output'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ICellModel } from 'sql/workbench/parts/notebook/node/models/modelInterfaces'; +import { ICellModel } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; /** @@ -26,15 +22,6 @@ export function getUserHome(): string { return process.env.HOME || process.env.USERPROFILE; } -export async function mkDir(dirPath: string, outputChannel?: IOutputChannel): Promise { - let exists = await pfs.dirExists(dirPath); - if (!exists) { - if (outputChannel) { - outputChannel.append(localize('mkdirOutputMsg', '... Creating {0}', dirPath) + os.EOL); - } - await pfs.mkdirp(dirPath); - } -} export function getProvidersForFileName(fileName: string, notebookService: INotebookService): string[] { let fileExt = path.extname(fileName); diff --git a/src/sql/workbench/parts/notebook/test/node/cell.test.ts b/src/sql/workbench/parts/notebook/test/node/cell.test.ts index 14c6de01d0..6d949607fb 100644 --- a/src/sql/workbench/parts/notebook/test/node/cell.test.ts +++ b/src/sql/workbench/parts/notebook/test/node/cell.test.ts @@ -10,10 +10,10 @@ import { nb } from 'azdata'; import * as objects from 'vs/base/common/objects'; import { CellTypes } from 'sql/workbench/parts/notebook/common/models/contracts'; -import { ModelFactory } from 'sql/workbench/parts/notebook/node/models/modelFactory'; +import { ModelFactory } from 'sql/workbench/parts/notebook/common/models/modelFactory'; import { NotebookModelStub } from './common'; import { EmptyFuture } from 'sql/workbench/services/notebook/common/sessionManager'; -import { ICellModel } from 'sql/workbench/parts/notebook/node/models/modelInterfaces'; +import { ICellModel } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; import { Deferred } from 'sql/base/common/promise'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; diff --git a/src/sql/workbench/parts/notebook/test/node/clientSession.test.ts b/src/sql/workbench/parts/notebook/test/node/clientSession.test.ts index 3733414121..03e956d161 100644 --- a/src/sql/workbench/parts/notebook/test/node/clientSession.test.ts +++ b/src/sql/workbench/parts/notebook/test/node/clientSession.test.ts @@ -11,7 +11,7 @@ import { INotificationService } from 'vs/platform/notification/common/notificati import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService'; import { URI } from 'vs/base/common/uri'; -import { ClientSession } from 'sql/workbench/parts/notebook/node/models/clientSession'; +import { ClientSession } from 'sql/workbench/parts/notebook/common/models/clientSession'; import { SessionManager, EmptySession } from 'sql/workbench/services/notebook/common/sessionManager'; import { NotebookManagerStub, ServerManagerStub } from './common'; diff --git a/src/sql/workbench/parts/notebook/test/node/common.ts b/src/sql/workbench/parts/notebook/test/node/common.ts index 5a9fcb40b0..f6bbf8e7ea 100644 --- a/src/sql/workbench/parts/notebook/test/node/common.ts +++ b/src/sql/workbench/parts/notebook/test/node/common.ts @@ -6,11 +6,11 @@ import { nb, IConnectionProfile } from 'azdata'; import { Event, Emitter } from 'vs/base/common/event'; -import { INotebookModel, ICellModel, IClientSession, IDefaultConnection, NotebookContentChange } from 'sql/workbench/parts/notebook/node/models/modelInterfaces'; +import { INotebookModel, ICellModel, IClientSession, IDefaultConnection, NotebookContentChange } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; import { NotebookChangeType, CellType } from 'sql/workbench/parts/notebook/common/models/contracts'; import { INotebookManager } from 'sql/workbench/services/notebook/common/notebookService'; import { ISingleNotebookEditOperation } from 'sql/workbench/api/common/sqlExtHostTypes'; -import { IStandardKernelWithProvider } from 'sql/workbench/parts/notebook/node/models/notebookUtils'; +import { IStandardKernelWithProvider } from 'sql/workbench/parts/notebook/common/models/notebookUtils'; export class NotebookModelStub implements INotebookModel { constructor(private _languageInfo?: nb.ILanguageInfo) { diff --git a/src/sql/workbench/parts/notebook/test/node/contentManagers.test.ts b/src/sql/workbench/parts/notebook/test/node/contentManagers.test.ts index e5a50e38a3..a298c47c52 100644 --- a/src/sql/workbench/parts/notebook/test/node/contentManagers.test.ts +++ b/src/sql/workbench/parts/notebook/test/node/contentManagers.test.ts @@ -5,12 +5,18 @@ import * as should from 'should'; import { nb } from 'azdata'; +import * as typemoq from 'typemoq'; import { URI } from 'vs/base/common/uri'; import * as tempWrite from 'temp-write'; -import { LocalContentManager } from 'sql/workbench/services/notebook/node/localContentManager'; +import { LocalContentManager } from 'sql/workbench/services/notebook/common/localContentManager'; import * as testUtils from '../../../../../../sqltest/utils/testUtils'; import { CellTypes } from 'sql/workbench/parts/notebook/common/models/contracts'; +import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; +import { TestFileService } from 'vs/workbench/test/workbenchTestServices'; +import { IFileService, IReadFileOptions, IFileContent, IWriteFileOptions, IFileStatWithMetadata } from 'vs/platform/files/common/files'; +import * as pfs from 'vs/base/node/pfs'; +import { VSBuffer, VSBufferReadable } from 'vs/base/common/buffer'; let expectedNotebookContent: nb.INotebookContents = { cells: [{ @@ -40,7 +46,23 @@ function verifyMatchesExpectedNotebook(notebook: nb.INotebookContents): void { } suite('Local Content Manager', function (): void { - let contentManager = new LocalContentManager(); + let contentManager: LocalContentManager; + + setup(() => { + const instantiationService = new TestInstantiationService(); + const fileService = new class extends TestFileService { + async readFile(resource: URI, options?: IReadFileOptions | undefined): Promise { + const content = await pfs.readFile(resource.fsPath); + return { name: ',', size: 0, etag: '', mtime: 0, value: VSBuffer.fromString(content.toString()), resource }; + } + async writeFile(resource: URI, bufferOrReadable: VSBuffer | VSBufferReadable, options?: IWriteFileOptions): Promise { + await pfs.writeFile(resource.fsPath, bufferOrReadable.toString()); + return { resource: resource, mtime: 0, etag: '', size: 0, name: '', isDirectory: false }; + } + }; + instantiationService.set(IFileService, fileService); + contentManager = instantiationService.createInstance(LocalContentManager); + }); test('Should return undefined if path is undefined', async function (): Promise { let content = await contentManager.getNotebookContents(undefined); diff --git a/src/sql/workbench/parts/notebook/test/node/notebookModel.test.ts b/src/sql/workbench/parts/notebook/test/node/notebookModel.test.ts index 3c8d729059..e39c08a509 100644 --- a/src/sql/workbench/parts/notebook/test/node/notebookModel.test.ts +++ b/src/sql/workbench/parts/notebook/test/node/notebookModel.test.ts @@ -11,12 +11,12 @@ import { INotificationService } from 'vs/platform/notification/common/notificati import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService'; import { URI } from 'vs/base/common/uri'; -import { LocalContentManager } from 'sql/workbench/services/notebook/node/localContentManager'; +import { LocalContentManager } from 'sql/workbench/services/notebook/common/localContentManager'; import { NotebookManagerStub } from './common'; -import { NotebookModel } from 'sql/workbench/parts/notebook/node/models/notebookModel'; -import { ModelFactory } from 'sql/workbench/parts/notebook/node/models/modelFactory'; -import { IClientSession, ICellModel, INotebookModelOptions, NotebookContentChange } from 'sql/workbench/parts/notebook/node/models/modelInterfaces'; -import { ClientSession } from 'sql/workbench/parts/notebook/node/models/clientSession'; +import { NotebookModel } from 'sql/workbench/parts/notebook/common/models/notebookModel'; +import { ModelFactory } from 'sql/workbench/parts/notebook/common/models/modelFactory'; +import { IClientSession, ICellModel, INotebookModelOptions, NotebookContentChange } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; +import { ClientSession } from 'sql/workbench/parts/notebook/common/models/clientSession'; import { CellTypes, NotebookChangeType } from 'sql/workbench/parts/notebook/common/models/contracts'; import { Deferred } from 'sql/base/common/promise'; import { ConnectionManagementService } from 'sql/platform/connection/common/connectionManagementService'; diff --git a/src/sql/workbench/parts/notebook/test/node/notebookUtils.test.ts b/src/sql/workbench/parts/notebook/test/node/notebookUtils.test.ts index 60b2d537ad..500a6275df 100644 --- a/src/sql/workbench/parts/notebook/test/node/notebookUtils.test.ts +++ b/src/sql/workbench/parts/notebook/test/node/notebookUtils.test.ts @@ -8,7 +8,7 @@ import { IConnectionProfile } from 'azdata'; import { TestCapabilitiesService } from 'sql/platform/capabilities/test/common/testCapabilitiesService'; import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile'; -import { formatServerNameWithDatabaseNameForAttachTo, getServerFromFormattedAttachToName, getDatabaseFromFormattedAttachToName } from 'sql/workbench/parts/notebook/node/models/notebookUtils'; +import { formatServerNameWithDatabaseNameForAttachTo, getServerFromFormattedAttachToName, getDatabaseFromFormattedAttachToName } from 'sql/workbench/parts/notebook/common/models/notebookUtils'; import { mssqlProviderName } from 'sql/platform/connection/common/constants'; suite('notebookUtils', function (): void { diff --git a/src/sql/workbench/parts/objectExplorer/browser/serverTreeActionProvider.ts b/src/sql/workbench/parts/objectExplorer/browser/serverTreeActionProvider.ts index 79489cecba..f41ea2da9c 100644 --- a/src/sql/workbench/parts/objectExplorer/browser/serverTreeActionProvider.ts +++ b/src/sql/workbench/parts/objectExplorer/browser/serverTreeActionProvider.ts @@ -31,7 +31,7 @@ import { IQueryManagementService } from 'sql/platform/query/common/queryManageme import { IScriptingService } from 'sql/platform/scripting/common/scriptingService'; import { ServerInfoContextKey } from 'sql/workbench/parts/connection/common/serverInfoContextKey'; import { fillInActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; -import { NewNotebookAction } from 'sql/workbench/parts/notebook/electron-browser/notebookActions'; +import { NewNotebookAction } from 'sql/workbench/parts/notebook/browser/notebookActions'; /** * Provides actions for the server tree elements diff --git a/src/sql/workbench/services/notebook/node/localContentManager.ts b/src/sql/workbench/services/notebook/common/localContentManager.ts similarity index 96% rename from src/sql/workbench/services/notebook/node/localContentManager.ts rename to src/sql/workbench/services/notebook/common/localContentManager.ts index 585c166ada..6f22d65e6e 100644 --- a/src/sql/workbench/services/notebook/node/localContentManager.ts +++ b/src/sql/workbench/services/notebook/common/localContentManager.ts @@ -8,19 +8,22 @@ import { nb } from 'azdata'; import * as json from 'vs/base/common/json'; -import * as pfs from 'vs/base/node/pfs'; import { URI } from 'vs/base/common/uri'; import { localize } from 'vs/nls'; +import { IFileService } from 'vs/platform/files/common/files'; import { JSONObject } from 'sql/workbench/parts/notebook/common/models/jsonext'; import { OutputTypes } from 'sql/workbench/parts/notebook/common/models/contracts'; import { nbversion } from 'sql/workbench/parts/notebook/common/models/notebookConstants'; import { nbformat } from 'sql/workbench/parts/notebook/common/models/nbformat'; +import { VSBuffer } from 'vs/base/common/buffer'; type MimeBundle = { [key: string]: string | string[] | undefined }; export class LocalContentManager implements nb.ContentManager { + constructor(@IFileService private readonly fileService: IFileService) { } + public async loadFromContentString(contentString: string): Promise { let contents: JSONObject = json.parse(contentString); @@ -47,11 +50,9 @@ export class LocalContentManager implements nb.ContentManager { if (!notebookUri) { return undefined; } - // TODO validate this is an actual file URI, and error if not - let path = notebookUri.fsPath; // Note: intentionally letting caller handle exceptions - let notebookFileBuffer = await pfs.readFile(path); - let stringContents = notebookFileBuffer.toString(); + let notebookFileBuffer = await this.fileService.readFile(notebookUri); + let stringContents = notebookFileBuffer.value.toString(); let contents: JSONObject = json.parse(stringContents); if (contents) { @@ -76,8 +77,7 @@ export class LocalContentManager implements nb.ContentManager { public async save(notebookUri: URI, notebook: nb.INotebookContents): Promise { // Convert to JSON with pretty-print functionality let contents = JSON.stringify(notebook, undefined, ' '); - let path = notebookUri.fsPath; - await pfs.writeFile(path, contents); + await this.fileService.writeFile(notebookUri, VSBuffer.fromString(contents)); return notebook; } diff --git a/src/sql/workbench/services/notebook/common/notebookService.ts b/src/sql/workbench/services/notebook/common/notebookService.ts index fc554bd62f..3a5fc301fa 100644 --- a/src/sql/workbench/services/notebook/common/notebookService.ts +++ b/src/sql/workbench/services/notebook/common/notebookService.ts @@ -8,12 +8,12 @@ import * as azdata from 'azdata'; import { Event } from 'vs/base/common/event'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { URI } from 'vs/base/common/uri'; -import { RenderMimeRegistry } from 'sql/workbench/parts/notebook/electron-browser/outputs/registry'; -import { ModelFactory } from 'sql/workbench/parts/notebook/node/models/modelFactory'; +import { RenderMimeRegistry } from 'sql/workbench/parts/notebook/browser/outputs/registry'; +import { ModelFactory } from 'sql/workbench/parts/notebook/common/models/modelFactory'; import { IConnectionProfile } from 'sql/platform/connection/common/interfaces'; -import { NotebookInput } from 'sql/workbench/parts/notebook/node/notebookInput'; +import { NotebookInput } from 'sql/workbench/parts/notebook/common/models/notebookInput'; import { ISingleNotebookEditOperation } from 'sql/workbench/api/common/sqlExtHostTypes'; -import { ICellModel, INotebookModel } from 'sql/workbench/parts/notebook/node/models/modelInterfaces'; +import { ICellModel, INotebookModel } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; import { NotebookChangeType } from 'sql/workbench/parts/notebook/common/models/contracts'; import { IBootstrapParams } from 'sql/platform/bootstrap/common/bootstrapParams'; diff --git a/src/sql/workbench/services/notebook/common/notebookServiceImpl.ts b/src/sql/workbench/services/notebook/common/notebookServiceImpl.ts index 5b1ad2fd7b..d3828fd12d 100644 --- a/src/sql/workbench/services/notebook/common/notebookServiceImpl.ts +++ b/src/sql/workbench/services/notebook/common/notebookServiceImpl.ts @@ -12,8 +12,8 @@ import { INotebookService, INotebookManager, INotebookProvider, DEFAULT_NOTEBOOK_FILETYPE, INotebookEditor, SQL_NOTEBOOK_PROVIDER, OVERRIDE_EDITOR_THEMING_SETTING, INavigationProvider, ILanguageMagic } from 'sql/workbench/services/notebook/common/notebookService'; -import { RenderMimeRegistry } from 'sql/workbench/parts/notebook/electron-browser/outputs/registry'; -import { standardRendererFactories } from 'sql/workbench/parts/notebook/electron-browser/outputs/factories'; +import { RenderMimeRegistry } from 'sql/workbench/parts/notebook/browser/outputs/registry'; +import { standardRendererFactories } from 'sql/workbench/parts/notebook/browser/outputs/factories'; import { Extensions, INotebookProviderRegistry, NotebookProviderRegistration } from 'sql/workbench/services/notebook/common/notebookRegistry'; import { Emitter, Event } from 'vs/base/common/event'; import { Memento } from 'vs/workbench/common/memento'; @@ -26,11 +26,11 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { NotebookEditorVisibleContext } from 'sql/workbench/services/notebook/common/notebookContext'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { NotebookEditor } from 'sql/workbench/parts/notebook/electron-browser/notebookEditor'; +import { NotebookEditor } from 'sql/workbench/parts/notebook/browser/notebookEditor'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { registerNotebookThemes } from 'sql/workbench/parts/notebook/browser/notebookStyles'; import { IQueryManagementService } from 'sql/platform/query/common/queryManagement'; -import { notebookConstants } from 'sql/workbench/parts/notebook/node/models/modelInterfaces'; +import { notebookConstants } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; import { SqlNotebookProvider } from 'sql/workbench/services/notebook/sql/sqlNotebookProvider'; import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; diff --git a/src/sql/workbench/services/notebook/common/sessionManager.ts b/src/sql/workbench/services/notebook/common/sessionManager.ts index f30c29866b..cd321f08b4 100644 --- a/src/sql/workbench/services/notebook/common/sessionManager.ts +++ b/src/sql/workbench/services/notebook/common/sessionManager.ts @@ -5,7 +5,7 @@ import { nb } from 'azdata'; import { localize } from 'vs/nls'; -import { FutureInternal } from 'sql/workbench/parts/notebook/node/models/modelInterfaces'; +import { FutureInternal } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile'; export const noKernel: string = localize('noKernel', "No Kernel"); diff --git a/src/sql/workbench/services/notebook/sql/sqlNotebookManager.ts b/src/sql/workbench/services/notebook/sql/sqlNotebookManager.ts index eada51bf24..fe2be454b4 100644 --- a/src/sql/workbench/services/notebook/sql/sqlNotebookManager.ts +++ b/src/sql/workbench/services/notebook/sql/sqlNotebookManager.ts @@ -8,16 +8,16 @@ import * as vscode from 'vscode'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { SQL_NOTEBOOK_PROVIDER } from 'sql/workbench/services/notebook/common/notebookService'; -import { LocalContentManager } from 'sql/workbench/services/notebook/node/localContentManager'; +import { LocalContentManager } from 'sql/workbench/services/notebook/common/localContentManager'; import { SqlSessionManager } from 'sql/workbench/services/notebook/sql/sqlSessionManager'; export class SqlNotebookManager implements nb.NotebookProvider { private _contentManager: nb.ContentManager; private _sessionManager: nb.SessionManager; - constructor(private _instantiationService: IInstantiationService) { - this._contentManager = new LocalContentManager(); - this._sessionManager = new SqlSessionManager(this._instantiationService); + constructor(instantiationService: IInstantiationService) { + this._contentManager = instantiationService.createInstance(LocalContentManager); + this._sessionManager = new SqlSessionManager(instantiationService); } public get providerId(): string { diff --git a/src/sql/workbench/services/notebook/sql/sqlSessionManager.ts b/src/sql/workbench/services/notebook/sql/sqlSessionManager.ts index 7f5c14e787..b249976592 100644 --- a/src/sql/workbench/services/notebook/sql/sqlSessionManager.ts +++ b/src/sql/workbench/services/notebook/sql/sqlSessionManager.ts @@ -6,7 +6,7 @@ import * as os from 'os'; import { nb, QueryExecuteSubsetResult, IDbColumn, BatchSummary, IResultMessage, ResultSetSummary } from 'azdata'; import { localize } from 'vs/nls'; -import { FutureInternal, notebookConstants } from 'sql/workbench/parts/notebook/node/models/modelInterfaces'; +import { FutureInternal, notebookConstants } from 'sql/workbench/parts/notebook/common/models/modelInterfaces'; import QueryRunner from 'sql/platform/query/common/queryRunner'; import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -17,7 +17,7 @@ import { IErrorMessageService } from 'sql/platform/errorMessage/common/errorMess import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile'; import { IConnectionProfile } from 'sql/platform/connection/common/interfaces'; import { escape } from 'sql/base/common/strings'; -import * as notebookUtils from 'sql/workbench/parts/notebook/node/models/notebookUtils'; +import * as notebookUtils from 'sql/workbench/parts/notebook/common/models/notebookUtils'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilitiesService'; import { ILogService } from 'vs/platform/log/common/log'; diff --git a/src/sql/workbench/test/electron-browser/api/mainThreadNotebook.test.ts b/src/sql/workbench/test/electron-browser/api/mainThreadNotebook.test.ts index 7badfd16c7..f00f950585 100644 --- a/src/sql/workbench/test/electron-browser/api/mainThreadNotebook.test.ts +++ b/src/sql/workbench/test/electron-browser/api/mainThreadNotebook.test.ts @@ -14,10 +14,12 @@ import { MainThreadNotebook } from 'sql/workbench/api/browser/mainThreadNotebook import { NotebookService } from 'sql/workbench/services/notebook/common/notebookServiceImpl'; import { INotebookProvider } from 'sql/workbench/services/notebook/common/notebookService'; import { INotebookManagerDetails, INotebookSessionDetails, INotebookKernelDetails, INotebookFutureDetails } from 'sql/workbench/api/common/sqlExtHostTypes'; -import { LocalContentManager } from 'sql/workbench/services/notebook/node/localContentManager'; +import { LocalContentManager } from 'sql/workbench/services/notebook/common/localContentManager'; import { TestLifecycleService } from 'vs/workbench/test/workbenchTestServices'; import { MockContextKeyService } from 'vs/platform/keybinding/test/common/mockKeybindingService'; import { ExtHostNotebookShape } from 'sql/workbench/api/common/sqlExtHost.protocol'; +import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; +import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; suite('MainThreadNotebook Tests', () => { @@ -32,9 +34,10 @@ suite('MainThreadNotebook Tests', () => { let extContext = { getProxy: proxyType => mockProxy.object }; - mockNotebookService = TypeMoq.Mock.ofType(NotebookService, undefined, new TestLifecycleService(), undefined, undefined, undefined, undefined, new MockContextKeyService()); + const instantiationService = new TestInstantiationService(); + mockNotebookService = TypeMoq.Mock.ofType(NotebookService, undefined, new TestLifecycleService(), undefined, undefined, undefined, instantiationService, new MockContextKeyService()); notebookUri = URI.parse('file:/user/default/my.ipynb'); - mainThreadNotebook = new MainThreadNotebook(extContext, mockNotebookService.object); + mainThreadNotebook = new MainThreadNotebook(extContext, mockNotebookService.object, instantiationService); }); suite('On registering a provider', () => { diff --git a/src/vs/workbench/common/editor/editorGroup.ts b/src/vs/workbench/common/editor/editorGroup.ts index 557d6a63c8..61304b3f0f 100644 --- a/src/vs/workbench/common/editor/editorGroup.ts +++ b/src/vs/workbench/common/editor/editorGroup.ts @@ -17,7 +17,7 @@ import { coalesce } from 'vs/base/common/arrays'; import { QueryInput } from 'sql/workbench/parts/query/common/queryInput'; import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput'; import * as CustomInputConverter from 'sql/workbench/common/customInputConverter'; -import { NotebookInput } from 'sql/workbench/parts/notebook/node/notebookInput'; +import { NotebookInput } from 'sql/workbench/parts/notebook/common/models/notebookInput'; import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput'; import * as path from 'path'; import * as os from 'os'; diff --git a/src/vs/workbench/contrib/watermark/browser/watermark.ts b/src/vs/workbench/contrib/watermark/browser/watermark.ts index 45ad240c98..ed9bdc01ea 100644 --- a/src/vs/workbench/contrib/watermark/browser/watermark.ts +++ b/src/vs/workbench/contrib/watermark/browser/watermark.ts @@ -31,7 +31,7 @@ import { IDimension } from 'vs/platform/layout/browser/layoutService'; // {{SQL CARBON EDIT}} import { OpenDataExplorerViewletAction } from 'sql/workbench/parts/dataExplorer/browser/dataExplorer.contribution'; -import { NewNotebookAction } from 'sql/workbench/parts/notebook/electron-browser/notebookActions'; +import { NewNotebookAction } from 'sql/workbench/parts/notebook/browser/notebookActions'; const $ = dom.$; diff --git a/src/vs/workbench/workbench.main.ts b/src/vs/workbench/workbench.main.ts index f0492d7f94..4fa10015a4 100644 --- a/src/vs/workbench/workbench.main.ts +++ b/src/vs/workbench/workbench.main.ts @@ -515,7 +515,7 @@ import 'sql/workbench/browser/modelComponents/components.contribution'; /* View Model Editor */ import 'sql/workbench/browser/modelComponents/modelViewEditor.contribution'; /* Notebook Editor */ -import 'sql/workbench/parts/notebook/electron-browser/notebook.contribution'; +import 'sql/workbench/parts/notebook/browser/notebook.contribution'; /* Containers */ import 'sql/workbench/parts/dashboard/electron-browser/containers/dashboardWebviewContainer.contribution'; import 'sql/workbench/parts/dashboard/browser/containers/dashboardControlHostContainer.contribution';