Skip to content

Commit 77d6f27

Browse files
authored
Update labels in debug configuration prompts (#3771)
* Update messages * Refactor
1 parent 444befa commit 77d6f27

8 files changed

Lines changed: 52 additions & 51 deletions

File tree

package.nls.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,22 +143,22 @@
143143
"debug.selectConfigurationTitle": "Select a debug configuration",
144144
"debug.selectConfigurationPlaceholder": "Debug Configuration",
145145
"debug.debugFileConfigurationLabel": "Python File",
146-
"debug.debugFileConfigurationDescription": "Debug python file",
146+
"debug.debugFileConfigurationDescription": "Debug Python file",
147147
"debug.debugModuleConfigurationLabel": "Module",
148148
"debug.debugModuleConfigurationDescription": "Debug Python module/package",
149149
"debug.remoteAttachConfigurationLabel": "Remote Attach",
150-
"debug.remoteAttachConfigurationDescription": "Debug a remote python program",
150+
"debug.remoteAttachConfigurationDescription": "Debug a remote Python program",
151151
"debug.debugDjangoConfigurationLabel": "Django",
152152
"debug.debugDjangoConfigurationDescription": "Web Application",
153153
"debug.debugFlaskConfigurationLabel": "Flask",
154154
"debug.debugFlaskConfigurationDescription": "Web Application",
155155
"debug.debugPyramidConfigurationLabel": "Pyramid",
156156
"debug.debugPyramidConfigurationDescription": "Web Application",
157157
"debug.djangoEnterManagePyPathTitle": "Debug Django",
158-
"debug.djangoEnterManagePyPathPrompt": "Enter path to manage.py",
159-
"debug.djangoEnterManagePyPathInvalidFilePathError": "Enter a valid python file path",
158+
"debug.djangoEnterManagePyPathPrompt": "Enter path to manage.py ('${workspaceFolderToken}' points to the root of the current workspace folder)",
159+
"debug.djangoEnterManagePyPathInvalidFilePathError": "Enter a valid Python file path",
160160
"debug.flaskEnterAppPathOrNamePathTitle": "Debug Flask",
161-
"debug.flaskEnterAppPathOrNamePathPrompt": "Enter path to Application, e.g. 'app.py' or 'app'",
161+
"debug.flaskEnterAppPathOrNamePathPrompt": "Enter path to application, e.g. 'app.py' or 'app'",
162162
"debug.flaskEnterAppPathOrNamePathInvalidNameError": "Enter a valid name",
163163
"debug.moduleEnterModuleTitle": "Debug Module",
164164
"debug.moduleEnterModulePrompt": "Enter Python module/package name",
@@ -167,9 +167,9 @@
167167
"debug.pyramidEnterDevelopmentIniPathPrompt": "`Enter path to development.ini ('${workspaceFolderToken}' points to the root of the current workspace folder)`",
168168
"debug.pyramidEnterDevelopmentIniPathInvalidFilePathError": "Enter a valid file path",
169169
"debug.attachRemotePortTitle": "Remote Debugging",
170-
"debug.attachRemotePortPrompt": "Enter Port Number",
171-
"debug.attachRemotePortValidationError": "Enter a valid Port Number",
170+
"debug.attachRemotePortPrompt": "Enter port number",
171+
"debug.attachRemotePortValidationError": "Enter a valid port number",
172172
"debug.attachRemoteHostTitle": "Remote Debugging",
173-
"debug.attachRemoteHostPrompt": "Enter Host Name",
174-
"debug.attachRemoteHostValidationError": "Enter a Host Name or IP Address"
173+
"debug.attachRemoteHostPrompt": "Enter a host name or IP address",
174+
"debug.attachRemoteHostValidationError": "Enter a valid host name or IP address"
175175
}

src/client/common/utils/localize.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,26 +105,27 @@ export namespace DataScience {
105105
export const sysInfoURILabel = localize('DataScience.sysInfoURILabel', 'Jupyter Server URI: ');
106106
}
107107

108-
export namespace Debug {
108+
export namespace DebugConfigurationPrompts {
109109
export const selectConfigurationTitle = localize('debug.selectConfigurationTitle', 'Select a debug configuration');
110110
export const selectConfigurationPlaceholder = localize('debug.selectConfigurationPlaceholder', 'Debug Configuration');
111111
export const debugFileConfigurationLabel = localize('debug.debugFileConfigurationLabel', 'Python File');
112-
export const debugFileConfigurationDescription = localize('debug.debugFileConfigurationDescription', 'Debug python file');
112+
export const debugFileConfigurationDescription = localize('debug.debugFileConfigurationDescription', 'Debug Python file');
113113
export const debugModuleConfigurationLabel = localize('debug.debugModuleConfigurationLabel', 'Module');
114114
export const debugModuleConfigurationDescription = localize('debug.debugModuleConfigurationDescription', 'Debug Python module/package');
115115
export const remoteAttachConfigurationLabel = localize('debug.remoteAttachConfigurationLabel', 'Remote Attach');
116-
export const remoteAttachConfigurationDescription = localize('debug.remoteAttachConfigurationDescription', 'Debug a remote python program');
116+
export const remoteAttachConfigurationDescription = localize('debug.remoteAttachConfigurationDescription', 'Debug a remote Python program');
117117
export const debugDjangoConfigurationLabel = localize('debug.debugDjangoConfigurationLabel', 'Django');
118118
export const debugDjangoConfigurationDescription = localize('debug.debugDjangoConfigurationDescription', 'Web Application');
119119
export const debugFlaskConfigurationLabel = localize('debug.debugFlaskConfigurationLabel', 'Flask');
120120
export const debugFlaskConfigurationDescription = localize('debug.debugFlaskConfigurationDescription', 'Web Application');
121121
export const debugPyramidConfigurationLabel = localize('debug.debugPyramidConfigurationLabel', 'Pyramid');
122122
export const debugPyramidConfigurationDescription = localize('debug.debugPyramidConfigurationDescription', 'Web Application');
123123
export const djangoEnterManagePyPathTitle = localize('debug.djangoEnterManagePyPathTitle', 'Debug Django');
124-
export const djangoEnterManagePyPathPrompt = localize('debug.djangoEnterManagePyPathPrompt', 'Enter path to manage.py');
125-
export const djangoEnterManagePyPathInvalidFilePathError = localize('debug.djangoEnterManagePyPathInvalidFilePathError', 'Enter a valid python file path');
124+
// tslint:disable-next-line:no-invalid-template-strings
125+
export const djangoEnterManagePyPathPrompt = localize('debug.djangoEnterManagePyPathPrompt', 'Enter path to manage.py (\'${workspaceFolderToken}\' points to the root of the current workspace folder)');
126+
export const djangoEnterManagePyPathInvalidFilePathError = localize('debug.djangoEnterManagePyPathInvalidFilePathError', 'Enter a valid Python file path');
126127
export const flaskEnterAppPathOrNamePathTitle = localize('debug.flaskEnterAppPathOrNamePathTitle', 'Debug Flask');
127-
export const flaskEnterAppPathOrNamePathPrompt = localize('debug.flaskEnterAppPathOrNamePathPrompt', 'Enter path to Application, e.g. \'app.py\' or \'app\'');
128+
export const flaskEnterAppPathOrNamePathPrompt = localize('debug.flaskEnterAppPathOrNamePathPrompt', 'Enter path to application, e.g. \'app.py\' or \'app\'');
128129
export const flaskEnterAppPathOrNamePathInvalidNameError = localize('debug.flaskEnterAppPathOrNamePathInvalidNameError', 'Enter a valid name');
129130

130131
export const moduleEnterModuleTitle = localize('debug.moduleEnterModuleTitle', 'Debug Module');
@@ -135,11 +136,11 @@ export namespace Debug {
135136
export const pyramidEnterDevelopmentIniPathPrompt = localize('debug.pyramidEnterDevelopmentIniPathPrompt', '`Enter path to development.ini (\'${workspaceFolderToken}\' points to the root of the current workspace folder)`');
136137
export const pyramidEnterDevelopmentIniPathInvalidFilePathError = localize('debug.pyramidEnterDevelopmentIniPathInvalidFilePathError', 'Enter a valid file path');
137138
export const attachRemotePortTitle = localize('debug.attachRemotePortTitle', 'Remote Debugging');
138-
export const attachRemotePortPrompt = localize('debug.attachRemotePortPrompt', 'Enter Port Number');
139-
export const attachRemotePortValidationError = localize('debug.attachRemotePortValidationError', 'Enter a valid Port Number');
139+
export const attachRemotePortPrompt = localize('debug.attachRemotePortPrompt', 'Enter port number');
140+
export const attachRemotePortValidationError = localize('debug.attachRemotePortValidationError', 'Enter a valid port number');
140141
export const attachRemoteHostTitle = localize('debug.attachRemoteHostTitle', 'Remote Debugging');
141-
export const attachRemoteHostPrompt = localize('debug.attachRemoteHostPrompt', 'Enter Host Name');
142-
export const attachRemoteHostValidationError = localize('debug.attachRemoteHostValidationError', 'Enter a Host Name or IP Address');
142+
export const attachRemoteHostPrompt = localize('debug.attachRemoteHostPrompt', 'Enter a host name or IP address');
143+
export const attachRemoteHostValidationError = localize('debug.attachRemoteHostValidationError', 'Enter a valid host name or IP address');
143144
}
144145

145146
// Skip using vscode-nls and instead just compute our strings based on key values. Key values

src/client/debugger/extension/configuration/debugConfigurationService.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import { inject, injectable, named } from 'inversify';
77
import { CancellationToken, DebugConfiguration, QuickPickItem, WorkspaceFolder } from 'vscode';
8-
import { Debug } from '../../../common/utils/localize';
8+
import { DebugConfigurationPrompts } from '../../../common/utils/localize';
99
import { IMultiStepInput, IMultiStepInputFactory, InputStep, IQuickPickParameters } from '../../../common/utils/multiStepInput';
1010
import { AttachRequestArguments, DebugConfigurationArguments, LaunchRequestArguments } from '../../types';
1111
import { DebugConfigurationState, DebugConfigurationType, IDebugConfigurationService } from '../types';
@@ -35,17 +35,17 @@ export class PythonDebugConfigurationService implements IDebugConfigurationServi
3535
protected async pickDebugConfiguration(input: IMultiStepInput<DebugConfigurationState>, state: DebugConfigurationState): Promise<InputStep<DebugConfigurationState> | void> {
3636
type DebugConfigurationQuickPickItem = QuickPickItem & { type: DebugConfigurationType };
3737
const items: DebugConfigurationQuickPickItem[] = [
38-
{ label: Debug.debugFileConfigurationLabel(), type: DebugConfigurationType.launchFile, description: Debug.debugFileConfigurationDescription() },
39-
{ label: Debug.debugModuleConfigurationLabel(), type: DebugConfigurationType.launchModule, description: Debug.debugModuleConfigurationDescription() },
40-
{ label: Debug.remoteAttachConfigurationLabel(), type: DebugConfigurationType.remoteAttach, description: Debug.remoteAttachConfigurationDescription() },
41-
{ label: Debug.debugDjangoConfigurationLabel(), type: DebugConfigurationType.launchDjango, description: Debug.debugDjangoConfigurationDescription() },
42-
{ label: Debug.debugFlaskConfigurationLabel(), type: DebugConfigurationType.launchFlask, description: Debug.debugFlaskConfigurationDescription() },
43-
{ label: Debug.debugPyramidConfigurationLabel(), type: DebugConfigurationType.launchPyramid, description: Debug.debugPyramidConfigurationDescription() }
38+
{ label: DebugConfigurationPrompts.debugFileConfigurationLabel(), type: DebugConfigurationType.launchFile, description: DebugConfigurationPrompts.debugFileConfigurationDescription() },
39+
{ label: DebugConfigurationPrompts.debugModuleConfigurationLabel(), type: DebugConfigurationType.launchModule, description: DebugConfigurationPrompts.debugModuleConfigurationDescription() },
40+
{ label: DebugConfigurationPrompts.remoteAttachConfigurationLabel(), type: DebugConfigurationType.remoteAttach, description: DebugConfigurationPrompts.remoteAttachConfigurationDescription() },
41+
{ label: DebugConfigurationPrompts.debugDjangoConfigurationLabel(), type: DebugConfigurationType.launchDjango, description: DebugConfigurationPrompts.debugDjangoConfigurationDescription() },
42+
{ label: DebugConfigurationPrompts.debugFlaskConfigurationLabel(), type: DebugConfigurationType.launchFlask, description: DebugConfigurationPrompts.debugFlaskConfigurationDescription() },
43+
{ label: DebugConfigurationPrompts.debugPyramidConfigurationLabel(), type: DebugConfigurationType.launchPyramid, description: DebugConfigurationPrompts.debugPyramidConfigurationDescription() }
4444
];
4545
state.config = {};
4646
const pick = await input.showQuickPick<DebugConfigurationQuickPickItem, IQuickPickParameters<DebugConfigurationQuickPickItem>>({
47-
title: Debug.selectConfigurationTitle(),
48-
placeholder: Debug.selectConfigurationPlaceholder(),
47+
title: DebugConfigurationPrompts.selectConfigurationTitle(),
48+
placeholder: DebugConfigurationPrompts.selectConfigurationPlaceholder(),
4949
activeItem: items[0],
5050
items: items
5151
});

src/client/debugger/extension/configuration/providers/djangoLaunch.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Uri, WorkspaceFolder } from 'vscode';
99
import { IWorkspaceService } from '../../../../common/application/types';
1010
import { IFileSystem } from '../../../../common/platform/types';
1111
import { IPathUtils } from '../../../../common/types';
12-
import { Debug, localize } from '../../../../common/utils/localize';
12+
import { DebugConfigurationPrompts, localize } from '../../../../common/utils/localize';
1313
import { MultiStepInput } from '../../../../common/utils/multiStepInput';
1414
import { SystemVariables } from '../../../../common/variables/systemVariables';
1515
import { sendTelemetryEvent } from '../../../../telemetry';
@@ -44,9 +44,9 @@ export class DjangoLaunchDebugConfigurationProvider implements IDebugConfigurati
4444
};
4545
if (!program) {
4646
const selectedProgram = await input.showInputBox({
47-
title: Debug.djangoEnterManagePyPathTitle(),
47+
title: DebugConfigurationPrompts.djangoEnterManagePyPathTitle(),
4848
value: defaultProgram,
49-
prompt: Debug.djangoEnterManagePyPathPrompt(),
49+
prompt: DebugConfigurationPrompts.djangoEnterManagePyPathPrompt(),
5050
validate: value => this.validateManagePy(state.folder, defaultProgram, value)
5151
});
5252
if (selectedProgram) {
@@ -59,7 +59,7 @@ export class DjangoLaunchDebugConfigurationProvider implements IDebugConfigurati
5959
Object.assign(state.config, config);
6060
}
6161
public async validateManagePy(folder: WorkspaceFolder | undefined, defaultValue: string, selected?: string): Promise<string | undefined> {
62-
const error = Debug.djangoEnterManagePyPathInvalidFilePathError();
62+
const error = DebugConfigurationPrompts.djangoEnterManagePyPathInvalidFilePathError();
6363
if (!selected || selected.trim().length === 0) {
6464
return error;
6565
}

src/client/debugger/extension/configuration/providers/flaskLaunch.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { inject, injectable } from 'inversify';
77
import * as path from 'path';
88
import { WorkspaceFolder } from 'vscode';
99
import { IFileSystem } from '../../../../common/platform/types';
10-
import { Debug, localize } from '../../../../common/utils/localize';
10+
import { DebugConfigurationPrompts, localize } from '../../../../common/utils/localize';
1111
import { MultiStepInput } from '../../../../common/utils/multiStepInput';
1212
import { sendTelemetryEvent } from '../../../../telemetry';
1313
import { DEBUGGER_CONFIGURATION_PROMPTS } from '../../../../telemetry/constants';
@@ -44,10 +44,10 @@ export class FlaskLaunchDebugConfigurationProvider implements IDebugConfiguratio
4444

4545
if (!application) {
4646
const selectedApp = await input.showInputBox({
47-
title: Debug.flaskEnterAppPathOrNamePathTitle(),
47+
title: DebugConfigurationPrompts.flaskEnterAppPathOrNamePathTitle(),
4848
value: 'app.py',
49-
prompt: Debug.debugFlaskConfigurationDescription(),
50-
validate: value => Promise.resolve((value && value.trim().length > 0) ? undefined : Debug.flaskEnterAppPathOrNamePathInvalidNameError())
49+
prompt: DebugConfigurationPrompts.debugFlaskConfigurationDescription(),
50+
validate: value => Promise.resolve((value && value.trim().length > 0) ? undefined : DebugConfigurationPrompts.flaskEnterAppPathOrNamePathInvalidNameError())
5151
});
5252
if (selectedApp) {
5353
manuallyEnteredAValue = true;

src/client/debugger/extension/configuration/providers/moduleLaunch.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
'use strict';
55

66
import { injectable } from 'inversify';
7-
import { Debug, localize } from '../../../../common/utils/localize';
7+
import { DebugConfigurationPrompts, localize } from '../../../../common/utils/localize';
88
import { MultiStepInput } from '../../../../common/utils/multiStepInput';
99
import { sendTelemetryEvent } from '../../../../telemetry';
1010
import { DEBUGGER_CONFIGURATION_PROMPTS } from '../../../../telemetry/constants';
@@ -23,10 +23,10 @@ export class ModuleLaunchDebugConfigurationProvider implements IDebugConfigurati
2323
module: 'enter-your-module-name-here'
2424
};
2525
const selectedModule = await input.showInputBox({
26-
title: Debug.moduleEnterModuleTitle(),
26+
title: DebugConfigurationPrompts.moduleEnterModuleTitle(),
2727
value: config.module || 'enter-your-module-name-here',
28-
prompt: Debug.moduleEnterModulePrompt(),
29-
validate: value => Promise.resolve((value && value.trim().length > 0) ? undefined : Debug.moduleEnterModuleInvalidNameError())
28+
prompt: DebugConfigurationPrompts.moduleEnterModulePrompt(),
29+
validate: value => Promise.resolve((value && value.trim().length > 0) ? undefined : DebugConfigurationPrompts.moduleEnterModuleInvalidNameError())
3030
});
3131
if (selectedModule) {
3232
manuallyEnteredAValue = true;

src/client/debugger/extension/configuration/providers/pyramidLaunch.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Uri, WorkspaceFolder } from 'vscode';
99
import { IWorkspaceService } from '../../../../common/application/types';
1010
import { IFileSystem } from '../../../../common/platform/types';
1111
import { IPathUtils } from '../../../../common/types';
12-
import { Debug, localize } from '../../../../common/utils/localize';
12+
import { DebugConfigurationPrompts, localize } from '../../../../common/utils/localize';
1313
import { MultiStepInput } from '../../../../common/utils/multiStepInput';
1414
import { SystemVariables } from '../../../../common/variables/systemVariables';
1515
import { sendTelemetryEvent } from '../../../../telemetry';
@@ -44,9 +44,9 @@ export class PyramidLaunchDebugConfigurationProvider implements IDebugConfigurat
4444

4545
if (!iniPath) {
4646
const selectedIniPath = await input.showInputBox({
47-
title: Debug.pyramidEnterDevelopmentIniPathTitle(),
47+
title: DebugConfigurationPrompts.pyramidEnterDevelopmentIniPathTitle(),
4848
value: defaultIni,
49-
prompt: Debug.pyramidEnterDevelopmentIniPathPrompt(),
49+
prompt: DebugConfigurationPrompts.pyramidEnterDevelopmentIniPathPrompt(),
5050
validate: value => this.validateIniPath(state ? state.folder : undefined, defaultIni, value)
5151
});
5252
if (selectedIniPath) {
@@ -62,7 +62,7 @@ export class PyramidLaunchDebugConfigurationProvider implements IDebugConfigurat
6262
if (!folder) {
6363
return;
6464
}
65-
const error = Debug.pyramidEnterDevelopmentIniPathInvalidFilePathError();
65+
const error = DebugConfigurationPrompts.pyramidEnterDevelopmentIniPathInvalidFilePathError();
6666
if (!selected || selected.trim().length === 0) {
6767
return error;
6868
}

0 commit comments

Comments
 (0)