From d3d8da37ecfe71b575ef1aee655bd7eeb5cb6051 Mon Sep 17 00:00:00 2001 From: Paula Camargo Date: Wed, 27 Sep 2023 12:52:45 -0700 Subject: [PATCH 1/3] Fix error in workspace --- src/extension/debugger/configuration/resolvers/attach.ts | 2 +- src/extension/debugger/configuration/resolvers/launch.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/extension/debugger/configuration/resolvers/attach.ts b/src/extension/debugger/configuration/resolvers/attach.ts index 115e4627..b1a092d7 100644 --- a/src/extension/debugger/configuration/resolvers/attach.ts +++ b/src/extension/debugger/configuration/resolvers/attach.ts @@ -43,7 +43,7 @@ export class AttachConfigurationResolver extends BaseConfigurationResolver('debugJustMyCode', true); + debugConfiguration.justMyCode = getConfiguration('debugpy', workspaceFolder).get('debugJustMyCode', true); } debugConfiguration.showReturnValue = debugConfiguration.showReturnValue !== false; // Pass workspace folder so we can get this when we get debug events firing. diff --git a/src/extension/debugger/configuration/resolvers/launch.ts b/src/extension/debugger/configuration/resolvers/launch.ts index d2521087..b021777a 100644 --- a/src/extension/debugger/configuration/resolvers/launch.ts +++ b/src/extension/debugger/configuration/resolvers/launch.ts @@ -103,7 +103,7 @@ export class LaunchConfigurationResolver extends BaseConfigurationResolver('debugJustMyCode', true); + debugConfiguration.justMyCode = getConfiguration('debugpy', workspaceFolder).get('debugJustMyCode', true); } // Pass workspace folder so we can get this when we get debug events firing. debugConfiguration.workspaceFolder = workspaceFolder ? workspaceFolder.fsPath : undefined; From 750b12e5c1f0876c0699800fc937780e1e173292 Mon Sep 17 00:00:00 2001 From: Paula Camargo Date: Wed, 27 Sep 2023 13:03:05 -0700 Subject: [PATCH 2/3] fix test and lint --- src/extension/debugger/configuration/resolvers/attach.ts | 5 ++++- src/extension/debugger/configuration/resolvers/launch.ts | 5 ++++- .../unittest/configuration/resolvers/attach.unit.test.ts | 4 ++-- .../unittest/configuration/resolvers/launch.unit.test.ts | 4 ++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/extension/debugger/configuration/resolvers/attach.ts b/src/extension/debugger/configuration/resolvers/attach.ts index b1a092d7..12fffe8f 100644 --- a/src/extension/debugger/configuration/resolvers/attach.ts +++ b/src/extension/debugger/configuration/resolvers/attach.ts @@ -43,7 +43,10 @@ export class AttachConfigurationResolver extends BaseConfigurationResolver('debugJustMyCode', true); + debugConfiguration.justMyCode = getConfiguration('debugpy', workspaceFolder).get( + 'debugJustMyCode', + true, + ); } debugConfiguration.showReturnValue = debugConfiguration.showReturnValue !== false; // Pass workspace folder so we can get this when we get debug events firing. diff --git a/src/extension/debugger/configuration/resolvers/launch.ts b/src/extension/debugger/configuration/resolvers/launch.ts index b021777a..5230637b 100644 --- a/src/extension/debugger/configuration/resolvers/launch.ts +++ b/src/extension/debugger/configuration/resolvers/launch.ts @@ -103,7 +103,10 @@ export class LaunchConfigurationResolver extends BaseConfigurationResolver('debugJustMyCode', true); + debugConfiguration.justMyCode = getConfiguration('debugpy', workspaceFolder).get( + 'debugJustMyCode', + true, + ); } // Pass workspace folder so we can get this when we get debug events firing. debugConfiguration.workspaceFolder = workspaceFolder ? workspaceFolder.fsPath : undefined; diff --git a/src/test/unittest/configuration/resolvers/attach.unit.test.ts b/src/test/unittest/configuration/resolvers/attach.unit.test.ts index 97241da1..312b177b 100644 --- a/src/test/unittest/configuration/resolvers/attach.unit.test.ts +++ b/src/test/unittest/configuration/resolvers/attach.unit.test.ts @@ -53,7 +53,7 @@ getInfoPerOS().forEach(([osName, osType, path]) => { getWorkspaceFoldersStub = sinon.stub(vscodeapi, 'getWorkspaceFolders'); getOSTypeStub.returns(osType); getConfigurationStub = sinon.stub(vscodeapi, 'getConfiguration'); - getConfigurationStub.withArgs('debugpy').returns(createMoqConfiguration(true)); + getConfigurationStub.withArgs('debugpy', sinon.match.any).returns(createMoqConfiguration(true)); }); teardown(() => { @@ -554,7 +554,7 @@ getInfoPerOS().forEach(([osName, osType, path]) => { .slice() .concat(DebugOptions.Jinja, DebugOptions.Sudo) as DebugOptions[]; - getConfigurationStub.withArgs('debugpy').returns(createMoqConfiguration(testParams.justMyCodeSetting)); + getConfigurationStub.withArgs('debugpy', sinon.match.any).returns(createMoqConfiguration(testParams.justMyCodeSetting)); const debugConfig = await resolveDebugConfiguration(workspaceFolder, { ...attach, debugOptions, diff --git a/src/test/unittest/configuration/resolvers/launch.unit.test.ts b/src/test/unittest/configuration/resolvers/launch.unit.test.ts index 200cccbf..71ebe44e 100644 --- a/src/test/unittest/configuration/resolvers/launch.unit.test.ts +++ b/src/test/unittest/configuration/resolvers/launch.unit.test.ts @@ -51,7 +51,7 @@ getInfoPerOS().forEach(([osName, osType, path]) => { getEnvFileStub = sinon.stub(settings, 'getEnvFile'); getDebugEnvironmentVariablesStub = sinon.stub(helper, 'getDebugEnvironmentVariables'); getConfigurationStub = sinon.stub(vscodeapi, 'getConfiguration'); - getConfigurationStub.withArgs('debugpy').returns(createMoqConfiguration(true)); + getConfigurationStub.withArgs('debugpy', sinon.match.any).returns(createMoqConfiguration(true)); }); teardown(() => { @@ -792,7 +792,7 @@ getInfoPerOS().forEach(([osName, osType, path]) => { const pythonFile = 'xyz.py'; setupIoc(pythonPath); setupActiveEditor(pythonFile, PYTHON_LANGUAGE); - getConfigurationStub.withArgs('debugpy').returns(createMoqConfiguration(testParams.justMyCodeSetting)); + getConfigurationStub.withArgs('debugpy', sinon.match.any).returns(createMoqConfiguration(testParams.justMyCodeSetting)); const debugConfig = await resolveDebugConfiguration(workspaceFolder, { ...launch, justMyCode: testParams.justMyCode, From cdbee94bfc2f86a0f4e20e7c96e6f943abae5eb6 Mon Sep 17 00:00:00 2001 From: Paula Camargo Date: Wed, 27 Sep 2023 14:24:34 -0700 Subject: [PATCH 3/3] Fix format --- src/test/unittest/configuration/resolvers/attach.unit.test.ts | 4 +++- src/test/unittest/configuration/resolvers/launch.unit.test.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/test/unittest/configuration/resolvers/attach.unit.test.ts b/src/test/unittest/configuration/resolvers/attach.unit.test.ts index 312b177b..9fe63d2f 100644 --- a/src/test/unittest/configuration/resolvers/attach.unit.test.ts +++ b/src/test/unittest/configuration/resolvers/attach.unit.test.ts @@ -554,7 +554,9 @@ getInfoPerOS().forEach(([osName, osType, path]) => { .slice() .concat(DebugOptions.Jinja, DebugOptions.Sudo) as DebugOptions[]; - getConfigurationStub.withArgs('debugpy', sinon.match.any).returns(createMoqConfiguration(testParams.justMyCodeSetting)); + getConfigurationStub + .withArgs('debugpy', sinon.match.any) + .returns(createMoqConfiguration(testParams.justMyCodeSetting)); const debugConfig = await resolveDebugConfiguration(workspaceFolder, { ...attach, debugOptions, diff --git a/src/test/unittest/configuration/resolvers/launch.unit.test.ts b/src/test/unittest/configuration/resolvers/launch.unit.test.ts index 71ebe44e..b2dd2e1a 100644 --- a/src/test/unittest/configuration/resolvers/launch.unit.test.ts +++ b/src/test/unittest/configuration/resolvers/launch.unit.test.ts @@ -792,7 +792,9 @@ getInfoPerOS().forEach(([osName, osType, path]) => { const pythonFile = 'xyz.py'; setupIoc(pythonPath); setupActiveEditor(pythonFile, PYTHON_LANGUAGE); - getConfigurationStub.withArgs('debugpy', sinon.match.any).returns(createMoqConfiguration(testParams.justMyCodeSetting)); + getConfigurationStub + .withArgs('debugpy', sinon.match.any) + .returns(createMoqConfiguration(testParams.justMyCodeSetting)); const debugConfig = await resolveDebugConfiguration(workspaceFolder, { ...launch, justMyCode: testParams.justMyCode,