Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Set workspaceFolder in debug config before substituting command varia…
…bles
  • Loading branch information
Kartik Raj
Kartik Raj committed Aug 17, 2023
commit 3b753d4810c3b470cb1b24da1af0a6d0a6b2329d
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