Skip to content

Commit 13df275

Browse files
committed
debug: remove support to open config file to the side
fixes microsoft#97470
1 parent 44bcbe5 commit 13df275

6 files changed

Lines changed: 14 additions & 15 deletions

File tree

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export class ConfigureAction extends AbstractDebugAction {
8181
this.class = configurationManager.selectedConfiguration.name ? 'debug-action codicon codicon-gear' : 'debug-action codicon codicon-gear notification';
8282
}
8383

84-
async run(event?: any): Promise<any> {
84+
async run(): Promise<any> {
8585
if (this.contextService.getWorkbenchState() === WorkbenchState.EMPTY) {
8686
this.notificationService.info(nls.localize('noFolderDebugConfig', "Please first open a folder in order to do advanced debug configuration."));
8787
return;
@@ -105,8 +105,7 @@ export class ConfigureAction extends AbstractDebugAction {
105105
}
106106

107107
if (launch) {
108-
const sideBySide = !!(event && (event.ctrlKey || event.metaKey));
109-
return launch.openConfigFile(sideBySide, false);
108+
return launch.openConfigFile(false);
110109
}
111110
}
112111
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ export function registerCommands(): void {
504504

505505
const launch = manager.getLaunches().find(l => l.uri.toString() === launchUri) || manager.selectedConfiguration.launch;
506506
if (launch) {
507-
const { editor, created } = await launch.openConfigFile(false, false);
507+
const { editor, created } = await launch.openConfigFile(false);
508508
if (editor && !created) {
509509
const codeEditor = <ICodeEditor>editor.getControl();
510510
if (codeEditor) {

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
2222
import { ICommandService } from 'vs/platform/commands/common/commands';
2323
import { IDebugConfigurationProvider, ICompound, IDebugConfiguration, IConfig, IGlobalConfig, IConfigurationManager, ILaunch, IDebugAdapterDescriptorFactory, IDebugAdapter, IDebugSession, IAdapterDescriptor, CONTEXT_DEBUG_CONFIGURATION_TYPE, IDebugAdapterFactory, IConfigPresentation } from 'vs/workbench/contrib/debug/common/debug';
2424
import { Debugger } from 'vs/workbench/contrib/debug/common/debugger';
25-
import { IEditorService, ACTIVE_GROUP, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService';
25+
import { IEditorService, ACTIVE_GROUP } from 'vs/workbench/services/editor/common/editorService';
2626
import { isCodeEditor } from 'vs/editor/browser/editorBrowser';
2727
import { launchSchemaId } from 'vs/workbench/services/configuration/common/configuration';
2828
import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences';
@@ -635,7 +635,7 @@ class Launch extends AbstractLaunch implements ILaunch {
635635
return this.configurationService.inspect<IGlobalConfig>('launch', { resource: this.workspace.uri }).workspaceFolderValue;
636636
}
637637

638-
async openConfigFile(sideBySide: boolean, preserveFocus: boolean, type?: string, token?: CancellationToken): Promise<{ editor: IEditorPane | null, created: boolean }> {
638+
async openConfigFile(preserveFocus: boolean, type?: string, token?: CancellationToken): Promise<{ editor: IEditorPane | null, created: boolean }> {
639639
const resource = this.uri;
640640
let created = false;
641641
let content = '';
@@ -681,7 +681,7 @@ class Launch extends AbstractLaunch implements ILaunch {
681681
pinned: created,
682682
revealIfVisible: true
683683
},
684-
}, sideBySide ? SIDE_GROUP : ACTIVE_GROUP);
684+
}, ACTIVE_GROUP);
685685

686686
return ({
687687
editor: withUndefinedAsNull(editor),
@@ -715,12 +715,12 @@ class WorkspaceLaunch extends AbstractLaunch implements ILaunch {
715715
return this.configurationService.inspect<IGlobalConfig>('launch').workspaceValue;
716716
}
717717

718-
async openConfigFile(sideBySide: boolean, preserveFocus: boolean): Promise<{ editor: IEditorPane | null, created: boolean }> {
718+
async openConfigFile(preserveFocus: boolean): Promise<{ editor: IEditorPane | null, created: boolean }> {
719719

720720
const editor = await this.editorService.openEditor({
721721
resource: this.contextService.getWorkspace().configuration!,
722722
options: { preserveFocus }
723-
}, sideBySide ? SIDE_GROUP : ACTIVE_GROUP);
723+
}, ACTIVE_GROUP);
724724

725725
return ({
726726
editor: withUndefinedAsNull(editor),
@@ -758,7 +758,7 @@ class UserLaunch extends AbstractLaunch implements ILaunch {
758758
return this.configurationService.inspect<IGlobalConfig>('launch').userValue;
759759
}
760760

761-
async openConfigFile(_: boolean, preserveFocus: boolean): Promise<{ editor: IEditorPane | null, created: boolean }> {
761+
async openConfigFile(preserveFocus: boolean): Promise<{ editor: IEditorPane | null, created: boolean }> {
762762
const editor = await this.preferencesService.openGlobalSettings(true, { preserveFocus });
763763
return ({
764764
editor: withUndefinedAsNull(editor),

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

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

6565
return TriggerAction.CLOSE_PICKER;
6666
},

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ export class DebugService implements IDebugService {
405405
const cfg = await this.configurationManager.resolveDebugConfigurationWithSubstitutedVariables(launch && launch.workspace ? launch.workspace.uri : undefined, type, resolvedConfig, initCancellationToken.token);
406406
if (!cfg) {
407407
if (launch && type && cfg === null && !initCancellationToken.token.isCancellationRequested) { // show launch.json only for "config" being "null".
408-
await launch.openConfigFile(false, true, type, initCancellationToken.token);
408+
await launch.openConfigFile(true, type, initCancellationToken.token);
409409
}
410410
return false;
411411
}
@@ -439,15 +439,15 @@ export class DebugService implements IDebugService {
439439
await this.showError(nls.localize('noFolderWorkspaceDebugError', "The active file can not be debugged. Make sure it is saved and that you have a debug extension installed for that file type."));
440440
}
441441
if (launch && !initCancellationToken.token.isCancellationRequested) {
442-
await launch.openConfigFile(false, true, undefined, initCancellationToken.token);
442+
await launch.openConfigFile(true, undefined, initCancellationToken.token);
443443
}
444444

445445
return false;
446446
}
447447
}
448448

449449
if (launch && type && configByProviders === null && !initCancellationToken.token.isCancellationRequested) { // show launch.json only for "config" being "null".
450-
await launch.openConfigFile(false, true, type, initCancellationToken.token);
450+
await launch.openConfigFile(true, type, initCancellationToken.token);
451451
}
452452

453453
return false;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ export interface ILaunch {
717717
/**
718718
* Opens the launch.json file. Creates if it does not exist.
719719
*/
720-
openConfigFile(sideBySide: boolean, preserveFocus: boolean, type?: string, token?: CancellationToken): Promise<{ editor: IEditorPane | null, created: boolean }>;
720+
openConfigFile(preserveFocus: boolean, type?: string, token?: CancellationToken): Promise<{ editor: IEditorPane | null, created: boolean }>;
721721
}
722722

723723
// Debug service interfaces

0 commit comments

Comments
 (0)