Skip to content

Commit c979455

Browse files
author
Kartik Raj
authored
Set workspaceFolder in debug config before substituting command variables (#21835)
For #18482
1 parent 96ba735 commit c979455

File tree

1 file changed

+4
-2
lines changed
  • src/client/debugger/extension/configuration/resolvers

1 file changed

+4
-2
lines changed

src/client/debugger/extension/configuration/resolvers/launch.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ export class LaunchConfigurationResolver extends BaseConfigurationResolver<Launc
5555
}
5656

5757
const workspaceFolder = LaunchConfigurationResolver.getWorkspaceFolder(folder);
58+
// Pass workspace folder so we can get this when we get debug events firing.
59+
// Do it here itself instead of `resolveDebugConfigurationWithSubstitutedVariables` which is called after
60+
// this method, as in order to calculate substituted variables, this might be needed.
61+
debugConfiguration.workspaceFolder = workspaceFolder?.fsPath;
5862
await this.resolveAndUpdatePaths(workspaceFolder, debugConfiguration);
5963
if (debugConfiguration.clientOS === undefined) {
6064
debugConfiguration.clientOS = getOSType() === OSType.Windows ? 'windows' : 'unix';
@@ -135,8 +139,6 @@ export class LaunchConfigurationResolver extends BaseConfigurationResolver<Launc
135139
// Populate justMyCode using debugStdLib
136140
debugConfiguration.justMyCode = !debugConfiguration.debugStdLib;
137141
}
138-
// Pass workspace folder so we can get this when we get debug events firing.
139-
debugConfiguration.workspaceFolder = workspaceFolder ? workspaceFolder.fsPath : undefined;
140142
const debugOptions = debugConfiguration.debugOptions!;
141143
if (!debugConfiguration.justMyCode) {
142144
LaunchConfigurationResolver.debugOption(debugOptions, DebugOptions.DebugStdLib);

0 commit comments

Comments
 (0)