From d9c383b2ef1b369d231fdde352f548523d6c9b22 Mon Sep 17 00:00:00 2001 From: Kevin Cunnane Date: Thu, 31 Jan 2019 09:34:50 -0800 Subject: [PATCH] Remove notebook.enabled feature flag (#3866) * Remove notebook.enabled feature flag * Fix build error with package.json typos --- extensions/notebook/package.json | 14 +++----------- extensions/notebook/package.nls.json | 1 - src/sql/parts/common/customInputConverter.ts | 5 ++--- src/sql/parts/notebook/notebookInput.ts | 11 ----------- 4 files changed, 5 insertions(+), 26 deletions(-) diff --git a/extensions/notebook/package.json b/extensions/notebook/package.json index 272d13f4e4..5b898dbede 100644 --- a/extensions/notebook/package.json +++ b/extensions/notebook/package.json @@ -17,11 +17,6 @@ "type": "object", "title": "%notebook.configuration.title%", "properties": { - "notebook.enabled": { - "type": "boolean", - "default": true, - "description": "%notebook.enabled.description%" - }, "notebook.pythonPath": { "type": "string", "default": "", @@ -55,20 +50,17 @@ "menus": { "commandPalette": [ { - "command": "notebook.command.new", - "when": "config.notebook.enabled" + "command": "notebook.command.new" }, { - "command": "notebook.command.open", - "when": "config.notebook.enabled" + "command": "notebook.command.open" } ] }, "keybindings": [ { "command": "notebook.command.new", - "key": "Ctrl+Shift+N", - "when": "config.notebook.enabled" + "key": "Ctrl+Shift+N" } ] }, diff --git a/extensions/notebook/package.nls.json b/extensions/notebook/package.nls.json index 00117d89c0..4334f80597 100644 --- a/extensions/notebook/package.nls.json +++ b/extensions/notebook/package.nls.json @@ -2,7 +2,6 @@ "displayName": "Notebook Core Extensions", "description": "Defines the Data-procotol based Notebook contribution and many Notebook commands and contributions.", "notebook.configuration.title": "Notebook configuration", - "notebook.enabled.description": "Enable viewing notebook files using built-in notebook editor.", "notebook.pythonPath.description": "Local path to python installation used by Notebooks.", "notebook.sqlKernelEnabled.description": "Enable SQL kernel in notebook editor (Preview)", "notebook.command.new": "New Notebook", diff --git a/src/sql/parts/common/customInputConverter.ts b/src/sql/parts/common/customInputConverter.ts index 4274b7f516..aeb3393240 100644 --- a/src/sql/parts/common/customInputConverter.ts +++ b/src/sql/parts/common/customInputConverter.ts @@ -13,7 +13,7 @@ import { QueryResultsInput } from 'sql/parts/query/common/queryResultsInput'; import { QueryInput } from 'sql/parts/query/common/queryInput'; import { IQueryEditorOptions } from 'sql/parts/query/common/queryEditorService'; import { QueryPlanInput } from 'sql/parts/queryPlan/queryPlanInput'; -import { NotebookInput, NotebookInputModel, NotebookInputValidator } from 'sql/parts/notebook/notebookInput'; +import { NotebookInput, NotebookInputModel } from 'sql/parts/notebook/notebookInput'; import { DEFAULT_NOTEBOOK_PROVIDER, INotebookService } from 'sql/workbench/services/notebook/common/notebookService'; import { getProvidersForFileName, getStandardKernelsForProvider } from 'sql/parts/notebook/notebookUtils'; import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput'; @@ -56,9 +56,8 @@ export function convertEditorInput(input: EditorInput, options: IQueryEditorOpti } //Notebook - let notebookValidator = instantiationService.createInstance(NotebookInputValidator); uri = getNotebookEditorUri(input, instantiationService); - if (uri && notebookValidator.isNotebookEnabled()) { + if (uri) { return withService(instantiationService, INotebookService, notebookService => { let fileName: string = 'untitled'; let providerIds: string[] = [DEFAULT_NOTEBOOK_PROVIDER]; diff --git a/src/sql/parts/notebook/notebookInput.ts b/src/sql/parts/notebook/notebookInput.ts index d30d9b0607..d35b5457e4 100644 --- a/src/sql/parts/notebook/notebookInput.ts +++ b/src/sql/parts/notebook/notebookInput.ts @@ -11,7 +11,6 @@ import { IEditorModel } from 'vs/platform/editor/common/editor'; import { EditorInput, EditorModel, ConfirmResult } from 'vs/workbench/common/editor'; import { Emitter, Event } from 'vs/base/common/event'; import URI from 'vs/base/common/uri'; -import { IContextKeyService, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import * as resources from 'vs/base/common/resources'; import * as sqlops from 'sqlops'; @@ -22,8 +21,6 @@ import Severity from 'vs/base/common/severity'; export type ModeViewSaveHandler = (handle: number) => Thenable; -export let notebooksEnabledCondition = ContextKeyExpr.equals('config.notebook.enabled', true); - export class NotebookInputModel extends EditorModel { private dirty: boolean; @@ -105,14 +102,6 @@ export class NotebookInputModel extends EditorModel { } } -export class NotebookInputValidator { - - constructor( @IContextKeyService private readonly _contextKeyService: IContextKeyService) { } - - public isNotebookEnabled(): boolean { - return this._contextKeyService.contextMatchesRules(notebooksEnabledCondition); - } -} export class NotebookInput extends EditorInput {