diff --git a/src/vs/workbench/browser/parts/editor/editorGroupView.ts b/src/vs/workbench/browser/parts/editor/editorGroupView.ts index 60788de454..d50c0ff1c5 100644 --- a/src/vs/workbench/browser/parts/editor/editorGroupView.ts +++ b/src/vs/workbench/browser/parts/editor/editorGroupView.ts @@ -46,6 +46,9 @@ import { IMenuService, MenuId, IMenu } from 'vs/platform/actions/common/actions' import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; import { fillInContextMenuActions } from 'vs/platform/actions/browser/menuItemActionItem'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; +// {{SQL CARBON EDIT}} +import { ICommandService } from 'vs/platform/commands/common/commands'; +import { GlobalNewUntitledFileAction } from 'vs/workbench/parts/files/electron-browser/fileActions'; export class EditorGroupView extends Themable implements IEditorGroupView { @@ -126,7 +129,9 @@ export class EditorGroupView extends Themable implements IEditorGroupView { @IUntitledEditorService private untitledEditorService: IUntitledEditorService, @IKeybindingService private keybindingService: IKeybindingService, @IMenuService private menuService: IMenuService, - @IContextMenuService private contextMenuService: IContextMenuService + @IContextMenuService private contextMenuService: IContextMenuService, + // {{SQL CARBON EDIT}} + @ICommandService private commandService: ICommandService ) { super(themeService); @@ -244,8 +249,8 @@ export class EditorGroupView extends Themable implements IEditorGroupView { this._register(addDisposableListener(this.element, EventType.DBLCLICK, e => { if (this.isEmpty()) { EventHelper.stop(e); - - this.openEditor(this.untitledEditorService.createOrGet(), EditorOptions.create({ pinned: true })); + // {{SQL CARBON EDIT}} + this.commandService.executeCommand(GlobalNewUntitledFileAction.ID).done(undefined, err => this.notificationService.warn(err)); } })); diff --git a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts index ac6ae26ee7..d09c2ec571 100644 --- a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts +++ b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts @@ -51,6 +51,8 @@ import * as WorkbenchUtils from 'sql/workbench/common/sqlWorkbenchUtils'; import { IConnectionManagementService } from 'sql/parts/connection/common/connectionManagement'; import { IQueryEditorService } from 'sql/parts/query/common/queryEditorService'; import { IObjectExplorerService } from 'sql/parts/objectExplorer/common/objectExplorerService'; +import { ICommandService } from 'vs/platform/commands/common/commands'; +import { GlobalNewUntitledFileAction } from 'vs/workbench/parts/files/electron-browser/fileActions'; interface IEditorInputLabel { name: string; @@ -94,6 +96,7 @@ export class TabsTitleControl extends TitleControl { @IConfigurationService configurationService: IConfigurationService, // {{SQL CARBON EDIT}} -- Display the editor's tab color @IWorkspaceConfigurationService private workspaceConfigurationService: IWorkspaceConfigurationService, + @ICommandService private commandService: ICommandService, @IConnectionManagementService private connectionService: IConnectionManagementService, @IQueryEditorService private queryEditorService: IQueryEditorService, @IObjectExplorerService private objectExplorerService: IObjectExplorerService @@ -178,8 +181,8 @@ export class TabsTitleControl extends TitleControl { this._register(addDisposableListener(this.tabsContainer, EventType.DBLCLICK, e => { if (e.target === this.tabsContainer) { EventHelper.stop(e); - - this.group.openEditor(this.untitledEditorService.createOrGet(), { pinned: true /* untitled is always pinned */, index: this.group.count /* always at the end */ }); + // {{SQL CARBON EDIT}} + this.commandService.executeCommand(GlobalNewUntitledFileAction.ID).done(undefined, err => this.notificationService.warn(err)); } })); diff --git a/src/vs/workbench/browser/parts/editor/titleControl.ts b/src/vs/workbench/browser/parts/editor/titleControl.ts index a2a1e221eb..c24646f035 100644 --- a/src/vs/workbench/browser/parts/editor/titleControl.ts +++ b/src/vs/workbench/browser/parts/editor/titleControl.ts @@ -73,7 +73,8 @@ export abstract class TitleControl extends Themable { @IContextKeyService private contextKeyService: IContextKeyService, @IKeybindingService private keybindingService: IKeybindingService, @ITelemetryService private telemetryService: ITelemetryService, - @INotificationService private notificationService: INotificationService, + // {{SQL CARBON EDIT}} -- need to make the notification service protected + @INotificationService protected notificationService: INotificationService, @IMenuService private menuService: IMenuService, @IQuickOpenService protected quickOpenService: IQuickOpenService, @IThemeService themeService: IThemeService,