mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-20 01:25:37 -05:00
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:
@@ -41,7 +41,7 @@ export class CmsConnectionController extends ConnectionController {
|
||||
}, providerName);
|
||||
}
|
||||
|
||||
public showUiComponent(container: HTMLElement, authTypeChanged: boolean = false): void {
|
||||
public override showUiComponent(container: HTMLElement, authTypeChanged: boolean = false): void {
|
||||
this._databaseCache = new Map<string, string[]>();
|
||||
this._connectionWidget.createConnectionWidget(container, authTypeChanged);
|
||||
}
|
||||
|
||||
@@ -62,14 +62,14 @@ export class CmsConnectionWidget extends ConnectionWidget {
|
||||
}
|
||||
}
|
||||
|
||||
protected registerListeners(): void {
|
||||
protected override registerListeners(): void {
|
||||
super.registerListeners();
|
||||
if (this._serverDescriptionInputBox) {
|
||||
this._register(styler.attachInputBoxStyler(this._serverDescriptionInputBox, this._themeService));
|
||||
}
|
||||
}
|
||||
|
||||
protected fillInConnectionForm(authTypeChanged: boolean = false): void {
|
||||
protected override fillInConnectionForm(authTypeChanged: boolean = false): void {
|
||||
// Server Name
|
||||
this.addServerNameOption();
|
||||
|
||||
@@ -89,7 +89,7 @@ export class CmsConnectionWidget extends ConnectionWidget {
|
||||
this.addAdvancedOptions();
|
||||
}
|
||||
|
||||
protected addAuthenticationTypeOption(authTypeChanged: boolean = false): void {
|
||||
protected override addAuthenticationTypeOption(authTypeChanged: boolean = false): void {
|
||||
super.addAuthenticationTypeOption(authTypeChanged);
|
||||
let authTypeOption = this._optionsMaps[ConnectionOptionSpecialType.authType];
|
||||
let newAuthTypes = authTypeOption.categoryValues;
|
||||
@@ -124,7 +124,7 @@ export class CmsConnectionWidget extends ConnectionWidget {
|
||||
}
|
||||
}
|
||||
|
||||
public createConnectionWidget(container: HTMLElement, authTypeChanged: boolean = false): void {
|
||||
public override createConnectionWidget(container: HTMLElement, authTypeChanged: boolean = false): void {
|
||||
this._container = DOM.append(container, DOM.$('div.connection-table'));
|
||||
this._tableContainer = DOM.append(this._container, DOM.$('table.connection-table-content'));
|
||||
this.fillInConnectionForm(authTypeChanged);
|
||||
@@ -138,14 +138,14 @@ export class CmsConnectionWidget extends ConnectionWidget {
|
||||
});
|
||||
}
|
||||
|
||||
public handleOnConnecting(): void {
|
||||
public override handleOnConnecting(): void {
|
||||
super.handleOnConnecting();
|
||||
if (this._serverDescriptionInputBox) {
|
||||
this._serverDescriptionInputBox.disable();
|
||||
}
|
||||
}
|
||||
|
||||
public handleResetConnection(): void {
|
||||
public override handleResetConnection(): void {
|
||||
super.handleResetConnection();
|
||||
if (this._serverDescriptionInputBox) {
|
||||
this._serverDescriptionInputBox.enable();
|
||||
@@ -156,7 +156,7 @@ export class CmsConnectionWidget extends ConnectionWidget {
|
||||
return this._serverDescriptionInputBox.value;
|
||||
}
|
||||
|
||||
public connect(model: IConnectionProfile): boolean {
|
||||
public override connect(model: IConnectionProfile): boolean {
|
||||
let validInputs = super.connect(model);
|
||||
if (this._serverDescriptionInputBox) {
|
||||
model.options.registeredServerDescription = this._serverDescriptionInputBox.value;
|
||||
@@ -165,7 +165,7 @@ export class CmsConnectionWidget extends ConnectionWidget {
|
||||
return validInputs;
|
||||
}
|
||||
|
||||
public fillInConnectionInputs(connectionInfo: IConnectionProfile) {
|
||||
public override fillInConnectionInputs(connectionInfo: IConnectionProfile) {
|
||||
super.fillInConnectionInputs(connectionInfo);
|
||||
if (connectionInfo) {
|
||||
let description = connectionInfo.options.registeredServerDescription ? connectionInfo.options.registeredServerDescription : '';
|
||||
|
||||
@@ -48,7 +48,7 @@ export class ClearRecentConnectionsAction extends Action {
|
||||
this._useConfirmationMessage = value;
|
||||
}
|
||||
|
||||
public run(): Promise<void> {
|
||||
public override run(): Promise<void> {
|
||||
if (this._useConfirmationMessage) {
|
||||
return this.promptConfirmationMessage().then(result => {
|
||||
if (result.confirmed) {
|
||||
@@ -124,7 +124,7 @@ export class ClearSingleRecentConnectionAction extends Action {
|
||||
this.enabled = true;
|
||||
}
|
||||
|
||||
public run(): Promise<void> {
|
||||
public override run(): Promise<void> {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
resolve(this._connectionManagementService.clearRecentConnection(this._connectionProfile));
|
||||
this._onRecentConnectionRemoved.fire();
|
||||
@@ -152,7 +152,7 @@ export class GetCurrentConnectionStringAction extends Action {
|
||||
this.enabled = true;
|
||||
}
|
||||
|
||||
public run(): Promise<void> {
|
||||
public override run(): Promise<void> {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
let activeInput = this._editorService.activeEditor;
|
||||
if (activeInput && (activeInput instanceof QueryEditorInput || activeInput instanceof EditDataInput || activeInput instanceof DashboardInput)
|
||||
|
||||
@@ -22,13 +22,13 @@ import { ServerTreeRenderer } from 'sql/workbench/services/objectExplorer/browse
|
||||
import { TreeUpdateUtils } from 'sql/workbench/services/objectExplorer/browser/treeUpdateUtils';
|
||||
import { TreeNode } from 'sql/workbench/services/objectExplorer/common/treeNode';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { ActionBar, IActionViewItemProvider } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { status } from 'vs/base/browser/ui/aria/aria';
|
||||
import { IIdentityProvider, IListVirtualDelegate } from 'vs/base/browser/ui/list/list';
|
||||
import { IListAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget';
|
||||
import { ProgressBar } from 'vs/base/browser/ui/progressbar/progressbar';
|
||||
import { IAsyncDataSource, ITreeNode, ITreeRenderer } from 'vs/base/browser/ui/tree/tree';
|
||||
import { IAction, IActionViewItemProvider } from 'vs/base/common/actions';
|
||||
import { IAction } from 'vs/base/common/actions';
|
||||
import { debounce } from 'vs/base/common/decorators';
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
import { Iterable } from 'vs/base/common/iterator';
|
||||
@@ -42,7 +42,7 @@ import { createAndFillInContextMenuActions, MenuEntryActionViewItem } from 'vs/p
|
||||
import { IMenuService, MenuId, MenuItemAction } from 'vs/platform/actions/common/actions';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IContextMenuService, IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { FileKind } from 'vs/platform/files/common/files';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
@@ -602,9 +602,9 @@ class ConnectionBrowseTreeMenuProvider {
|
||||
return [];
|
||||
}
|
||||
|
||||
const contextKeyService = this.contextKeyService.createScoped();
|
||||
const contextKey = new ContextKey(contextKeyService);
|
||||
contextKey.set(context);
|
||||
const contextKeyService = context instanceof ConnectionDialogTreeProviderElement ?
|
||||
this.contextKeyService.createOverlay([['treeId', context.id]]) :
|
||||
this.contextKeyService.createOverlay([['contextValue', context.contextValue]]);
|
||||
const menu = this.menuService.createMenu(MenuId.ConnectionDialogBrowseTreeContext, contextKeyService);
|
||||
const primary: IAction[] = [];
|
||||
const secondary: IAction[] = [];
|
||||
@@ -725,37 +725,3 @@ class TreeItemRenderer extends Disposable implements ITreeRenderer<ITreeItemFrom
|
||||
templateData.elementDisposable.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
type ContextValueType = ITreeItem | ConnectionDialogTreeProviderElement;
|
||||
|
||||
class ContextKey extends Disposable implements IContextKey<ContextValueType> {
|
||||
static readonly ContextValue = new RawContextKey<string | undefined>('contextValue', undefined);
|
||||
static readonly TreeId = new RawContextKey<string | undefined>('treeId', undefined);
|
||||
private _contextValueKey: IContextKey<string | undefined>;
|
||||
private _treeIdKey: IContextKey<string | undefined>;
|
||||
private _item: ContextValueType;
|
||||
|
||||
constructor(
|
||||
@IContextKeyService contextKeyService: IContextKeyService
|
||||
) {
|
||||
super();
|
||||
this._contextValueKey = ContextKey.ContextValue.bindTo(contextKeyService);
|
||||
this._treeIdKey = ContextKey.TreeId.bindTo(contextKeyService);
|
||||
}
|
||||
set(value: ContextValueType): void {
|
||||
this.reset();
|
||||
this._item = value;
|
||||
if (value instanceof ConnectionDialogTreeProviderElement) {
|
||||
this._treeIdKey.set(value.id);
|
||||
} else {
|
||||
this._contextValueKey.set(value.contextValue);
|
||||
}
|
||||
}
|
||||
reset(): void {
|
||||
this._contextValueKey.reset();
|
||||
this._treeIdKey.reset();
|
||||
}
|
||||
get(): ContextValueType {
|
||||
return this._item;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ export class ConnectionDialogWidget extends Modal {
|
||||
/**
|
||||
* Render the connection flyout
|
||||
*/
|
||||
public render() {
|
||||
public override render() {
|
||||
super.render();
|
||||
attachModalDialogStyler(this, this._themeService);
|
||||
const connectLabel = localize('connectionDialog.connect', "Connect");
|
||||
@@ -285,12 +285,12 @@ export class ConnectionDialogWidget extends Modal {
|
||||
}
|
||||
|
||||
/* Overwrite espace key behavior */
|
||||
protected onClose(e: StandardKeyboardEvent) {
|
||||
protected override onClose(e: StandardKeyboardEvent) {
|
||||
this.cancel();
|
||||
}
|
||||
|
||||
/* Overwrite enter key behavior */
|
||||
protected onAccept(e: StandardKeyboardEvent) {
|
||||
protected override onAccept(e: StandardKeyboardEvent) {
|
||||
if (!e.target.classList.contains('monaco-tree')) {
|
||||
this.connect();
|
||||
}
|
||||
|
||||
@@ -69,12 +69,12 @@ export class RecentConnectionTreeController extends DefaultController {
|
||||
super();
|
||||
}
|
||||
|
||||
protected onLeftClick(tree: ITree, element: any, eventish: ICancelableEvent, origin: string = 'mouse'): boolean {
|
||||
protected override onLeftClick(tree: ITree, element: any, eventish: ICancelableEvent, origin: string = 'mouse'): boolean {
|
||||
this.clickcb(element, eventish, origin);
|
||||
return super.onLeftClick(tree, element, eventish, origin);
|
||||
}
|
||||
|
||||
protected onEnter(tree: ITree, event: IKeyboardEvent): boolean {
|
||||
protected override onEnter(tree: ITree, event: IKeyboardEvent): boolean {
|
||||
super.onEnter(tree, event);
|
||||
this.clickcb(tree.getSelection()[0], event, 'keyboard');
|
||||
return true;
|
||||
@@ -86,7 +86,7 @@ export class RecentConnectionTreeController extends DefaultController {
|
||||
return true;
|
||||
}
|
||||
|
||||
public onMouseDown(tree: ITree, element: any, event: mouse.IMouseEvent, origin: string = 'mouse'): boolean {
|
||||
public override onMouseDown(tree: ITree, element: any, event: mouse.IMouseEvent, origin: string = 'mouse'): boolean {
|
||||
if (event.leftButton || event.middleButton) {
|
||||
return this.onLeftClick(tree, element, event, origin);
|
||||
} else {
|
||||
@@ -94,7 +94,7 @@ export class RecentConnectionTreeController extends DefaultController {
|
||||
}
|
||||
}
|
||||
|
||||
public onKeyDown(tree: ITree, event: IKeyboardEvent): boolean {
|
||||
public override onKeyDown(tree: ITree, event: IKeyboardEvent): boolean {
|
||||
if (event.keyCode === 20) {
|
||||
let element = tree.getFocus();
|
||||
if (element instanceof ConnectionProfile) {
|
||||
|
||||
@@ -115,7 +115,7 @@ suite('ConnectionDialogService tests', () => {
|
||||
});
|
||||
testConnectionDialog = new TestConnectionDialogWidget(providerDisplayNames, providerNameToDisplayMap['MSSQL'], providerNameToDisplayMap, testInstantiationService, mockConnectionManagementService.object, undefined, undefined, viewDescriptorService, new TestThemeService(), new TestLayoutService(), new NullAdsTelemetryService(), new MockContextKeyService(), undefined, new NullLogService(), new TestTextResourcePropertiesService(new TestConfigurationService), new TestConfigurationService());
|
||||
testConnectionDialog.render();
|
||||
testConnectionDialog.renderBody(DOM.createStyleSheet());
|
||||
testConnectionDialog['renderBody'](DOM.createStyleSheet());
|
||||
(connectionDialogService as any)._connectionDialog = testConnectionDialog;
|
||||
|
||||
capabilitiesService.capabilities[Constants.mssqlProviderName] = {
|
||||
|
||||
@@ -68,7 +68,7 @@ suite('ConnectionDialogWidget tests', () => {
|
||||
connectionDialogWidget = new TestConnectionDialogWidget(providerDisplayNames, providerNameToDisplayMap['MSSQL'], providerNameToDisplayMap, cmInstantiationService, mockConnectionManagementService.object, undefined, undefined, viewDescriptorService, new TestThemeService(), new TestLayoutService(), new NullAdsTelemetryService(), new MockContextKeyService(), undefined, new NullLogService(), new TestTextResourcePropertiesService(new TestConfigurationService()), new TestConfigurationService());
|
||||
element = DOM.createStyleSheet();
|
||||
connectionDialogWidget.render();
|
||||
connectionDialogWidget.renderBody(element);
|
||||
connectionDialogWidget['renderBody'](element);
|
||||
});
|
||||
|
||||
teardown(() => {
|
||||
|
||||
@@ -38,7 +38,4 @@ export class TestConnectionDialogWidget extends ConnectionDialogWidget {
|
||||
) {
|
||||
super(providerDisplayNameOptions, selectedProviderType, providerNameToDisplayNameMap, _instantiationService, _connectionManagementService, _contextMenuService, _contextViewService, themeService, layoutService, telemetryService, contextKeyService, clipboardService, logService, textResourcePropertiesService, configurationService);
|
||||
}
|
||||
public renderBody(container: HTMLElement) {
|
||||
super.renderBody(container);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'vs/css!./media/views';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { IDisposable, Disposable, DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IAction, ActionRunner, IActionViewItemProvider } from 'vs/base/common/actions';
|
||||
import { IAction, ActionRunner } from 'vs/base/common/actions';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { IMenuService, MenuId, MenuItemAction, registerAction2, Action2, SubmenuItemAction } from 'vs/platform/actions/common/actions';
|
||||
@@ -21,7 +21,7 @@ import { IExtensionService } from 'vs/workbench/services/extensions/common/exten
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { ResourceLabels, IResourceLabel } from 'vs/workbench/browser/labels';
|
||||
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { ActionBar, IActionViewItemProvider } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { dirname, basename } from 'vs/base/common/resources';
|
||||
import { FileThemeIcon, FolderThemeIcon, registerThemingParticipant, ThemeIcon, IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
@@ -963,7 +963,7 @@ class MultipleSelectionActionRunner extends ActionRunner {
|
||||
}));
|
||||
}
|
||||
|
||||
async runAction(action: IAction, context: TreeViewItemHandleArg): Promise<void> {
|
||||
override async runAction(action: IAction, context: TreeViewItemHandleArg): Promise<void> {
|
||||
const selection = this.getSelectedResources();
|
||||
let selectionHandleArgs: TreeViewItemHandleArg[] | undefined = undefined;
|
||||
let actionInSelected: boolean = false;
|
||||
@@ -1003,15 +1003,16 @@ class TreeMenus extends Disposable implements IDisposable {
|
||||
}
|
||||
|
||||
private getActions(menuId: MenuId, context: { key: string, value?: string }): { primary: IAction[]; secondary: IAction[]; } {
|
||||
const contextKeyService = this.contextKeyService.createScoped();
|
||||
contextKeyService.createKey('view', this.id);
|
||||
contextKeyService.createKey(context.key, context.value);
|
||||
const contextKeyService = this.contextKeyService.createOverlay([
|
||||
['view', this.id],
|
||||
[context.key, context.value]
|
||||
]);
|
||||
|
||||
const menu = this.menuService.createMenu(menuId, contextKeyService);
|
||||
const primary: IAction[] = [];
|
||||
const secondary: IAction[] = [];
|
||||
const result = { primary, secondary };
|
||||
createAndFillInContextMenuActions(menu, { shouldForwardArgs: true }, result, g => /^inline/.test(g));
|
||||
createAndFillInContextMenuActions(menu, { shouldForwardArgs: true }, result, 'inline');
|
||||
|
||||
menu.dispose();
|
||||
|
||||
@@ -1042,7 +1043,7 @@ export class TestTreeView extends TreeView {
|
||||
super(id, title, themeService, instantiationService, commandService, configurationService, progressService, contextMenuService, keybindingService, notificationService, viewDescriptorService, contextKeyService);
|
||||
}
|
||||
|
||||
setVisibility(isVisible: boolean): void {
|
||||
override setVisibility(isVisible: boolean): void {
|
||||
super.setVisibility(isVisible);
|
||||
if (this.visible) {
|
||||
this.activate();
|
||||
|
||||
Reference in New Issue
Block a user