Skip to content

Commit da76f93

Browse files
authored
Fix getting initial configs from debug adapter (microsoft#156947)
Fixes microsoft#156943
1 parent e9bda7a commit da76f93

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ export class ConfigurationManager implements IConfigurationManager {
215215
disposables.add(input.onDidTriggerItemButton(async (context) => {
216216
resolve(undefined);
217217
const { launch, config } = context.item;
218-
await launch.openConfigFile({ preserveFocus: false, type: config.type });
218+
await launch.openConfigFile({ preserveFocus: false, type: config.type, suppressInitialConfigs: true });
219219
// Only Launch have a pin trigger button
220220
await (launch as Launch).writeConfiguration(config);
221221
await this.selectConfiguration(launch, config.name);
@@ -564,7 +564,7 @@ class Launch extends AbstractLaunch implements ILaunch {
564564
return this.configurationService.inspect<IGlobalConfig>('launch', { resource: this.workspace.uri }).workspaceFolderValue;
565565
}
566566

567-
async openConfigFile({ preserveFocus, type, useInitialConfigs }: { preserveFocus: boolean; type?: string; useInitialConfigs?: boolean }, token?: CancellationToken): Promise<{ editor: IEditorPane | null; created: boolean }> {
567+
async openConfigFile({ preserveFocus, type, suppressInitialConfigs }: { preserveFocus: boolean; type?: string; suppressInitialConfigs?: boolean }, token?: CancellationToken): Promise<{ editor: IEditorPane | null; created: boolean }> {
568568
const resource = this.uri;
569569
let created = false;
570570
let content = '';
@@ -573,7 +573,7 @@ class Launch extends AbstractLaunch implements ILaunch {
573573
content = fileContent.value.toString();
574574
} catch {
575575
// launch.json not found: create one by collecting launch configs from debugConfigProviders
576-
content = await this.getInitialConfigurationContent(this.workspace.uri, type, useInitialConfigs, token);
576+
content = await this.getInitialConfigurationContent(this.workspace.uri, type, !suppressInitialConfigs, token);
577577
if (!content) {
578578
// Cancelled
579579
return { editor: null, created: false };

src/vs/workbench/contrib/debug/browser/debugQuickAccess.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export class StartDebugQuickAccessProvider extends PickerQuickAccessProvider<IPi
6363
tooltip: localize('customizeLaunchConfig', "Configure Launch Configuration")
6464
}],
6565
trigger: () => {
66-
config.launch.openConfigFile({ preserveFocus: false, useInitialConfigs: false });
66+
config.launch.openConfigFile({ preserveFocus: false });
6767

6868
return TriggerAction.CLOSE_PICKER;
6969
},

src/vs/workbench/contrib/debug/common/debug.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ export interface ILaunch {
927927
/**
928928
* Opens the launch.json file. Creates if it does not exist.
929929
*/
930-
openConfigFile(options: { preserveFocus: boolean; type?: string; useInitialConfigs?: boolean }, token?: CancellationToken): Promise<{ editor: IEditorPane | null; created: boolean }>;
930+
openConfigFile(options: { preserveFocus: boolean; type?: string; suppressInitialConfigs?: boolean }, token?: CancellationToken): Promise<{ editor: IEditorPane | null; created: boolean }>;
931931
}
932932

933933
// Debug service interfaces

0 commit comments

Comments
 (0)