Skip to content

Commit 5bb5b16

Browse files
committed
Revert default cwd to ${file}
1 parent 8a6671e commit 5bb5b16

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@
442442
"type": "PowerShell",
443443
"request": "launch",
444444
"script": "^\"\\${file}\"",
445-
"cwd": "^\"\\${workspaceFolder}\""
445+
"cwd": "^\"\\${file}\""
446446
}
447447
},
448448
{

src/features/DebugSession.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,10 @@ export class DebugSessionFeature extends LanguageClientConsumer
175175
const settings = Settings.load();
176176

177177
// If the createTemporaryIntegratedConsole field is not specified in the launch config, set the field using
178-
// the value from the corresponding setting. Otherwise, the launch config value overrides the setting.
179-
if (config.createTemporaryIntegratedConsole === undefined) {
180-
config.createTemporaryIntegratedConsole = settings.debugging.createTemporaryIntegratedConsole;
181-
}
178+
// the value from the corresponding setting. Otherwise, the launch config value overrides the setting.
179+
config.createTemporaryIntegratedConsole =
180+
config.createTemporaryIntegratedConsole ??
181+
settings.debugging.createTemporaryIntegratedConsole;
182182

183183
if (config.request === "attach") {
184184
const platformDetails = getPlatformDetails();
@@ -300,6 +300,9 @@ export class DebugSessionFeature extends LanguageClientConsumer
300300
}
301301
}
302302

303+
// NOTE: There is a tight coupling to a weird setting in
304+
// `package.json` for the Launch Current File configuration where
305+
// the default cwd is set to ${file}.
303306
if ((currentDocument !== undefined) && (config.cwd === "${file}")) {
304307
config.cwd = currentDocument.fileName;
305308
}

0 commit comments

Comments
 (0)