Skip to content

Commit 78bd1f5

Browse files
Simplify the name label of the launch configuration (#921)
1 parent b9096ce commit 78bd1f5

File tree

4 files changed

+12
-16
lines changed

4 files changed

+12
-16
lines changed

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@
500500
"description": "%java.debugger.snippet.launch.description%",
501501
"body": {
502502
"type": "java",
503-
"name": "Debug (Launch)",
503+
"name": "Launch Java Program",
504504
"request": "launch",
505505
"mainClass": ""
506506
}
@@ -510,7 +510,7 @@
510510
"description": "%java.debugger.snippet.launchInExternalTerminal.description%",
511511
"body": {
512512
"type": "java",
513-
"name": "Debug (Launch) - External Terminal",
513+
"name": "Launch External Terminal",
514514
"request": "launch",
515515
"console": "externalTerminal",
516516
"mainClass": ""
@@ -521,7 +521,7 @@
521521
"description": "%java.debugger.snippet.launchCurrentFile.description%",
522522
"body": {
523523
"type": "java",
524-
"name": "Debug (Launch) - Current File",
524+
"name": "Launch Current File",
525525
"request": "launch",
526526
"mainClass": "^\"\\${file}\""
527527
}
@@ -531,7 +531,7 @@
531531
"description": "%java.debugger.snippet.launchWithArgumentsPrompt.description%",
532532
"body": {
533533
"type": "java",
534-
"name": "Debug (Launch) with Arguments Prompt",
534+
"name": "Launch with Arguments Prompt",
535535
"request": "launch",
536536
"mainClass": "",
537537
"args": "^\"\\${command:SpecifyProgramArgs}\""
@@ -542,7 +542,7 @@
542542
"description": "%java.debugger.snippet.attach.description%",
543543
"body": {
544544
"type": "java",
545-
"name": "Debug (Attach)",
545+
"name": "Attach",
546546
"request": "attach",
547547
"hostName": "localhost",
548548
"port": "<debug port of the debuggee>"
@@ -563,7 +563,7 @@
563563
"description": "%java.debugger.snippet.attachRemote.description%",
564564
"body": {
565565
"type": "java",
566-
"name": "Debug (Attach) - Remote",
566+
"name": "Attach to Remote Program",
567567
"request": "attach",
568568
"hostName": "<The host name or ip address of remote debuggee>",
569569
"port": "<debug port of remote debuggee>"

src/configurationProvider.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
9494
progressReporter.observe(token);
9595
const defaultLaunchConfig = {
9696
type: "java",
97-
name: "Debug (Launch) - Current File",
97+
name: "Launch Current File",
9898
request: "launch",
9999
// tslint:disable-next-line
100100
mainClass: "${file}",
@@ -116,7 +116,7 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
116116
const launchConfigs = mainClasses.map((item) => {
117117
return {
118118
...defaultLaunchConfig,
119-
name: this.constructLaunchConfigName(item.mainClass, cache, item.projectName),
119+
name: this.constructLaunchConfigName(item.mainClass, cache),
120120
mainClass: item.mainClass,
121121
projectName: item.projectName,
122122
};
@@ -154,12 +154,8 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
154154
}
155155
}
156156

157-
private constructLaunchConfigName(mainClass: string, cache: {[key: string]: any}, projectName?: string) {
158-
const prefix = "Debug (Launch)-";
159-
let name = prefix + mainClass.substr(mainClass.lastIndexOf(".") + 1);
160-
if (projectName !== undefined) {
161-
name += `<${projectName}>`;
162-
}
157+
private constructLaunchConfigName(mainClass: string, cache: {[key: string]: any}) {
158+
const name = `Launch ${mainClass.substr(mainClass.lastIndexOf(".") + 1)}`;
163159
if (cache[name] === undefined) {
164160
cache[name] = 0;
165161
return name;

src/debugCodeLensProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ async function constructDebugConfig(mainClass: string, projectName: string, work
152152
if (!debugConfig) {
153153
debugConfig = {
154154
type: "java",
155-
name: `CodeLens (Launch) - ${mainClass.substr(mainClass.lastIndexOf(".") + 1)}`,
155+
name: `Launch ${mainClass.substr(mainClass.lastIndexOf(".") + 1)}`,
156156
request: "launch",
157157
mainClass,
158158
projectName,

src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ async function runJavaProject(node: any, noDebug: boolean) {
384384
});
385385
const debugConfig = existConfig || {
386386
type: "java",
387-
name: `Launch - ${mainClass.substr(mainClass.lastIndexOf(".") + 1)}`,
387+
name: `Launch ${mainClass.substr(mainClass.lastIndexOf(".") + 1)}`,
388388
request: "launch",
389389
mainClass,
390390
projectName,

0 commit comments

Comments
 (0)