Skip to content

Commit 422bec7

Browse files
Fix error in workspace (microsoft#101)
* Fix error in workspace * fix test and lint * Fix format
1 parent d2a7cb4 commit 422bec7

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

src/extension/debugger/configuration/resolvers/attach.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ export class AttachConfigurationResolver extends BaseConfigurationResolver<Attac
4343
debugConfiguration.host = 'localhost';
4444
}
4545
if (debugConfiguration.justMyCode === undefined) {
46-
debugConfiguration.justMyCode = getConfiguration('debugpy').get<boolean>('debugJustMyCode', true);
46+
debugConfiguration.justMyCode = getConfiguration('debugpy', workspaceFolder).get<boolean>(
47+
'debugJustMyCode',
48+
true,
49+
);
4750
}
4851
debugConfiguration.showReturnValue = debugConfiguration.showReturnValue !== false;
4952
// Pass workspace folder so we can get this when we get debug events firing.

src/extension/debugger/configuration/resolvers/launch.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ export class LaunchConfigurationResolver extends BaseConfigurationResolver<Launc
103103
debugConfiguration.debugOptions = [];
104104
}
105105
if (debugConfiguration.justMyCode === undefined) {
106-
debugConfiguration.justMyCode = getConfiguration('debugpy').get<boolean>('debugJustMyCode', true);
106+
debugConfiguration.justMyCode = getConfiguration('debugpy', workspaceFolder).get<boolean>(
107+
'debugJustMyCode',
108+
true,
109+
);
107110
}
108111
// Pass workspace folder so we can get this when we get debug events firing.
109112
debugConfiguration.workspaceFolder = workspaceFolder ? workspaceFolder.fsPath : undefined;

src/test/unittest/configuration/resolvers/attach.unit.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ getInfoPerOS().forEach(([osName, osType, path]) => {
5353
getWorkspaceFoldersStub = sinon.stub(vscodeapi, 'getWorkspaceFolders');
5454
getOSTypeStub.returns(osType);
5555
getConfigurationStub = sinon.stub(vscodeapi, 'getConfiguration');
56-
getConfigurationStub.withArgs('debugpy').returns(createMoqConfiguration(true));
56+
getConfigurationStub.withArgs('debugpy', sinon.match.any).returns(createMoqConfiguration(true));
5757
});
5858

5959
teardown(() => {
@@ -554,7 +554,9 @@ getInfoPerOS().forEach(([osName, osType, path]) => {
554554
.slice()
555555
.concat(DebugOptions.Jinja, DebugOptions.Sudo) as DebugOptions[];
556556

557-
getConfigurationStub.withArgs('debugpy').returns(createMoqConfiguration(testParams.justMyCodeSetting));
557+
getConfigurationStub
558+
.withArgs('debugpy', sinon.match.any)
559+
.returns(createMoqConfiguration(testParams.justMyCodeSetting));
558560
const debugConfig = await resolveDebugConfiguration(workspaceFolder, {
559561
...attach,
560562
debugOptions,

src/test/unittest/configuration/resolvers/launch.unit.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ getInfoPerOS().forEach(([osName, osType, path]) => {
5151
getEnvFileStub = sinon.stub(settings, 'getEnvFile');
5252
getDebugEnvironmentVariablesStub = sinon.stub(helper, 'getDebugEnvironmentVariables');
5353
getConfigurationStub = sinon.stub(vscodeapi, 'getConfiguration');
54-
getConfigurationStub.withArgs('debugpy').returns(createMoqConfiguration(true));
54+
getConfigurationStub.withArgs('debugpy', sinon.match.any).returns(createMoqConfiguration(true));
5555
});
5656

5757
teardown(() => {
@@ -792,7 +792,9 @@ getInfoPerOS().forEach(([osName, osType, path]) => {
792792
const pythonFile = 'xyz.py';
793793
setupIoc(pythonPath);
794794
setupActiveEditor(pythonFile, PYTHON_LANGUAGE);
795-
getConfigurationStub.withArgs('debugpy').returns(createMoqConfiguration(testParams.justMyCodeSetting));
795+
getConfigurationStub
796+
.withArgs('debugpy', sinon.match.any)
797+
.returns(createMoqConfiguration(testParams.justMyCodeSetting));
796798
const debugConfig = await resolveDebugConfiguration(workspaceFolder, {
797799
...launch,
798800
justMyCode: testParams.justMyCode,

0 commit comments

Comments
 (0)