Adding group by schema button to OE (#22083)

This commit is contained in:
Aasim Khan
2023-03-02 11:35:33 -08:00
committed by GitHub
parent 345c6b16e3
commit 9033ed5583
10 changed files with 129 additions and 5 deletions

View File

@@ -31,3 +31,5 @@ export const configObjectExplorerGroupBySchemaFlagName = 'mssql.objectExplorer.g
// COMMANDNAMES //////////////////////////////////////////////////////////
export const cmdObjectExplorerEnableGroupBySchemaCommand = 'mssql.enableGroupBySchema';
export const cmdObjectExplorerDisableGroupBySchemaCommand = 'mssql.disableGroupBySchema';
export const cmdObjectExplorerEnabbleGroupBySchemaTitleCommand = 'mssql.enableGroupBySchemaTitle';
export const cmdObjectExplorerDisableGroupBySchemaTitleCommand = 'mssql.disableGroupBySchemaTitle';

View File

@@ -90,10 +90,22 @@ export async function activate(context: vscode.ExtensionContext): Promise<IExten
}));
context.subscriptions.push(vscode.commands.registerCommand(Constants.cmdObjectExplorerEnableGroupBySchemaCommand, async () => {
TelemetryReporter.sendActionEvent(TelemetryViews.MssqlObjectExplorer, TelemetryActions.EnableGroupBySchemaContextMenu)
await vscode.workspace.getConfiguration().update(Constants.configObjectExplorerGroupBySchemaFlagName, true, true);
}));
context.subscriptions.push(vscode.commands.registerCommand(Constants.cmdObjectExplorerDisableGroupBySchemaCommand, async () => {
TelemetryReporter.sendActionEvent(TelemetryViews.MssqlObjectExplorer, TelemetryActions.DisableGroupBySchemaContextMenu)
await vscode.workspace.getConfiguration().update(Constants.configObjectExplorerGroupBySchemaFlagName, false, true);
}));
context.subscriptions.push(vscode.commands.registerCommand(Constants.cmdObjectExplorerEnabbleGroupBySchemaTitleCommand, async () => {
TelemetryReporter.sendActionEvent(TelemetryViews.MssqlObjectExplorer, TelemetryActions.EnableGroupByServerViewTitleAction)
await vscode.workspace.getConfiguration().update(Constants.configObjectExplorerGroupBySchemaFlagName, true, true);
}));
context.subscriptions.push(vscode.commands.registerCommand(Constants.cmdObjectExplorerDisableGroupBySchemaTitleCommand, async () => {
TelemetryReporter.sendActionEvent(TelemetryViews.MssqlObjectExplorer, TelemetryActions.DisableGroupByServerViewTitleAction)
await vscode.workspace.getConfiguration().update(Constants.configObjectExplorerGroupBySchemaFlagName, false, true);
}));

View File

@@ -84,4 +84,8 @@ export enum TelemetryViews {
export enum TelemetryActions {
GroupBySchemaEnabled = 'objectExplorerGroupBySchemaEnabled',
GroupBySchemaDisabled = 'objectExplorerGroupBySchemaDisabled',
EnableGroupBySchemaContextMenu = 'objectExplorerEnableGroupBySchemaContextMenu',
DisableGroupBySchemaContextMenu = 'objectExplorerDisableGroupBySchemaContextMenu',
EnableGroupByServerViewTitleAction = 'objectExplorerEnableGroupByServerViewTitleAction',
DisableGroupByServerViewTitleAction = 'objectExplorerDisableGroupByServerViewTitleAction',
}