Skip to content

Commit c7fce40

Browse files
committed
Fix for cached debug configuration (microsoft#17354)
1 parent 4a2c7d8 commit c7fce40

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

news/2 Fixes/17353.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix for debug configuration used when no launch.json exists is still used after launch.json is created.

src/client/debugger/extension/configuration/debugConfigurationService.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,19 @@ export class PythonDebugConfigurationService implements IDebugConfigurationServi
8080
// editor context where it was triggered.
8181
throw Error('This configuration can only be used as defined by `purpose`.');
8282
} else {
83-
if ((await this.experiments.inExperiment(CacheDebugConfig.experiment)) && this.cacheDebugConfig) {
84-
debugConfiguration = cloneDeep(this.cacheDebugConfig);
85-
}
8683
if (Object.keys(debugConfiguration).length === 0) {
87-
const configs = await this.provideDebugConfigurations(folder, token);
88-
if (configs === undefined) {
89-
return;
90-
}
91-
if (Array.isArray(configs) && configs.length === 1) {
92-
debugConfiguration = configs[0];
84+
if ((await this.experiments.inExperiment(CacheDebugConfig.experiment)) && this.cacheDebugConfig) {
85+
debugConfiguration = cloneDeep(this.cacheDebugConfig);
86+
} else {
87+
const configs = await this.provideDebugConfigurations(folder, token);
88+
if (configs === undefined) {
89+
return;
90+
}
91+
if (Array.isArray(configs) && configs.length === 1) {
92+
debugConfiguration = configs[0];
93+
}
94+
this.cacheDebugConfig = cloneDeep(debugConfiguration);
9395
}
94-
this.cacheDebugConfig = cloneDeep(debugConfiguration);
9596
}
9697
return this.launchResolver.resolveDebugConfiguration(
9798
folder,

0 commit comments

Comments
 (0)