From 7aec40aec931a5922b3a00d86c36d4d1165409e8 Mon Sep 17 00:00:00 2001 From: Ian Huff Date: Mon, 4 Nov 2019 10:37:19 -0800 Subject: [PATCH 1/2] simplify remote URI specification and clear up wording --- news/2 Fixes/8021.md | 1 + package.json | 7 ++ package.nls.json | 6 +- package.nls.nl.json | 4 -- src/client/common/types.ts | 1 + src/client/common/utils/localize.ts | 4 +- src/client/datascience/datascience.ts | 67 +++++++++---------- .../interactive-ipynb/nativeEditorProvider.ts | 2 +- .../interactiveWindowProvider.ts | 2 +- .../react-common/settingsReactSide.ts | 1 + .../configSettings.unit.test.ts | 1 + src/test/datascience/color.test.ts | 1 + .../datascience/dataScienceIocContainer.ts | 1 + .../datascience/debugger.functional.test.tsx | 2 +- .../codewatcher.unit.test.ts | 1 + src/test/datascience/execution.unit.test.ts | 7 +- ...eractiveWindowCommandListener.unit.test.ts | 1 + src/test/datascience/reactHelpers.ts | 1 + src/test/datascience/testHelpers.tsx | 1 + 19 files changed, 57 insertions(+), 54 deletions(-) create mode 100644 news/2 Fixes/8021.md diff --git a/news/2 Fixes/8021.md b/news/2 Fixes/8021.md new file mode 100644 index 000000000000..479b3442d628 --- /dev/null +++ b/news/2 Fixes/8021.md @@ -0,0 +1 @@ +Clear up wording around jupyterServerURI and remove the quick pick from the flow of setting that. \ No newline at end of file diff --git a/package.json b/package.json index 6803d0f35d7d..2691dc92f07d 100644 --- a/package.json +++ b/package.json @@ -1527,6 +1527,13 @@ "type": "string", "default": "local", "description": "Select the Jupyter server URI to connect to. Select 'local' to launch a new Jupyter server on the local machine.", + "deprecationMessage": "This setting has been deprecated in favor of 'remoteJupyterServerURI'.", + "scope": "resource" + }, + "python.dataScience.remoteJupyterServerURI": { + "type": "string", + "default": "local", + "description": "When a Notebook Editor or Interactive Window session is started, create the kernel on the specified Jupyter server. Select 'local' to create a new Jupyter server on this local machine.", "scope": "resource" }, "python.dataScience.notebookFileRoot": { diff --git a/package.nls.json b/package.nls.json index d30f4e203bc7..82e5a93fa5e5 100644 --- a/package.nls.json +++ b/package.nls.json @@ -50,7 +50,7 @@ "python.command.python.datascience.execSelectionInteractive.title": "Run Selection/Line in Python Interactive Window", "python.command.python.datascience.runcell.title": "Run Cell", "python.command.python.datascience.showhistorypane.title": "Show Python Interactive Window", - "python.command.python.datascience.selectjupyteruri.title": "Specify Jupyter Server URI", + "python.command.python.datascience.selectjupyteruri.title": "Specify local or remote Jupyter server for connections", "python.command.python.datascience.importnotebook.title": "Import Jupyter Notebook", "python.command.python.datascience.opennotebook.title": "Open in Notebook Editor", "python.command.python.datascience.importnotebookfile.title": "Convert to Python Script", @@ -184,9 +184,7 @@ "Linter.replaceWithSelectedLinter": "Multiple linters are enabled in settings. Replace with '{0}'?", "DataScience.libraryNotInstalled": "Data Science library {0} is not installed. Install?", "DataScience.jupyterInstall": "Install", - "DataScience.jupyterSelectURILaunchLocal": "Launch a local Jupyter server when needed", - "DataScience.jupyterSelectURISpecifyURI": "Type in the URI to connect to a running Jupyter server", - "DataScience.jupyterSelectURIPrompt": "Enter the URI of a Jupyter server", + "DataScience.jupyterSelectURIPrompt": "Enter the URI of the running Jupyter server or specify 'local' to create one locally when needed", "DataScience.jupyterSelectURIInvalidURI": "Invalid URI specified", "DataScience.jupyterSelectPasswordPrompt": "Enter your notebook password", "DataScience.jupyterNotebookFailure": "Jupyter notebook failed to launch. \r\n{0}", diff --git a/package.nls.nl.json b/package.nls.nl.json index 4197ddaa9e75..fbd609feb622 100644 --- a/package.nls.nl.json +++ b/package.nls.nl.json @@ -98,10 +98,6 @@ "DataScience.pythonRestartHeader": "Kernel herstart:", "Linter.InstalledButNotEnabled": "Linter {0} is geinstalleerd maar niet ingeschakeld.", "Linter.replaceWithSelectedLinter": "Meerdere linters zijn ingeschakeld in de instellingen. Vervangen met '{0}'?", - "DataScience.jupyterSelectURILaunchLocal": "Een lokale Jupyter-server starten wanneer nodig", - "DataScience.jupyterSelectURISpecifyURI": "Voer de URI in om te verbinden met een draaiende Jupiter-server", - "DataScience.jupyterSelectURIPrompt": "Voer de URI in van een Jupiter-server", - "DataScience.jupyterSelectURIInvalidURI": "Ongeldige URI gespecificeerd", "DataScience.jupyterNotebookFailure": "Jupyter-notebook kon niet starten. \r\n{0}", "DataScience.jupyterNotebookConnectFailed": "Verbinden met Jupiter-notebook is niet gelukt. \r\n{0}\r\n{1}", "DataScience.notebookVersionFormat": "Jupyter-notebook versie: {0}", diff --git a/src/client/common/types.ts b/src/client/common/types.ts index f7c391103f6d..304096a14b0b 100644 --- a/src/client/common/types.ts +++ b/src/client/common/types.ts @@ -358,6 +358,7 @@ export interface IDataScienceSettings { defaultCellMarker?: string; verboseLogging?: boolean; themeMatplotlibPlots?: boolean; + remoteJupyterServerURI?: string; } export const IConfigurationService = Symbol('IConfigurationService'); diff --git a/src/client/common/utils/localize.ts b/src/client/common/utils/localize.ts index e57898002f11..d37757ee5286 100644 --- a/src/client/common/utils/localize.ts +++ b/src/client/common/utils/localize.ts @@ -177,9 +177,7 @@ export namespace DataScience { export const pythonNewHeader = localize('DataScience.pythonNewHeader', 'Started new kernel:'); export const pythonVersionHeaderNoPyKernel = localize('DataScience.pythonVersionHeaderNoPyKernel', 'Python Version may not match, no ipykernel found:'); - export const jupyterSelectURILaunchLocal = localize('DataScience.jupyterSelectURILaunchLocal', 'Launch local Jupyter server'); - export const jupyterSelectURISpecifyURI = localize('DataScience.jupyterSelectURISpecifyURI', 'Type in the URI for the Jupyter server'); - export const jupyterSelectURIPrompt = localize('DataScience.jupyterSelectURIPrompt', 'Enter the URI of a Jupyter server'); + export const jupyterSelectURIPrompt = localize('DataScience.jupyterSelectURIPrompt', 'Enter the URI of the running Jupyter server or specify "local" to create one locally when needed'); export const jupyterSelectURIInvalidURI = localize('DataScience.jupyterSelectURIInvalidURI', 'Invalid URI specified'); export const jupyterSelectPasswordPrompt = localize('DataScience.jupyterSelectPasswordPrompt', 'Enter your notebook password'); export const jupyterNotebookFailure = localize('DataScience.jupyterNotebookFailure', 'Jupyter notebook failed to launch. \r\n{0}'); diff --git a/src/client/datascience/datascience.ts b/src/client/datascience/datascience.ts index dc32a43b9b76..0b1a18afe5cf 100644 --- a/src/client/datascience/datascience.ts +++ b/src/client/datascience/datascience.ts @@ -218,18 +218,15 @@ export class DataScience implements IDataScience { @captureTelemetry(Telemetry.SelectJupyterURI) public async selectJupyterURI(): Promise { - const quickPickOptions = [localize.DataScience.jupyterSelectURILaunchLocal(), localize.DataScience.jupyterSelectURISpecifyURI()]; - const selection = await this.appShell.showQuickPick(quickPickOptions, { ignoreFocusOut: true }); - switch (selection) { - case localize.DataScience.jupyterSelectURILaunchLocal(): - return this.setJupyterURIToLocal(); - break; - case localize.DataScience.jupyterSelectURISpecifyURI(): - return this.selectJupyterLaunchURI(); - break; - default: - // If user cancels quick pick we will get undefined as the selection and fall through here - break; + const userURI = await this.appShell.showInputBox({ + prompt: localize.DataScience.jupyterSelectURIPrompt(), + placeHolder: 'local OR https://hostname:8080/?token=849d61a414abafab97bc4aab1f3547755ddc232c2b8cb7fe', validateInput: this.validateSelectJupyterURI, ignoreFocusOut: true + }); + + if (userURI && userURI.toUpperCase() === 'LOCAL') { + await this.setJupyterURIToLocal(); + } else if (userURI) { + await this.setJupyterURIToRemote(userURI); } } @@ -274,23 +271,31 @@ export class DataScience implements IDataScience { this.commandManager.executeCommand('workbench.action.debug.continue'); } } + private validateSelectJupyterURI = (inputText: string): string | undefined | null => { + // First check if the input is 'local' specifically checking against local so culture less comparison is fine + if (inputText.toUpperCase() === 'LOCAL') { + return null; + } + + try { + // tslint:disable-next-line:no-unused-expression + new URL(inputText); + } catch { + return localize.DataScience.jupyterSelectURIInvalidURI(); + } + + // Return null tells the dialog that our string is valid + return null; + } @captureTelemetry(Telemetry.SetJupyterURIToLocal) private async setJupyterURIToLocal(): Promise { - await this.configuration.updateSetting('dataScience.jupyterServerURI', Settings.JupyterServerLocalLaunch, undefined, vscode.ConfigurationTarget.Workspace); + await this.configuration.updateSetting('dataScience.remoteJupyterServerURI', Settings.JupyterServerLocalLaunch, undefined, vscode.ConfigurationTarget.Workspace); } @captureTelemetry(Telemetry.SetJupyterURIToUserSpecified) - private async selectJupyterLaunchURI(): Promise { - // First get the proposed URI from the user - const userURI = await this.appShell.showInputBox({ - prompt: localize.DataScience.jupyterSelectURIPrompt(), - placeHolder: 'https://hostname:8080/?token=849d61a414abafab97bc4aab1f3547755ddc232c2b8cb7fe', validateInput: this.validateURI, ignoreFocusOut: true - }); - - if (userURI) { - await this.configuration.updateSetting('dataScience.jupyterServerURI', userURI, undefined, vscode.ConfigurationTarget.Workspace); - } + private async setJupyterURIToRemote(userURI: string): Promise { + await this.configuration.updateSetting('dataScience.remoteJupyterServerURI', userURI, undefined, vscode.ConfigurationTarget.Workspace); } @captureTelemetry(Telemetry.AddCellBelow) @@ -370,18 +375,6 @@ export class DataScience implements IDataScience { } } - private validateURI = (testURI: string): string | undefined | null => { - try { - // tslint:disable-next-line:no-unused-expression - new URL(testURI); - } catch { - return localize.DataScience.jupyterSelectURIInvalidURI(); - } - - // Return null tells the dialog that our string is valid - return null; - } - private onSettingsChanged = () => { const settings = this.configuration.getSettings(); const enabled = settings.datascience.enabled; @@ -512,9 +505,9 @@ export class DataScience implements IDataScience { } } @swallowExceptions('Error in sending DS Startup telemetry') - private sendStartupTelemetry(){ + private sendStartupTelemetry() { const filesConfig = this.workspace.getConfiguration('files'); - sendTelemetryEvent(Telemetry.AutoSaveEnabled, undefined, {enabled: filesConfig.get('autoSave', 'off') !== 'off'}); + sendTelemetryEvent(Telemetry.AutoSaveEnabled, undefined, { enabled: filesConfig.get('autoSave', 'off') !== 'off' }); } private async createNewNotebook(): Promise { diff --git a/src/client/datascience/interactive-ipynb/nativeEditorProvider.ts b/src/client/datascience/interactive-ipynb/nativeEditorProvider.ts index 547ab066a6e2..d60578990403 100644 --- a/src/client/datascience/interactive-ipynb/nativeEditorProvider.ts +++ b/src/client/datascience/interactive-ipynb/nativeEditorProvider.ts @@ -115,7 +115,7 @@ export class NativeEditorProvider implements INotebookEditorProvider, IAsyncDisp public async getNotebookOptions(): Promise { const settings = this.configuration.getSettings(); - let serverURI: string | undefined = settings.datascience.jupyterServerURI; + let serverURI: string | undefined = settings.datascience.remoteJupyterServerURI; const useDefaultConfig: boolean | undefined = settings.datascience.useDefaultConfigForJupyter; // For the local case pass in our URI as undefined, that way connect doesn't have to check the setting diff --git a/src/client/datascience/interactive-window/interactiveWindowProvider.ts b/src/client/datascience/interactive-window/interactiveWindowProvider.ts index 893826a6ecfe..977fc756c524 100644 --- a/src/client/datascience/interactive-window/interactiveWindowProvider.ts +++ b/src/client/datascience/interactive-window/interactiveWindowProvider.ts @@ -80,7 +80,7 @@ export class InteractiveWindowProvider implements IInteractiveWindowProvider, IA public async getNotebookOptions(): Promise { // Find the settings that we are going to launch our server with const settings = this.configService.getSettings(); - let serverURI: string | undefined = settings.datascience.jupyterServerURI; + let serverURI: string | undefined = settings.datascience.remoteJupyterServerURI; const useDefaultConfig: boolean | undefined = settings.datascience.useDefaultConfigForJupyter; // For the local case pass in our URI as undefined, that way connect doesn't have to check the setting diff --git a/src/datascience-ui/react-common/settingsReactSide.ts b/src/datascience-ui/react-common/settingsReactSide.ts index 3802a64714d4..440c49457272 100644 --- a/src/datascience-ui/react-common/settingsReactSide.ts +++ b/src/datascience-ui/react-common/settingsReactSide.ts @@ -37,6 +37,7 @@ function load() { jupyterLaunchRetries: 3, enabled: true, jupyterServerURI: 'local', + remoteJupyterServerURI: 'local', notebookFileRoot: 'WORKSPACE', changeDirOnImportExport: true, useDefaultConfigForJupyter: true, diff --git a/src/test/common/configSettings/configSettings.unit.test.ts b/src/test/common/configSettings/configSettings.unit.test.ts index 7153912e1c24..a1ed3eddd6bd 100644 --- a/src/test/common/configSettings/configSettings.unit.test.ts +++ b/src/test/common/configSettings/configSettings.unit.test.ts @@ -250,6 +250,7 @@ suite('Python Settings', async () => { jupyterLaunchRetries: 3, enabled: true, jupyterServerURI: 'local', + remoteJupyterServerURI: 'local', // tslint:disable-next-line: no-invalid-template-strings notebookFileRoot: '${FileDirname}', changeDirOnImportExport: true, diff --git a/src/test/datascience/color.test.ts b/src/test/datascience/color.test.ts index 914e618cf4dc..8dee0071bc4b 100644 --- a/src/test/datascience/color.test.ts +++ b/src/test/datascience/color.test.ts @@ -54,6 +54,7 @@ suite('Theme colors', () => { jupyterLaunchRetries: 3, enabled: true, jupyterServerURI: 'local', + remoteJupyterServerURI: 'local', notebookFileRoot: 'WORKSPACE', changeDirOnImportExport: true, useDefaultConfigForJupyter: true, diff --git a/src/test/datascience/dataScienceIocContainer.ts b/src/test/datascience/dataScienceIocContainer.ts index dad51465c96b..4c3bbc3d5741 100644 --- a/src/test/datascience/dataScienceIocContainer.ts +++ b/src/test/datascience/dataScienceIocContainer.ts @@ -444,6 +444,7 @@ export class DataScienceIocContainer extends UnitTestIocContainer { jupyterLaunchRetries: 3, enabled: true, jupyterServerURI: 'local', + remoteJupyterServerURI: 'local', notebookFileRoot: 'WORKSPACE', changeDirOnImportExport: true, useDefaultConfigForJupyter: true, diff --git a/src/test/datascience/debugger.functional.test.tsx b/src/test/datascience/debugger.functional.test.tsx index cca923f9eb41..4fe983a6a78c 100644 --- a/src/test/datascience/debugger.functional.test.tsx +++ b/src/test/datascience/debugger.functional.test.tsx @@ -250,7 +250,7 @@ suite('DataScience Debugger tests', () => { const connString = await connectionFound.promise; const uri = connString as string; - ioc.getSettings().datascience.jupyterServerURI = uri; + ioc.getSettings().datascience.remoteJupyterServerURI = uri; // Debug with this setting should use the server URI await debugCell('#%%\nprint("bar")', undefined, undefined, true); diff --git a/src/test/datascience/editor-integration/codewatcher.unit.test.ts b/src/test/datascience/editor-integration/codewatcher.unit.test.ts index 09ef0f3b8499..ada8a5ea4dd1 100644 --- a/src/test/datascience/editor-integration/codewatcher.unit.test.ts +++ b/src/test/datascience/editor-integration/codewatcher.unit.test.ts @@ -75,6 +75,7 @@ suite('DataScience Code Watcher Unit Tests', () => { jupyterLaunchRetries: 3, enabled: true, jupyterServerURI: 'local', + remoteJupyterServerURI: 'local', notebookFileRoot: 'WORKSPACE', changeDirOnImportExport: true, useDefaultConfigForJupyter: true, diff --git a/src/test/datascience/execution.unit.test.ts b/src/test/datascience/execution.unit.test.ts index 65e7fe4497c7..92f16ae9bc54 100644 --- a/src/test/datascience/execution.unit.test.ts +++ b/src/test/datascience/execution.unit.test.ts @@ -573,7 +573,7 @@ suite('Jupyter Execution', async () => { when(workspaceService.onDidChangeConfiguration).thenReturn(configChangeEvent.event); when(application.withProgress(anything(), anything())).thenCall((_, cb: (_: any, token: any) => Promise) => { return new Promise((resolve, reject) => { - cb({report: noop}, new CancellationTokenSource().token).then(resolve).catch(reject); + cb({ report: noop }, new CancellationTokenSource().token).then(resolve).catch(reject); }); }); @@ -584,6 +584,7 @@ suite('Jupyter Execution', async () => { jupyterLaunchRetries: 3, enabled: true, jupyterServerURI: 'local', + remoteJupyterServerURI: 'local', notebookFileRoot: 'WORKSPACE', changeDirOnImportExport: true, useDefaultConfigForJupyter: true, @@ -751,7 +752,7 @@ suite('Jupyter Execution', async () => { reset(application); when(application.withProgress(anything(), anything())).thenCall((_, cb: (_: any, token: any) => Promise) => { return new Promise((resolve, reject) => { - cb({report: noop}, progressCancellation.token).then(resolve).catch(reject); + cb({ report: noop }, progressCancellation.token).then(resolve).catch(reject); }); }); @@ -770,7 +771,7 @@ suite('Jupyter Execution', async () => { reset(application); when(application.withProgress(anything(), anything())).thenCall((_, cb: (_: any, token: any) => Promise) => { return new Promise((resolve, reject) => { - cb({report: noop}, progressCancellation.token).then(resolve).catch(reject); + cb({ report: noop }, progressCancellation.token).then(resolve).catch(reject); }); }); diff --git a/src/test/datascience/interactiveWindowCommandListener.unit.test.ts b/src/test/datascience/interactiveWindowCommandListener.unit.test.ts index 743dc943aa80..e2a8ba8b1e28 100644 --- a/src/test/datascience/interactiveWindowCommandListener.unit.test.ts +++ b/src/test/datascience/interactiveWindowCommandListener.unit.test.ts @@ -125,6 +125,7 @@ suite('Interactive window command listener', async () => { jupyterLaunchRetries: 3, enabled: true, jupyterServerURI: '', + remoteJupyterServerURI: '', changeDirOnImportExport: true, notebookFileRoot: 'WORKSPACE', useDefaultConfigForJupyter: true, diff --git a/src/test/datascience/reactHelpers.ts b/src/test/datascience/reactHelpers.ts index d2b96ce4419f..244dc3f7af92 100644 --- a/src/test/datascience/reactHelpers.ts +++ b/src/test/datascience/reactHelpers.ts @@ -350,6 +350,7 @@ export function setUpDomEnvironment() { jupyterLaunchRetries: 3, enabled: true, jupyterServerURI: 'local', + remoteJupyterServerURI: 'local', notebookFileRoot: 'WORKSPACE', changeDirOnImportExport: true, useDefaultConfigForJupyter: true, diff --git a/src/test/datascience/testHelpers.tsx b/src/test/datascience/testHelpers.tsx index 44099f6f9675..41eda7f37a42 100644 --- a/src/test/datascience/testHelpers.tsx +++ b/src/test/datascience/testHelpers.tsx @@ -519,6 +519,7 @@ export function defaultDataScienceSettings(): IDataScienceSettings { jupyterLaunchRetries: 3, enabled: true, jupyterServerURI: 'local', + remoteJupyterServerURI: 'local', notebookFileRoot: 'WORKSPACE', changeDirOnImportExport: true, useDefaultConfigForJupyter: true, From d8de7110284124ba7000e0d288724627c80e9f81 Mon Sep 17 00:00:00 2001 From: Ian Huff Date: Mon, 4 Nov 2019 12:41:55 -0800 Subject: [PATCH 2/2] review feedback --- package.json | 7 ------- package.nls.json | 1 + src/client/common/types.ts | 1 - src/client/common/utils/localize.ts | 1 + src/client/datascience/datascience.ts | 6 +++--- .../datascience/interactive-ipynb/nativeEditorProvider.ts | 2 +- .../interactive-window/interactiveWindowProvider.ts | 2 +- src/datascience-ui/react-common/settingsReactSide.ts | 1 - src/test/common/configSettings/configSettings.unit.test.ts | 1 - src/test/datascience/color.test.ts | 1 - src/test/datascience/dataScienceIocContainer.ts | 1 - src/test/datascience/debugger.functional.test.tsx | 2 +- .../editor-integration/codewatcher.unit.test.ts | 1 - src/test/datascience/execution.unit.test.ts | 1 - .../interactiveWindowCommandListener.unit.test.ts | 1 - src/test/datascience/reactHelpers.ts | 1 - src/test/datascience/testHelpers.tsx | 1 - 17 files changed, 8 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index 2691dc92f07d..4e2a6d6ff99b 100644 --- a/package.json +++ b/package.json @@ -1524,13 +1524,6 @@ "scope": "resource" }, "python.dataScience.jupyterServerURI": { - "type": "string", - "default": "local", - "description": "Select the Jupyter server URI to connect to. Select 'local' to launch a new Jupyter server on the local machine.", - "deprecationMessage": "This setting has been deprecated in favor of 'remoteJupyterServerURI'.", - "scope": "resource" - }, - "python.dataScience.remoteJupyterServerURI": { "type": "string", "default": "local", "description": "When a Notebook Editor or Interactive Window session is started, create the kernel on the specified Jupyter server. Select 'local' to create a new Jupyter server on this local machine.", diff --git a/package.nls.json b/package.nls.json index 82e5a93fa5e5..628f0d09e94b 100644 --- a/package.nls.json +++ b/package.nls.json @@ -186,6 +186,7 @@ "DataScience.jupyterInstall": "Install", "DataScience.jupyterSelectURIPrompt": "Enter the URI of the running Jupyter server or specify 'local' to create one locally when needed", "DataScience.jupyterSelectURIInvalidURI": "Invalid URI specified", + "DataScience.jupyterSelectWatermarkFormat": "{0} OR {1}", "DataScience.jupyterSelectPasswordPrompt": "Enter your notebook password", "DataScience.jupyterNotebookFailure": "Jupyter notebook failed to launch. \r\n{0}", "DataScience.jupyterNotebookConnectFailed": "Failed to connect to Jupyter notebook. \r\n{0}\r\n{1}", diff --git a/src/client/common/types.ts b/src/client/common/types.ts index 304096a14b0b..f7c391103f6d 100644 --- a/src/client/common/types.ts +++ b/src/client/common/types.ts @@ -358,7 +358,6 @@ export interface IDataScienceSettings { defaultCellMarker?: string; verboseLogging?: boolean; themeMatplotlibPlots?: boolean; - remoteJupyterServerURI?: string; } export const IConfigurationService = Symbol('IConfigurationService'); diff --git a/src/client/common/utils/localize.ts b/src/client/common/utils/localize.ts index d37757ee5286..e904ead6130b 100644 --- a/src/client/common/utils/localize.ts +++ b/src/client/common/utils/localize.ts @@ -179,6 +179,7 @@ export namespace DataScience { export const jupyterSelectURIPrompt = localize('DataScience.jupyterSelectURIPrompt', 'Enter the URI of the running Jupyter server or specify "local" to create one locally when needed'); export const jupyterSelectURIInvalidURI = localize('DataScience.jupyterSelectURIInvalidURI', 'Invalid URI specified'); + export const jupyterSelectWatermarkFormat = localize('DataScience.jupyterSelectWatermarkFormat', '{0} OR {1}'); export const jupyterSelectPasswordPrompt = localize('DataScience.jupyterSelectPasswordPrompt', 'Enter your notebook password'); export const jupyterNotebookFailure = localize('DataScience.jupyterNotebookFailure', 'Jupyter notebook failed to launch. \r\n{0}'); export const jupyterNotebookConnectFailed = localize('DataScience.jupyterNotebookConnectFailed', 'Failed to connect to Jupyter notebook. \r\n{0}\r\n{1}'); diff --git a/src/client/datascience/datascience.ts b/src/client/datascience/datascience.ts index 0b1a18afe5cf..efdaaacce034 100644 --- a/src/client/datascience/datascience.ts +++ b/src/client/datascience/datascience.ts @@ -220,7 +220,7 @@ export class DataScience implements IDataScience { public async selectJupyterURI(): Promise { const userURI = await this.appShell.showInputBox({ prompt: localize.DataScience.jupyterSelectURIPrompt(), - placeHolder: 'local OR https://hostname:8080/?token=849d61a414abafab97bc4aab1f3547755ddc232c2b8cb7fe', validateInput: this.validateSelectJupyterURI, ignoreFocusOut: true + placeHolder: localize.DataScience.jupyterSelectWatermarkFormat().format('local', 'https://hostname:8080/?token=849d61a414abafab97bc4aab1f3547755ddc232c2b8cb7fe'), validateInput: this.validateSelectJupyterURI, ignoreFocusOut: true }); if (userURI && userURI.toUpperCase() === 'LOCAL') { @@ -290,12 +290,12 @@ export class DataScience implements IDataScience { @captureTelemetry(Telemetry.SetJupyterURIToLocal) private async setJupyterURIToLocal(): Promise { - await this.configuration.updateSetting('dataScience.remoteJupyterServerURI', Settings.JupyterServerLocalLaunch, undefined, vscode.ConfigurationTarget.Workspace); + await this.configuration.updateSetting('dataScience.jupyterServerURI', Settings.JupyterServerLocalLaunch, undefined, vscode.ConfigurationTarget.Workspace); } @captureTelemetry(Telemetry.SetJupyterURIToUserSpecified) private async setJupyterURIToRemote(userURI: string): Promise { - await this.configuration.updateSetting('dataScience.remoteJupyterServerURI', userURI, undefined, vscode.ConfigurationTarget.Workspace); + await this.configuration.updateSetting('dataScience.jupyterServerURI', userURI, undefined, vscode.ConfigurationTarget.Workspace); } @captureTelemetry(Telemetry.AddCellBelow) diff --git a/src/client/datascience/interactive-ipynb/nativeEditorProvider.ts b/src/client/datascience/interactive-ipynb/nativeEditorProvider.ts index d60578990403..547ab066a6e2 100644 --- a/src/client/datascience/interactive-ipynb/nativeEditorProvider.ts +++ b/src/client/datascience/interactive-ipynb/nativeEditorProvider.ts @@ -115,7 +115,7 @@ export class NativeEditorProvider implements INotebookEditorProvider, IAsyncDisp public async getNotebookOptions(): Promise { const settings = this.configuration.getSettings(); - let serverURI: string | undefined = settings.datascience.remoteJupyterServerURI; + let serverURI: string | undefined = settings.datascience.jupyterServerURI; const useDefaultConfig: boolean | undefined = settings.datascience.useDefaultConfigForJupyter; // For the local case pass in our URI as undefined, that way connect doesn't have to check the setting diff --git a/src/client/datascience/interactive-window/interactiveWindowProvider.ts b/src/client/datascience/interactive-window/interactiveWindowProvider.ts index 977fc756c524..893826a6ecfe 100644 --- a/src/client/datascience/interactive-window/interactiveWindowProvider.ts +++ b/src/client/datascience/interactive-window/interactiveWindowProvider.ts @@ -80,7 +80,7 @@ export class InteractiveWindowProvider implements IInteractiveWindowProvider, IA public async getNotebookOptions(): Promise { // Find the settings that we are going to launch our server with const settings = this.configService.getSettings(); - let serverURI: string | undefined = settings.datascience.remoteJupyterServerURI; + let serverURI: string | undefined = settings.datascience.jupyterServerURI; const useDefaultConfig: boolean | undefined = settings.datascience.useDefaultConfigForJupyter; // For the local case pass in our URI as undefined, that way connect doesn't have to check the setting diff --git a/src/datascience-ui/react-common/settingsReactSide.ts b/src/datascience-ui/react-common/settingsReactSide.ts index 440c49457272..3802a64714d4 100644 --- a/src/datascience-ui/react-common/settingsReactSide.ts +++ b/src/datascience-ui/react-common/settingsReactSide.ts @@ -37,7 +37,6 @@ function load() { jupyterLaunchRetries: 3, enabled: true, jupyterServerURI: 'local', - remoteJupyterServerURI: 'local', notebookFileRoot: 'WORKSPACE', changeDirOnImportExport: true, useDefaultConfigForJupyter: true, diff --git a/src/test/common/configSettings/configSettings.unit.test.ts b/src/test/common/configSettings/configSettings.unit.test.ts index a1ed3eddd6bd..7153912e1c24 100644 --- a/src/test/common/configSettings/configSettings.unit.test.ts +++ b/src/test/common/configSettings/configSettings.unit.test.ts @@ -250,7 +250,6 @@ suite('Python Settings', async () => { jupyterLaunchRetries: 3, enabled: true, jupyterServerURI: 'local', - remoteJupyterServerURI: 'local', // tslint:disable-next-line: no-invalid-template-strings notebookFileRoot: '${FileDirname}', changeDirOnImportExport: true, diff --git a/src/test/datascience/color.test.ts b/src/test/datascience/color.test.ts index 8dee0071bc4b..914e618cf4dc 100644 --- a/src/test/datascience/color.test.ts +++ b/src/test/datascience/color.test.ts @@ -54,7 +54,6 @@ suite('Theme colors', () => { jupyterLaunchRetries: 3, enabled: true, jupyterServerURI: 'local', - remoteJupyterServerURI: 'local', notebookFileRoot: 'WORKSPACE', changeDirOnImportExport: true, useDefaultConfigForJupyter: true, diff --git a/src/test/datascience/dataScienceIocContainer.ts b/src/test/datascience/dataScienceIocContainer.ts index 4c3bbc3d5741..dad51465c96b 100644 --- a/src/test/datascience/dataScienceIocContainer.ts +++ b/src/test/datascience/dataScienceIocContainer.ts @@ -444,7 +444,6 @@ export class DataScienceIocContainer extends UnitTestIocContainer { jupyterLaunchRetries: 3, enabled: true, jupyterServerURI: 'local', - remoteJupyterServerURI: 'local', notebookFileRoot: 'WORKSPACE', changeDirOnImportExport: true, useDefaultConfigForJupyter: true, diff --git a/src/test/datascience/debugger.functional.test.tsx b/src/test/datascience/debugger.functional.test.tsx index 4fe983a6a78c..cca923f9eb41 100644 --- a/src/test/datascience/debugger.functional.test.tsx +++ b/src/test/datascience/debugger.functional.test.tsx @@ -250,7 +250,7 @@ suite('DataScience Debugger tests', () => { const connString = await connectionFound.promise; const uri = connString as string; - ioc.getSettings().datascience.remoteJupyterServerURI = uri; + ioc.getSettings().datascience.jupyterServerURI = uri; // Debug with this setting should use the server URI await debugCell('#%%\nprint("bar")', undefined, undefined, true); diff --git a/src/test/datascience/editor-integration/codewatcher.unit.test.ts b/src/test/datascience/editor-integration/codewatcher.unit.test.ts index ada8a5ea4dd1..09ef0f3b8499 100644 --- a/src/test/datascience/editor-integration/codewatcher.unit.test.ts +++ b/src/test/datascience/editor-integration/codewatcher.unit.test.ts @@ -75,7 +75,6 @@ suite('DataScience Code Watcher Unit Tests', () => { jupyterLaunchRetries: 3, enabled: true, jupyterServerURI: 'local', - remoteJupyterServerURI: 'local', notebookFileRoot: 'WORKSPACE', changeDirOnImportExport: true, useDefaultConfigForJupyter: true, diff --git a/src/test/datascience/execution.unit.test.ts b/src/test/datascience/execution.unit.test.ts index 92f16ae9bc54..c8b063f3a690 100644 --- a/src/test/datascience/execution.unit.test.ts +++ b/src/test/datascience/execution.unit.test.ts @@ -584,7 +584,6 @@ suite('Jupyter Execution', async () => { jupyterLaunchRetries: 3, enabled: true, jupyterServerURI: 'local', - remoteJupyterServerURI: 'local', notebookFileRoot: 'WORKSPACE', changeDirOnImportExport: true, useDefaultConfigForJupyter: true, diff --git a/src/test/datascience/interactiveWindowCommandListener.unit.test.ts b/src/test/datascience/interactiveWindowCommandListener.unit.test.ts index e2a8ba8b1e28..743dc943aa80 100644 --- a/src/test/datascience/interactiveWindowCommandListener.unit.test.ts +++ b/src/test/datascience/interactiveWindowCommandListener.unit.test.ts @@ -125,7 +125,6 @@ suite('Interactive window command listener', async () => { jupyterLaunchRetries: 3, enabled: true, jupyterServerURI: '', - remoteJupyterServerURI: '', changeDirOnImportExport: true, notebookFileRoot: 'WORKSPACE', useDefaultConfigForJupyter: true, diff --git a/src/test/datascience/reactHelpers.ts b/src/test/datascience/reactHelpers.ts index 244dc3f7af92..d2b96ce4419f 100644 --- a/src/test/datascience/reactHelpers.ts +++ b/src/test/datascience/reactHelpers.ts @@ -350,7 +350,6 @@ export function setUpDomEnvironment() { jupyterLaunchRetries: 3, enabled: true, jupyterServerURI: 'local', - remoteJupyterServerURI: 'local', notebookFileRoot: 'WORKSPACE', changeDirOnImportExport: true, useDefaultConfigForJupyter: true, diff --git a/src/test/datascience/testHelpers.tsx b/src/test/datascience/testHelpers.tsx index 41eda7f37a42..44099f6f9675 100644 --- a/src/test/datascience/testHelpers.tsx +++ b/src/test/datascience/testHelpers.tsx @@ -519,7 +519,6 @@ export function defaultDataScienceSettings(): IDataScienceSettings { jupyterLaunchRetries: 3, enabled: true, jupyterServerURI: 'local', - remoteJupyterServerURI: 'local', notebookFileRoot: 'WORKSPACE', changeDirOnImportExport: true, useDefaultConfigForJupyter: true,