Skip to content

Commit

Permalink
Set workspaceFolder in debug config before substituting command varia…
Browse files Browse the repository at this point in the history
…bles (#21835)

For #18482
  • Loading branch information
Kartik Raj authored Aug 17, 2023
1 parent 96ba735 commit c979455
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ export class LaunchConfigurationResolver extends BaseConfigurationResolver<Launc
}

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

0 comments on commit c979455

Please sign in to comment.