Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set workspaceFolder in debug config before substituting command variables #21835

Merged
merged 1 commit into from
Aug 17, 2023
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
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
Loading