diff --git a/package.nls.json b/package.nls.json index 8d8c2362f4c3..e3cd702d313a 100644 --- a/package.nls.json +++ b/package.nls.json @@ -143,11 +143,11 @@ "debug.selectConfigurationTitle": "Select a debug configuration", "debug.selectConfigurationPlaceholder": "Debug Configuration", "debug.debugFileConfigurationLabel": "Python File", - "debug.debugFileConfigurationDescription": "Debug python file", + "debug.debugFileConfigurationDescription": "Debug Python file", "debug.debugModuleConfigurationLabel": "Module", "debug.debugModuleConfigurationDescription": "Debug Python module/package", "debug.remoteAttachConfigurationLabel": "Remote Attach", - "debug.remoteAttachConfigurationDescription": "Debug a remote python program", + "debug.remoteAttachConfigurationDescription": "Debug a remote Python program", "debug.debugDjangoConfigurationLabel": "Django", "debug.debugDjangoConfigurationDescription": "Web Application", "debug.debugFlaskConfigurationLabel": "Flask", @@ -155,10 +155,10 @@ "debug.debugPyramidConfigurationLabel": "Pyramid", "debug.debugPyramidConfigurationDescription": "Web Application", "debug.djangoEnterManagePyPathTitle": "Debug Django", - "debug.djangoEnterManagePyPathPrompt": "Enter path to manage.py", - "debug.djangoEnterManagePyPathInvalidFilePathError": "Enter a valid python file path", + "debug.djangoEnterManagePyPathPrompt": "Enter path to manage.py ('${workspaceFolderToken}' points to the root of the current workspace folder)", + "debug.djangoEnterManagePyPathInvalidFilePathError": "Enter a valid Python file path", "debug.flaskEnterAppPathOrNamePathTitle": "Debug Flask", - "debug.flaskEnterAppPathOrNamePathPrompt": "Enter path to Application, e.g. 'app.py' or 'app'", + "debug.flaskEnterAppPathOrNamePathPrompt": "Enter path to application, e.g. 'app.py' or 'app'", "debug.flaskEnterAppPathOrNamePathInvalidNameError": "Enter a valid name", "debug.moduleEnterModuleTitle": "Debug Module", "debug.moduleEnterModulePrompt": "Enter Python module/package name", @@ -167,9 +167,9 @@ "debug.pyramidEnterDevelopmentIniPathPrompt": "`Enter path to development.ini ('${workspaceFolderToken}' points to the root of the current workspace folder)`", "debug.pyramidEnterDevelopmentIniPathInvalidFilePathError": "Enter a valid file path", "debug.attachRemotePortTitle": "Remote Debugging", - "debug.attachRemotePortPrompt": "Enter Port Number", - "debug.attachRemotePortValidationError": "Enter a valid Port Number", + "debug.attachRemotePortPrompt": "Enter port number", + "debug.attachRemotePortValidationError": "Enter a valid port number", "debug.attachRemoteHostTitle": "Remote Debugging", - "debug.attachRemoteHostPrompt": "Enter Host Name", - "debug.attachRemoteHostValidationError": "Enter a Host Name or IP Address" + "debug.attachRemoteHostPrompt": "Enter a host name or IP address", + "debug.attachRemoteHostValidationError": "Enter a valid host name or IP address" } diff --git a/src/client/common/utils/localize.ts b/src/client/common/utils/localize.ts index eb98f1e0d4f0..5fcb192fed11 100644 --- a/src/client/common/utils/localize.ts +++ b/src/client/common/utils/localize.ts @@ -105,15 +105,15 @@ export namespace DataScience { export const sysInfoURILabel = localize('DataScience.sysInfoURILabel', 'Jupyter Server URI: '); } -export namespace Debug { +export namespace DebugConfigurationPrompts { export const selectConfigurationTitle = localize('debug.selectConfigurationTitle', 'Select a debug configuration'); export const selectConfigurationPlaceholder = localize('debug.selectConfigurationPlaceholder', 'Debug Configuration'); export const debugFileConfigurationLabel = localize('debug.debugFileConfigurationLabel', 'Python File'); - export const debugFileConfigurationDescription = localize('debug.debugFileConfigurationDescription', 'Debug python file'); + export const debugFileConfigurationDescription = localize('debug.debugFileConfigurationDescription', 'Debug Python file'); export const debugModuleConfigurationLabel = localize('debug.debugModuleConfigurationLabel', 'Module'); export const debugModuleConfigurationDescription = localize('debug.debugModuleConfigurationDescription', 'Debug Python module/package'); export const remoteAttachConfigurationLabel = localize('debug.remoteAttachConfigurationLabel', 'Remote Attach'); - export const remoteAttachConfigurationDescription = localize('debug.remoteAttachConfigurationDescription', 'Debug a remote python program'); + export const remoteAttachConfigurationDescription = localize('debug.remoteAttachConfigurationDescription', 'Debug a remote Python program'); export const debugDjangoConfigurationLabel = localize('debug.debugDjangoConfigurationLabel', 'Django'); export const debugDjangoConfigurationDescription = localize('debug.debugDjangoConfigurationDescription', 'Web Application'); export const debugFlaskConfigurationLabel = localize('debug.debugFlaskConfigurationLabel', 'Flask'); @@ -121,10 +121,11 @@ export namespace Debug { export const debugPyramidConfigurationLabel = localize('debug.debugPyramidConfigurationLabel', 'Pyramid'); export const debugPyramidConfigurationDescription = localize('debug.debugPyramidConfigurationDescription', 'Web Application'); export const djangoEnterManagePyPathTitle = localize('debug.djangoEnterManagePyPathTitle', 'Debug Django'); - export const djangoEnterManagePyPathPrompt = localize('debug.djangoEnterManagePyPathPrompt', 'Enter path to manage.py'); - export const djangoEnterManagePyPathInvalidFilePathError = localize('debug.djangoEnterManagePyPathInvalidFilePathError', 'Enter a valid python file path'); + // tslint:disable-next-line:no-invalid-template-strings + export const djangoEnterManagePyPathPrompt = localize('debug.djangoEnterManagePyPathPrompt', 'Enter path to manage.py (\'${workspaceFolderToken}\' points to the root of the current workspace folder)'); + export const djangoEnterManagePyPathInvalidFilePathError = localize('debug.djangoEnterManagePyPathInvalidFilePathError', 'Enter a valid Python file path'); export const flaskEnterAppPathOrNamePathTitle = localize('debug.flaskEnterAppPathOrNamePathTitle', 'Debug Flask'); - export const flaskEnterAppPathOrNamePathPrompt = localize('debug.flaskEnterAppPathOrNamePathPrompt', 'Enter path to Application, e.g. \'app.py\' or \'app\''); + export const flaskEnterAppPathOrNamePathPrompt = localize('debug.flaskEnterAppPathOrNamePathPrompt', 'Enter path to application, e.g. \'app.py\' or \'app\''); export const flaskEnterAppPathOrNamePathInvalidNameError = localize('debug.flaskEnterAppPathOrNamePathInvalidNameError', 'Enter a valid name'); export const moduleEnterModuleTitle = localize('debug.moduleEnterModuleTitle', 'Debug Module'); @@ -135,11 +136,11 @@ export namespace Debug { export const pyramidEnterDevelopmentIniPathPrompt = localize('debug.pyramidEnterDevelopmentIniPathPrompt', '`Enter path to development.ini (\'${workspaceFolderToken}\' points to the root of the current workspace folder)`'); export const pyramidEnterDevelopmentIniPathInvalidFilePathError = localize('debug.pyramidEnterDevelopmentIniPathInvalidFilePathError', 'Enter a valid file path'); export const attachRemotePortTitle = localize('debug.attachRemotePortTitle', 'Remote Debugging'); - export const attachRemotePortPrompt = localize('debug.attachRemotePortPrompt', 'Enter Port Number'); - export const attachRemotePortValidationError = localize('debug.attachRemotePortValidationError', 'Enter a valid Port Number'); + export const attachRemotePortPrompt = localize('debug.attachRemotePortPrompt', 'Enter port number'); + export const attachRemotePortValidationError = localize('debug.attachRemotePortValidationError', 'Enter a valid port number'); export const attachRemoteHostTitle = localize('debug.attachRemoteHostTitle', 'Remote Debugging'); - export const attachRemoteHostPrompt = localize('debug.attachRemoteHostPrompt', 'Enter Host Name'); - export const attachRemoteHostValidationError = localize('debug.attachRemoteHostValidationError', 'Enter a Host Name or IP Address'); + export const attachRemoteHostPrompt = localize('debug.attachRemoteHostPrompt', 'Enter a host name or IP address'); + export const attachRemoteHostValidationError = localize('debug.attachRemoteHostValidationError', 'Enter a valid host name or IP address'); } // Skip using vscode-nls and instead just compute our strings based on key values. Key values diff --git a/src/client/debugger/extension/configuration/debugConfigurationService.ts b/src/client/debugger/extension/configuration/debugConfigurationService.ts index 4196c68ac55c..3f37e0920882 100644 --- a/src/client/debugger/extension/configuration/debugConfigurationService.ts +++ b/src/client/debugger/extension/configuration/debugConfigurationService.ts @@ -5,7 +5,7 @@ import { inject, injectable, named } from 'inversify'; import { CancellationToken, DebugConfiguration, QuickPickItem, WorkspaceFolder } from 'vscode'; -import { Debug } from '../../../common/utils/localize'; +import { DebugConfigurationPrompts } from '../../../common/utils/localize'; import { IMultiStepInput, IMultiStepInputFactory, InputStep, IQuickPickParameters } from '../../../common/utils/multiStepInput'; import { AttachRequestArguments, DebugConfigurationArguments, LaunchRequestArguments } from '../../types'; import { DebugConfigurationState, DebugConfigurationType, IDebugConfigurationService } from '../types'; @@ -35,17 +35,17 @@ export class PythonDebugConfigurationService implements IDebugConfigurationServi protected async pickDebugConfiguration(input: IMultiStepInput, state: DebugConfigurationState): Promise | void> { type DebugConfigurationQuickPickItem = QuickPickItem & { type: DebugConfigurationType }; const items: DebugConfigurationQuickPickItem[] = [ - { label: Debug.debugFileConfigurationLabel(), type: DebugConfigurationType.launchFile, description: Debug.debugFileConfigurationDescription() }, - { label: Debug.debugModuleConfigurationLabel(), type: DebugConfigurationType.launchModule, description: Debug.debugModuleConfigurationDescription() }, - { label: Debug.remoteAttachConfigurationLabel(), type: DebugConfigurationType.remoteAttach, description: Debug.remoteAttachConfigurationDescription() }, - { label: Debug.debugDjangoConfigurationLabel(), type: DebugConfigurationType.launchDjango, description: Debug.debugDjangoConfigurationDescription() }, - { label: Debug.debugFlaskConfigurationLabel(), type: DebugConfigurationType.launchFlask, description: Debug.debugFlaskConfigurationDescription() }, - { label: Debug.debugPyramidConfigurationLabel(), type: DebugConfigurationType.launchPyramid, description: Debug.debugPyramidConfigurationDescription() } + { label: DebugConfigurationPrompts.debugFileConfigurationLabel(), type: DebugConfigurationType.launchFile, description: DebugConfigurationPrompts.debugFileConfigurationDescription() }, + { label: DebugConfigurationPrompts.debugModuleConfigurationLabel(), type: DebugConfigurationType.launchModule, description: DebugConfigurationPrompts.debugModuleConfigurationDescription() }, + { label: DebugConfigurationPrompts.remoteAttachConfigurationLabel(), type: DebugConfigurationType.remoteAttach, description: DebugConfigurationPrompts.remoteAttachConfigurationDescription() }, + { label: DebugConfigurationPrompts.debugDjangoConfigurationLabel(), type: DebugConfigurationType.launchDjango, description: DebugConfigurationPrompts.debugDjangoConfigurationDescription() }, + { label: DebugConfigurationPrompts.debugFlaskConfigurationLabel(), type: DebugConfigurationType.launchFlask, description: DebugConfigurationPrompts.debugFlaskConfigurationDescription() }, + { label: DebugConfigurationPrompts.debugPyramidConfigurationLabel(), type: DebugConfigurationType.launchPyramid, description: DebugConfigurationPrompts.debugPyramidConfigurationDescription() } ]; state.config = {}; const pick = await input.showQuickPick>({ - title: Debug.selectConfigurationTitle(), - placeholder: Debug.selectConfigurationPlaceholder(), + title: DebugConfigurationPrompts.selectConfigurationTitle(), + placeholder: DebugConfigurationPrompts.selectConfigurationPlaceholder(), activeItem: items[0], items: items }); diff --git a/src/client/debugger/extension/configuration/providers/djangoLaunch.ts b/src/client/debugger/extension/configuration/providers/djangoLaunch.ts index f0fc850d0876..2cfc9aa927d7 100644 --- a/src/client/debugger/extension/configuration/providers/djangoLaunch.ts +++ b/src/client/debugger/extension/configuration/providers/djangoLaunch.ts @@ -9,7 +9,7 @@ import { Uri, WorkspaceFolder } from 'vscode'; import { IWorkspaceService } from '../../../../common/application/types'; import { IFileSystem } from '../../../../common/platform/types'; import { IPathUtils } from '../../../../common/types'; -import { Debug, localize } from '../../../../common/utils/localize'; +import { DebugConfigurationPrompts, localize } from '../../../../common/utils/localize'; import { MultiStepInput } from '../../../../common/utils/multiStepInput'; import { SystemVariables } from '../../../../common/variables/systemVariables'; import { sendTelemetryEvent } from '../../../../telemetry'; @@ -44,9 +44,9 @@ export class DjangoLaunchDebugConfigurationProvider implements IDebugConfigurati }; if (!program) { const selectedProgram = await input.showInputBox({ - title: Debug.djangoEnterManagePyPathTitle(), + title: DebugConfigurationPrompts.djangoEnterManagePyPathTitle(), value: defaultProgram, - prompt: Debug.djangoEnterManagePyPathPrompt(), + prompt: DebugConfigurationPrompts.djangoEnterManagePyPathPrompt(), validate: value => this.validateManagePy(state.folder, defaultProgram, value) }); if (selectedProgram) { @@ -59,7 +59,7 @@ export class DjangoLaunchDebugConfigurationProvider implements IDebugConfigurati Object.assign(state.config, config); } public async validateManagePy(folder: WorkspaceFolder | undefined, defaultValue: string, selected?: string): Promise { - const error = Debug.djangoEnterManagePyPathInvalidFilePathError(); + const error = DebugConfigurationPrompts.djangoEnterManagePyPathInvalidFilePathError(); if (!selected || selected.trim().length === 0) { return error; } diff --git a/src/client/debugger/extension/configuration/providers/flaskLaunch.ts b/src/client/debugger/extension/configuration/providers/flaskLaunch.ts index 539b5cf13843..1f21c10feff4 100644 --- a/src/client/debugger/extension/configuration/providers/flaskLaunch.ts +++ b/src/client/debugger/extension/configuration/providers/flaskLaunch.ts @@ -7,7 +7,7 @@ import { inject, injectable } from 'inversify'; import * as path from 'path'; import { WorkspaceFolder } from 'vscode'; import { IFileSystem } from '../../../../common/platform/types'; -import { Debug, localize } from '../../../../common/utils/localize'; +import { DebugConfigurationPrompts, localize } from '../../../../common/utils/localize'; import { MultiStepInput } from '../../../../common/utils/multiStepInput'; import { sendTelemetryEvent } from '../../../../telemetry'; import { DEBUGGER_CONFIGURATION_PROMPTS } from '../../../../telemetry/constants'; @@ -44,10 +44,10 @@ export class FlaskLaunchDebugConfigurationProvider implements IDebugConfiguratio if (!application) { const selectedApp = await input.showInputBox({ - title: Debug.flaskEnterAppPathOrNamePathTitle(), + title: DebugConfigurationPrompts.flaskEnterAppPathOrNamePathTitle(), value: 'app.py', - prompt: Debug.debugFlaskConfigurationDescription(), - validate: value => Promise.resolve((value && value.trim().length > 0) ? undefined : Debug.flaskEnterAppPathOrNamePathInvalidNameError()) + prompt: DebugConfigurationPrompts.debugFlaskConfigurationDescription(), + validate: value => Promise.resolve((value && value.trim().length > 0) ? undefined : DebugConfigurationPrompts.flaskEnterAppPathOrNamePathInvalidNameError()) }); if (selectedApp) { manuallyEnteredAValue = true; diff --git a/src/client/debugger/extension/configuration/providers/moduleLaunch.ts b/src/client/debugger/extension/configuration/providers/moduleLaunch.ts index f5fd5c1577cc..40804d57e376 100644 --- a/src/client/debugger/extension/configuration/providers/moduleLaunch.ts +++ b/src/client/debugger/extension/configuration/providers/moduleLaunch.ts @@ -4,7 +4,7 @@ 'use strict'; import { injectable } from 'inversify'; -import { Debug, localize } from '../../../../common/utils/localize'; +import { DebugConfigurationPrompts, localize } from '../../../../common/utils/localize'; import { MultiStepInput } from '../../../../common/utils/multiStepInput'; import { sendTelemetryEvent } from '../../../../telemetry'; import { DEBUGGER_CONFIGURATION_PROMPTS } from '../../../../telemetry/constants'; @@ -23,10 +23,10 @@ export class ModuleLaunchDebugConfigurationProvider implements IDebugConfigurati module: 'enter-your-module-name-here' }; const selectedModule = await input.showInputBox({ - title: Debug.moduleEnterModuleTitle(), + title: DebugConfigurationPrompts.moduleEnterModuleTitle(), value: config.module || 'enter-your-module-name-here', - prompt: Debug.moduleEnterModulePrompt(), - validate: value => Promise.resolve((value && value.trim().length > 0) ? undefined : Debug.moduleEnterModuleInvalidNameError()) + prompt: DebugConfigurationPrompts.moduleEnterModulePrompt(), + validate: value => Promise.resolve((value && value.trim().length > 0) ? undefined : DebugConfigurationPrompts.moduleEnterModuleInvalidNameError()) }); if (selectedModule) { manuallyEnteredAValue = true; diff --git a/src/client/debugger/extension/configuration/providers/pyramidLaunch.ts b/src/client/debugger/extension/configuration/providers/pyramidLaunch.ts index 6a854319f0c3..da50c6703ed2 100644 --- a/src/client/debugger/extension/configuration/providers/pyramidLaunch.ts +++ b/src/client/debugger/extension/configuration/providers/pyramidLaunch.ts @@ -9,7 +9,7 @@ import { Uri, WorkspaceFolder } from 'vscode'; import { IWorkspaceService } from '../../../../common/application/types'; import { IFileSystem } from '../../../../common/platform/types'; import { IPathUtils } from '../../../../common/types'; -import { Debug, localize } from '../../../../common/utils/localize'; +import { DebugConfigurationPrompts, localize } from '../../../../common/utils/localize'; import { MultiStepInput } from '../../../../common/utils/multiStepInput'; import { SystemVariables } from '../../../../common/variables/systemVariables'; import { sendTelemetryEvent } from '../../../../telemetry'; @@ -44,9 +44,9 @@ export class PyramidLaunchDebugConfigurationProvider implements IDebugConfigurat if (!iniPath) { const selectedIniPath = await input.showInputBox({ - title: Debug.pyramidEnterDevelopmentIniPathTitle(), + title: DebugConfigurationPrompts.pyramidEnterDevelopmentIniPathTitle(), value: defaultIni, - prompt: Debug.pyramidEnterDevelopmentIniPathPrompt(), + prompt: DebugConfigurationPrompts.pyramidEnterDevelopmentIniPathPrompt(), validate: value => this.validateIniPath(state ? state.folder : undefined, defaultIni, value) }); if (selectedIniPath) { @@ -62,7 +62,7 @@ export class PyramidLaunchDebugConfigurationProvider implements IDebugConfigurat if (!folder) { return; } - const error = Debug.pyramidEnterDevelopmentIniPathInvalidFilePathError(); + const error = DebugConfigurationPrompts.pyramidEnterDevelopmentIniPathInvalidFilePathError(); if (!selected || selected.trim().length === 0) { return error; } diff --git a/src/client/debugger/extension/configuration/providers/remoteAttach.ts b/src/client/debugger/extension/configuration/providers/remoteAttach.ts index 4cbbd9281c92..9d6fee8c307e 100644 --- a/src/client/debugger/extension/configuration/providers/remoteAttach.ts +++ b/src/client/debugger/extension/configuration/providers/remoteAttach.ts @@ -4,7 +4,7 @@ 'use strict'; import { injectable } from 'inversify'; -import { Debug, localize } from '../../../../common/utils/localize'; +import { DebugConfigurationPrompts, localize } from '../../../../common/utils/localize'; import { InputStep, MultiStepInput } from '../../../../common/utils/multiStepInput'; import { sendTelemetryEvent } from '../../../../telemetry'; import { DEBUGGER_CONFIGURATION_PROMPTS } from '../../../../telemetry/constants'; @@ -27,12 +27,12 @@ export class RemoteAttachDebugConfigurationProvider implements IDebugConfigurati }; config.host = await input.showInputBox({ - title: Debug.attachRemoteHostTitle(), + title: DebugConfigurationPrompts.attachRemoteHostTitle(), step: 1, totalSteps: 2, value: config.host || defaultHost, - prompt: Debug.attachRemoteHostPrompt(), - validate: value => Promise.resolve((value && value.trim().length > 0) ? undefined : Debug.attachRemoteHostValidationError()) + prompt: DebugConfigurationPrompts.attachRemoteHostPrompt(), + validate: value => Promise.resolve((value && value.trim().length > 0) ? undefined : DebugConfigurationPrompts.attachRemoteHostValidationError()) }); if (!config.host) { config.host = defaultHost; @@ -44,12 +44,12 @@ export class RemoteAttachDebugConfigurationProvider implements IDebugConfigurati } protected async configurePort(input: MultiStepInput, config: Partial) { const port = await input.showInputBox({ - title: Debug.attachRemotePortTitle(), + title: DebugConfigurationPrompts.attachRemotePortTitle(), step: 2, totalSteps: 2, value: (config.port || defaultPort).toString(), - prompt: Debug.attachRemotePortPrompt(), - validate: value => Promise.resolve((value && /^\d+$/.test(value.trim())) ? undefined : Debug.attachRemotePortValidationError()) + prompt: DebugConfigurationPrompts.attachRemotePortPrompt(), + validate: value => Promise.resolve((value && /^\d+$/.test(value.trim())) ? undefined : DebugConfigurationPrompts.attachRemotePortValidationError()) }); if (port && /^\d+$/.test(port.trim())) { config.port = parseInt(port, 10);