update parse query action (#22577)

* update parse query action

* revert export notebook change

* comment
This commit is contained in:
Alan Ren
2023-03-31 18:24:47 -07:00
committed by GitHub
parent 0f21ecd531
commit 2a14562ec7
5 changed files with 50 additions and 24 deletions

View File

@@ -48,6 +48,7 @@ import { IActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar';
import { gen3Version, sqlDataWarehouse } from 'sql/platform/connection/common/constants';
import { Dropdown } from 'sql/base/browser/ui/editableDropdown/browser/dropdown';
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
import { Codicon } from 'vs/base/common/codicons';
/**
* Action class that query-based Actions will extend. This base class automatically handles activating and
@@ -916,8 +917,7 @@ export class ExportAsNotebookAction extends QueryTaskbarAction {
@IConnectionManagementService connectionManagementService: IConnectionManagementService,
@ICommandService private _commandService: ICommandService
) {
super(connectionManagementService, editor, ConnectDatabaseAction.ID, ExportAsNotebookAction.IconClass);
super(connectionManagementService, editor, ExportAsNotebookAction.ID, ExportAsNotebookAction.IconClass);
this.label = nls.localize('queryEditor.exportSqlAsNotebook', "Export as Notebook");
}
@@ -929,3 +929,17 @@ export class ExportAsNotebookAction extends QueryTaskbarAction {
export const CATEGORIES = {
ExecutionPlan: { value: nls.localize('ExecutionPlan', 'Execution Plan'), original: 'Execution Plan' }
};
// A wrapper for the ParseSyntaxAction.
// We are not able to reference the ParseSyntaxAction directly in QueryEditor.ts because there is a circular dependency issue.
// The command id is also defined here to avoid duplication.
export const ParseSyntaxCommandId = 'parseQueryAction';
export class ParseSyntaxTaskbarAction extends Action {
constructor(@ICommandService private _commandService: ICommandService) {
super(ParseSyntaxCommandId, nls.localize('queryEditor.parse', "Parse"), Codicon.check.classNames);
}
public override async run(): Promise<void> {
this._commandService.executeCommand(ParseSyntaxCommandId);
}
}