From e21f56d719afaf9fc8df33f9ad4e6ea560db9dc7 Mon Sep 17 00:00:00 2001 From: Alan Ren Date: Tue, 22 Jun 2021 23:53:55 -0700 Subject: [PATCH] open query editor as default editor (#15874) --- src/vs/workbench/browser/parts/editor/editorGroupView.ts | 3 ++- src/vs/workbench/browser/parts/editor/tabsTitleControl.ts | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vs/workbench/browser/parts/editor/editorGroupView.ts b/src/vs/workbench/browser/parts/editor/editorGroupView.ts index c2b35155b6..072e5d88d8 100644 --- a/src/vs/workbench/browser/parts/editor/editorGroupView.ts +++ b/src/vs/workbench/browser/parts/editor/editorGroupView.ts @@ -286,7 +286,8 @@ export class EditorGroupView extends Themable implements IEditorGroupView { if (this.isEmpty) { EventHelper.stop(e); - this.openEditor(this.editorService.createEditorInput({ forceUntitled: true }), EditorOptions.create({ pinned: true })); + // {{SQL CARBON EDIT}} - use editor service to open editor, which will go through the override step and resolve to UntitledQueryEditorInput. + this.editorService.openEditor(this.editorService.createEditorInput({ forceUntitled: true }), EditorOptions.create({ pinned: true })); } })); diff --git a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts index 3cde8c0819..b22ca17421 100644 --- a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts +++ b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts @@ -236,14 +236,13 @@ export class TabsTitleControl extends TitleControl { } EventHelper.stop(e); - - this.group.openEditor( + // {{SQL CARBON EDIT}} - use editor service to open editor, which will go through the override step and resolve to UntitledQueryEditorInput. + this.editorService.openEditor( this.editorService.createEditorInput({ forceUntitled: true }), { pinned: true, // untitled is always pinned index: this.group.count // always at the end - } - ); + }, this.group); })); });