Skip to content

Commit 70c0164

Browse files
authored
Use workspace folder in launch.json program name (#105)
1 parent df5d9c1 commit 70c0164

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/debug.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export async function makeDebugConfigurations(ctx: FolderContext) {
4040
launchConfigs[index].preLaunchTask !== config.preLaunchTask
4141
) {
4242
const answer = await vscode.window.showErrorMessage(
43-
`Launch configuration '${config.name}' already exists. Do you want to update it?`,
43+
`${ctx.folder.name}: Launch configuration '${config.name}' already exists. Do you want to update it?`,
4444
"Cancel",
4545
"Update"
4646
);
@@ -75,7 +75,7 @@ function createExecutableConfigurations(ctx: FolderContext): vscode.DebugConfigu
7575
type: "lldb",
7676
request: "launch",
7777
name: `Debug ${product.name}`,
78-
program: `.build/debug/` + product.name,
78+
program: `\${workspaceFolder:${ctx.folder.name}}/.build/debug/` + product.name,
7979
args: [],
8080
cwd: `\${workspaceFolder:${ctx.folder.name}}`,
8181
preLaunchTask: `swift: Build Debug ${product.name}`,
@@ -84,7 +84,7 @@ function createExecutableConfigurations(ctx: FolderContext): vscode.DebugConfigu
8484
type: "lldb",
8585
request: "launch",
8686
name: `Release ${product.name}`,
87-
program: `.build/release/` + product.name,
87+
program: `\${workspaceFolder:${ctx.folder.name}}/.build/release/` + product.name,
8888
args: [],
8989
cwd: `\${workspaceFolder:${ctx.folder.name}}`,
9090
preLaunchTask: `swift: Build Release ${product.name}`,
@@ -128,7 +128,7 @@ async function createTestConfigurations(ctx: FolderContext): Promise<vscode.Debu
128128
type: "lldb",
129129
request: "launch",
130130
name: `Test ${ctx.swiftPackage.name}`,
131-
program: `./.build/debug/${ctx.swiftPackage.name}PackageTests.xctest`,
131+
program: `\${workspaceFolder:${ctx.folder.name}}/.build/debug/${ctx.swiftPackage.name}PackageTests.xctest`,
132132
cwd: `\${workspaceFolder:${ctx.folder.name}}`,
133133
env: {
134134
path: `${ctx.workspaceContext.xcTestPath};\${env:PATH}`,
@@ -143,7 +143,7 @@ async function createTestConfigurations(ctx: FolderContext): Promise<vscode.Debu
143143
type: "lldb",
144144
request: "launch",
145145
name: `Test ${ctx.swiftPackage.name}`,
146-
program: `./.build/debug/${ctx.swiftPackage.name}PackageTests.xctest`,
146+
program: `\${workspaceFolder:${ctx.folder.name}}/.build/debug/${ctx.swiftPackage.name}PackageTests.xctest`,
147147
cwd: `\${workspaceFolder:${ctx.folder.name}}`,
148148
preLaunchTask: `swift: Build All`,
149149
},

0 commit comments

Comments
 (0)