Merge from vscode a348d103d1256a06a2c9b3f9b406298a9fef6898 (#15681)

* Merge from vscode a348d103d1256a06a2c9b3f9b406298a9fef6898

* Fixes and cleanup

* Distro

* Fix hygiene yarn

* delete no yarn lock changes file

* Fix hygiene

* Fix layer check

* Fix CI

* Skip lib checks

* Remove tests deleted in vs code

* Fix tests

* Distro

* Fix tests and add removed extension point

* Skip failing notebook tests for now

* Disable broken tests and cleanup build folder

* Update yarn.lock and fix smoke tests

* Bump sqlite

* fix contributed actions and file spacing

* Fix user data path

* Update yarn.locks

Co-authored-by: ADS Merger <karlb@microsoft.com>
This commit is contained in:
Charles Gagnon
2021-06-17 08:17:11 -07:00
committed by GitHub
parent fdcb97c7f7
commit 3cb2f552a6
2582 changed files with 124827 additions and 87099 deletions

View File

@@ -5,7 +5,7 @@
import 'vs/css!./media/queryActions';
import * as nls from 'vs/nls';
import { Action, IActionViewItem, IActionRunner } from 'vs/base/common/actions';
import { Action, IActionRunner } from 'vs/base/common/actions';
import { IDisposable, Disposable } from 'vs/base/common/lifecycle';
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
@@ -45,6 +45,7 @@ import { IQueryManagementService } from 'sql/workbench/services/query/common/que
import { ILogService } from 'vs/platform/log/common/log';
import { IRange } from 'vs/editor/common/core/range';
import { getErrorMessage, onUnexpectedError } from 'vs/base/common/errors';
import { IActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar';
/**
* Action class that query-based Actions will extend. This base class automatically handles activating and
@@ -65,11 +66,6 @@ export abstract class QueryTaskbarAction extends Action {
this._setCssClass(enabledClass);
}
/**
* This method is executed when the button is clicked.
*/
public abstract run(): Promise<void>;
protected updateCssClass(enabledClass: string): void {
// set the class, useful on change of label or icon
this._setCssClass(enabledClass);
@@ -207,7 +203,7 @@ export class RunQueryAction extends QueryTaskbarAction {
this.label = nls.localize('runQueryLabel', "Run");
}
public async run(): Promise<void> {
public override async run(): Promise<void> {
if (!this.editor.isSelectionEmpty()) {
if (this.isConnected(this.editor)) {
// If we are already connected, run the query
@@ -279,7 +275,7 @@ export class CancelQueryAction extends QueryTaskbarAction {
this.label = nls.localize('cancelQueryLabel', "Cancel");
}
public async run(): Promise<void> {
public override async run(): Promise<void> {
if (this.isConnected(this.editor)) {
if (!this.editor.input) {
this.logService.error('editor input was null');
@@ -306,7 +302,7 @@ export class EstimatedQueryPlanAction extends QueryTaskbarAction {
this.label = nls.localize('estimatedQueryPlan', "Explain");
}
public async run(): Promise<void> {
public override async run(): Promise<void> {
if (!this.editor.isSelectionEmpty()) {
if (this.isConnected(this.editor)) {
// If we are already connected, run the query
@@ -345,7 +341,7 @@ export class ActualQueryPlanAction extends QueryTaskbarAction {
this.label = nls.localize('actualQueryPlan', "Actual");
}
public async run(): Promise<void> {
public override async run(): Promise<void> {
if (!this.editor.isSelectionEmpty()) {
if (this.isConnected(this.editor)) {
// If we are already connected, run the query
@@ -392,7 +388,7 @@ export class DisconnectDatabaseAction extends QueryTaskbarAction {
this.label = nls.localize('disconnectDatabaseLabel', "Disconnect");
}
public async run(): Promise<void> {
public override async run(): Promise<void> {
// Call disconnectEditor regardless of the connection state and let the ConnectionManagementService
// determine if we need to disconnect, cancel an in-progress conneciton, or do nothing
this.connectionManagementService.disconnectEditor(this.editor.input);
@@ -430,7 +426,7 @@ export class ConnectDatabaseAction extends QueryTaskbarAction {
this.label = label;
}
public async run(): Promise<void> {
public override async run(): Promise<void> {
this.connectEditor(this.editor);
return;
}
@@ -478,7 +474,7 @@ export class ToggleConnectDatabaseAction extends QueryTaskbarAction {
}
public async run(): Promise<void> {
public override async run(): Promise<void> {
if (!this.editor.input.isSharedSession) {
if (this.connected) {
// Call disconnectEditor regardless of the connection state and let the ConnectionManagementService
@@ -509,7 +505,7 @@ export class ListDatabasesAction extends QueryTaskbarAction {
this.class = ListDatabasesAction.EnabledClass;
}
public async run(): Promise<void> {
public override async run(): Promise<void> {
return;
}
}
@@ -551,7 +547,7 @@ export class ToggleSqlCmdModeAction extends QueryTaskbarAction {
this.isSqlCmdMode ? this.updateCssClass(ToggleSqlCmdModeAction.DisableSqlcmdClass) : this.updateCssClass(ToggleSqlCmdModeAction.EnableSqlcmdClass);
}
public async run(): Promise<void> {
public override async run(): Promise<void> {
const toSqlCmdState = !this.isSqlCmdMode; // input.state change triggers event that changes this.isSqlCmdMode, so store it before using
this.editor.input.state.isSqlCmdMode = toSqlCmdState;
@@ -844,7 +840,7 @@ export class ExportAsNotebookAction extends QueryTaskbarAction {
this.label = nls.localize('queryEditor.exportSqlAsNotebook', "Export as Notebook");
}
public async run(): Promise<void> {
public override async run(): Promise<void> {
this._commandService.executeCommand('mssql.exportSqlAsNotebook', this.editor.input.uri);
}
}