Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix getting initial configs from debug adapter #157051

Merged
merged 1 commit into from Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -215,7 +215,7 @@ export class ConfigurationManager implements IConfigurationManager {
disposables.add(input.onDidTriggerItemButton(async (context) => {
resolve(undefined);
const { launch, config } = context.item;
await launch.openConfigFile({ preserveFocus: false, type: config.type });
await launch.openConfigFile({ preserveFocus: false, type: config.type, suppressInitialConfigs: true });
// Only Launch have a pin trigger button
await (launch as Launch).writeConfiguration(config);
await this.selectConfiguration(launch, config.name);
Expand Down Expand Up @@ -564,7 +564,7 @@ class Launch extends AbstractLaunch implements ILaunch {
return this.configurationService.inspect<IGlobalConfig>('launch', { resource: this.workspace.uri }).workspaceFolderValue;
}

async openConfigFile({ preserveFocus, type, useInitialConfigs }: { preserveFocus: boolean; type?: string; useInitialConfigs?: boolean }, token?: CancellationToken): Promise<{ editor: IEditorPane | null; created: boolean }> {
async openConfigFile({ preserveFocus, type, suppressInitialConfigs }: { preserveFocus: boolean; type?: string; suppressInitialConfigs?: boolean }, token?: CancellationToken): Promise<{ editor: IEditorPane | null; created: boolean }> {
const resource = this.uri;
let created = false;
let content = '';
Expand All @@ -573,7 +573,7 @@ class Launch extends AbstractLaunch implements ILaunch {
content = fileContent.value.toString();
} catch {
// launch.json not found: create one by collecting launch configs from debugConfigProviders
content = await this.getInitialConfigurationContent(this.workspace.uri, type, useInitialConfigs, token);
content = await this.getInitialConfigurationContent(this.workspace.uri, type, !suppressInitialConfigs, token);
if (!content) {
// Cancelled
return { editor: null, created: false };
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/contrib/debug/browser/debugQuickAccess.ts
Expand Up @@ -63,7 +63,7 @@ export class StartDebugQuickAccessProvider extends PickerQuickAccessProvider<IPi
tooltip: localize('customizeLaunchConfig', "Configure Launch Configuration")
}],
trigger: () => {
config.launch.openConfigFile({ preserveFocus: false, useInitialConfigs: false });
config.launch.openConfigFile({ preserveFocus: false });

return TriggerAction.CLOSE_PICKER;
},
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/contrib/debug/common/debug.ts
Expand Up @@ -927,7 +927,7 @@ export interface ILaunch {
/**
* Opens the launch.json file. Creates if it does not exist.
*/
openConfigFile(options: { preserveFocus: boolean; type?: string; useInitialConfigs?: boolean }, token?: CancellationToken): Promise<{ editor: IEditorPane | null; created: boolean }>;
openConfigFile(options: { preserveFocus: boolean; type?: string; suppressInitialConfigs?: boolean }, token?: CancellationToken): Promise<{ editor: IEditorPane | null; created: boolean }>;
}

// Debug service interfaces
Expand Down