Skip to content

Commit

Permalink
Read just my code from settings too
Browse files Browse the repository at this point in the history
  • Loading branch information
paulacamargo25 committed Sep 25, 2023
1 parent d765892 commit 2180976
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
10 changes: 4 additions & 6 deletions src/extension/debugger/configuration/resolvers/attach.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { CancellationToken, Uri, WorkspaceFolder } from 'vscode';
import { getOSType, OSType } from '../../../common/platform';
import { AttachRequestArguments, DebugOptions, PathMapping } from '../../../types';
import { BaseConfigurationResolver } from './base';
import { getConfiguration } from '../../../common/vscodeapi';

export class AttachConfigurationResolver extends BaseConfigurationResolver<AttachRequestArguments> {
public async resolveDebugConfigurationWithSubstitutedVariables(
Expand Down Expand Up @@ -42,16 +43,13 @@ export class AttachConfigurationResolver extends BaseConfigurationResolver<Attac
debugConfiguration.host = 'localhost';
}
if (debugConfiguration.justMyCode === undefined) {
// Populate justMyCode using debugStdLib
debugConfiguration.justMyCode = !debugConfiguration.debugStdLib;
}
const config = getConfiguration('debugpy');
debugConfiguration.justMyCode = config.get<boolean>('debugJustMyCode', false);
}
debugConfiguration.showReturnValue = debugConfiguration.showReturnValue !== false;
// 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) {
AttachConfigurationResolver.debugOption(debugOptions, DebugOptions.DebugStdLib);
}
if (debugConfiguration.django) {
AttachConfigurationResolver.debugOption(debugOptions, DebugOptions.Django);
}
Expand Down
10 changes: 4 additions & 6 deletions src/extension/debugger/configuration/resolvers/launch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { DebugOptions, DebugPurpose, LaunchRequestArguments } from '../../../typ
import { resolveVariables } from '../utils/common';
import { BaseConfigurationResolver } from './base';
import { getDebugEnvironmentVariables, getProgram } from './helper';
import { getConfiguration } from '../../../common/vscodeapi';

export class LaunchConfigurationResolver extends BaseConfigurationResolver<LaunchRequestArguments> {
public async resolveDebugConfiguration(
Expand Down Expand Up @@ -102,15 +103,12 @@ export class LaunchConfigurationResolver extends BaseConfigurationResolver<Launc
debugConfiguration.debugOptions = [];
}
if (debugConfiguration.justMyCode === undefined) {
// Populate justMyCode using debugStdLib
debugConfiguration.justMyCode = !debugConfiguration.debugStdLib;
}
const config = getConfiguration('debugpy');
debugConfiguration.justMyCode = config.get<boolean>('debugJustMyCode', true);
}
// 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);
}
if (debugConfiguration.stopOnEntry) {
LaunchConfigurationResolver.debugOption(debugOptions, DebugOptions.StopOnEntry);
}
Expand Down

0 comments on commit 2180976

Please sign in to comment.