From 5e3ec6ea39b88bf57ce8b06de213730b9caf0d63 Mon Sep 17 00:00:00 2001 From: Anthony Dresser Date: Mon, 23 Sep 2019 13:32:29 -0700 Subject: [PATCH] moves notebooks code to browser (#7313) --- .../cellViews/media/highlight.css | 0 .../cellViews/media/markdown.css | 0 .../cellViews/textCell.component.html | 0 .../cellViews/textCell.component.ts | 2 +- .../cellViews/textCell.css | 0 ...ntribution.ts => notebook.contribution.ts} | 19 ++++++++++++++-- .../outputs/markdownOutput.component.html | 0 .../outputs/markdownOutput.component.ts | 2 +- .../outputs/notebookMarkdown.ts | 0 .../electron-browser/notebook.contribution.ts | 22 ------------------- src/vs/workbench/workbench.desktop.main.ts | 3 +-- 11 files changed, 20 insertions(+), 28 deletions(-) rename src/sql/workbench/parts/notebook/{electron-browser => browser}/cellViews/media/highlight.css (100%) rename src/sql/workbench/parts/notebook/{electron-browser => browser}/cellViews/media/markdown.css (100%) rename src/sql/workbench/parts/notebook/{electron-browser => browser}/cellViews/textCell.component.html (100%) rename src/sql/workbench/parts/notebook/{electron-browser => browser}/cellViews/textCell.component.ts (99%) rename src/sql/workbench/parts/notebook/{electron-browser => browser}/cellViews/textCell.css (100%) rename src/sql/workbench/parts/notebook/browser/{notebook.common.contribution.ts => notebook.contribution.ts} (94%) rename src/sql/workbench/parts/notebook/{electron-browser => browser}/outputs/markdownOutput.component.html (100%) rename src/sql/workbench/parts/notebook/{electron-browser => browser}/outputs/markdownOutput.component.ts (99%) rename src/sql/workbench/parts/notebook/{electron-browser => browser}/outputs/notebookMarkdown.ts (100%) delete mode 100644 src/sql/workbench/parts/notebook/electron-browser/notebook.contribution.ts 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/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/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 99% 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 9f28bbe568..48dfa2f178 100644 --- a/src/sql/workbench/parts/notebook/electron-browser/cellViews/textCell.component.ts +++ b/src/sql/workbench/parts/notebook/browser/cellViews/textCell.component.ts @@ -21,7 +21,7 @@ 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/electron-browser/outputs/notebookMarkdown'; +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/browser/models/modelInterfaces'; import { NotebookModel } from 'sql/workbench/parts/notebook/browser/models/notebookModel'; 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/browser/notebook.common.contribution.ts b/src/sql/workbench/parts/notebook/browser/notebook.contribution.ts similarity index 94% rename from src/sql/workbench/parts/notebook/browser/notebook.common.contribution.ts rename to src/sql/workbench/parts/notebook/browser/notebook.contribution.ts index 4b53573c5d..b9afa5dc40 100644 --- a/src/sql/workbench/parts/notebook/browser/notebook.common.contribution.ts +++ b/src/sql/workbench/parts/notebook/browser/notebook.contribution.ts @@ -23,12 +23,11 @@ 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 { IWindowService } from 'vs/platform/windows/common/windows'; -import { IViewContainersRegistry, Extensions as ViewContainerExtensions, ViewContainer } from 'vs/workbench/common/views'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { NodeContextKey } from 'sql/workbench/parts/dataExplorer/browser/nodeContext'; import { MssqlNodeContext } from 'sql/workbench/parts/dataExplorer/browser/mssqlNodeContext'; import { mssqlProviderName } from 'sql/platform/connection/common/constants'; -import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands'; +import { CommandsRegistry } from 'vs/platform/commands/common/commands'; import { TreeViewItemHandleArg } from 'sql/workbench/common/views'; import { ConnectedContext } from 'azdata'; import { TreeNodeContextKey } from 'sql/workbench/parts/objectExplorer/common/treeNodeContextKey'; @@ -36,6 +35,9 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { ObjectExplorerActionsContext } from 'sql/workbench/parts/objectExplorer/browser/objectExplorerActions'; import { ItemContextKey } from 'sql/workbench/parts/dashboard/browser/widgets/explorer/explorerTreeContext'; import { ManageActionContext } from 'sql/workbench/browser/actions'; +import { MarkdownOutputComponent } from 'sql/workbench/parts/notebook/browser/outputs/markdownOutput.component'; +import { registerCellComponent } from 'sql/platform/notebooks/common/outputRegistry'; +import { TextCellComponent } from 'sql/workbench/parts/notebook/browser/cellViews/textCell.component'; // Model View editor registration const viewModelEditorDescriptor = new EditorDescriptor( @@ -278,3 +280,16 @@ registerComponentType({ ctor: PlotlyOutputComponent, selector: PlotlyOutputComponent.SELECTOR }); + +/** + * A mime renderer component for Markdown. + */ +registerComponentType({ + mimeTypes: ['text/markdown'], + rank: 60, + safe: true, + ctor: MarkdownOutputComponent, + selector: MarkdownOutputComponent.SELECTOR +}); + +registerCellComponent(TextCellComponent); 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 99% 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 ae4a68cdc2..ec1d6944b3 100644 --- a/src/sql/workbench/parts/notebook/electron-browser/outputs/markdownOutput.component.ts +++ b/src/sql/workbench/parts/notebook/browser/outputs/markdownOutput.component.ts @@ -15,7 +15,7 @@ import { IMimeComponent } from 'sql/workbench/parts/notebook/browser/outputs/mim import { INotebookService } from 'sql/workbench/services/notebook/browser/notebookService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { NotebookMarkdownRenderer } from 'sql/workbench/parts/notebook/electron-browser/outputs/notebookMarkdown'; +import { NotebookMarkdownRenderer } from 'sql/workbench/parts/notebook/browser/outputs/notebookMarkdown'; import { MimeModel } from 'sql/workbench/parts/notebook/browser/models/mimemodel'; import { ICellModel } from 'sql/workbench/parts/notebook/browser/models/modelInterfaces'; import { useInProcMarkdown, convertVscodeResourceToFileInSubDirectories } from 'sql/workbench/parts/notebook/browser/models/notebookUtils'; diff --git a/src/sql/workbench/parts/notebook/electron-browser/outputs/notebookMarkdown.ts b/src/sql/workbench/parts/notebook/browser/outputs/notebookMarkdown.ts similarity index 100% rename from src/sql/workbench/parts/notebook/electron-browser/outputs/notebookMarkdown.ts rename to src/sql/workbench/parts/notebook/browser/outputs/notebookMarkdown.ts diff --git a/src/sql/workbench/parts/notebook/electron-browser/notebook.contribution.ts b/src/sql/workbench/parts/notebook/electron-browser/notebook.contribution.ts deleted file mode 100644 index 9c454fc4f1..0000000000 --- a/src/sql/workbench/parts/notebook/electron-browser/notebook.contribution.ts +++ /dev/null @@ -1,22 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the Source EULA. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { registerComponentType } from 'sql/workbench/parts/notebook/browser/outputs/mimeRegistry'; -import { MarkdownOutputComponent } from 'sql/workbench/parts/notebook/electron-browser/outputs/markdownOutput.component'; -import { registerCellComponent } from 'sql/platform/notebooks/common/outputRegistry'; -import { TextCellComponent } from 'sql/workbench/parts/notebook/electron-browser/cellViews/textCell.component'; - -/** - * A mime renderer component for Markdown. - */ -registerComponentType({ - mimeTypes: ['text/markdown'], - rank: 60, - safe: true, - ctor: MarkdownOutputComponent, - selector: MarkdownOutputComponent.SELECTOR -}); - -registerCellComponent(TextCellComponent); \ No newline at end of file diff --git a/src/vs/workbench/workbench.desktop.main.ts b/src/vs/workbench/workbench.desktop.main.ts index 19ab8df13a..87d5325169 100644 --- a/src/vs/workbench/workbench.desktop.main.ts +++ b/src/vs/workbench/workbench.desktop.main.ts @@ -329,8 +329,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/browser/notebook.common.contribution'; -import 'sql/workbench/parts/notebook/electron-browser/notebook.contribution'; +import 'sql/workbench/parts/notebook/browser/notebook.contribution'; /* Containers */ import 'sql/workbench/parts/dashboard/browser/containers/dashboardWebviewContainer.contribution'; import 'sql/workbench/parts/dashboard/browser/containers/dashboardControlHostContainer.contribution';