mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
make events to open new sql query window (#2688)
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}));
|
||||
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}));
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user