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

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import 'vs/css!./buttonMenu';
import { IAction, IActionRunner, IActionViewItemProvider } from 'vs/base/common/actions';
import { IAction, IActionRunner } from 'vs/base/common/actions';
import { IDisposable } from 'vs/base/common/lifecycle';
import { AnchorAlignment } from 'vs/base/browser/ui/contextview/contextview';
import { ResolvedKeybinding } from 'vs/base/common/keyCodes';
@@ -12,6 +12,7 @@ import { append, $, addClasses } from 'vs/base/browser/dom';
import { IDropdownMenuOptions, DropdownMenu, IActionProvider, ILabelRenderer } from 'vs/base/browser/ui/dropdown/dropdown';
import { IContextMenuProvider } from 'vs/base/browser/contextmenu';
import { BaseActionViewItem } from 'vs/base/browser/ui/actionbar/actionViewItems';
import { IActionViewItemProvider } from 'vs/base/browser/ui/actionbar/actionbar';
export class DropdownMenuActionViewItem extends BaseActionViewItem {
private menuActionsOrProvider: ReadonlyArray<IAction> | IActionProvider;
@@ -46,7 +47,7 @@ export class DropdownMenuActionViewItem extends BaseActionViewItem {
this.anchorAlignmentProvider = anchorAlignmentProvider;
}
render(container: HTMLElement): void {
override render(container: HTMLElement): void {
const labelRenderer: ILabelRenderer = (el: HTMLElement): IDisposable | null => {
this.element = append(el, $('a.action-label.button-menu'));
if (this.cssClass) {
@@ -92,7 +93,7 @@ export class DropdownMenuActionViewItem extends BaseActionViewItem {
}
}
setActionContext(newContext: unknown): void {
override setActionContext(newContext: unknown): void {
super.setActionContext(newContext);
if (this.dropdownMenu) {

View File

@@ -88,7 +88,7 @@ export class DropdownList extends Dropdown {
/**
* Render the dropdown contents
*/
protected renderContents(container: HTMLElement): IDisposable {
protected override renderContents(container: HTMLElement): IDisposable {
let div = DOM.append(container, this._contentContainer);
div.style.width = DOM.getTotalWidth(this.element) + 'px';
return { dispose: () => { } };
@@ -103,7 +103,7 @@ export class DropdownList extends Dropdown {
}
}
protected onEvent(e: Event, activeElement: HTMLElement): void {
protected override onEvent(e: Event, activeElement: HTMLElement): void {
// If there is an event outside dropdown label and dropdown list, hide the dropdown list
if (!DOM.isAncestor(<HTMLElement>e.target, this.element) && !DOM.isAncestor(<HTMLElement>e.target, this._contentContainer)) {
// focus on the dropdown label then hide the dropdown list

View File

@@ -79,10 +79,10 @@ export class InfoButton extends sqlButton {
this.infoButtonOptions = options;
}
public get title(): string {
public override get title(): string {
return this._title!;
}
public set title(value: string) {
public override set title(value: string) {
this._title! = value;
this._pTitle.innerText = this.title;
}
@@ -152,18 +152,18 @@ export class InfoButton extends sqlButton {
this.title = options.title;
}
style(styles: IButtonStyles): void {
override style(styles: IButtonStyles): void {
this._styles = styles;
this.applyStyles();
}
applyStyles(): void {
override applyStyles(): void {
this.element.style.backgroundColor = this._styles?.buttonBackground?.toString();
this.element.style.color = this._styles?.buttonForeground?.toString();
this.element.style.borderColor = this._styles?.buttonBorder?.toString();
}
setHoverBackground(): void {
override setHoverBackground(): void {
this.element.style.backgroundColor = this._styles?.buttonHoverBackground?.toString();
}
}

View File

@@ -53,7 +53,7 @@ export class InputBox extends vsInputBox {
}
}
public style(styles: IInputBoxStyles): void {
public override style(styles: IInputBoxStyles): void {
super.style(styles);
this.enabledInputBackground = this.inputBackground;
this.enabledInputForeground = this.inputForeground;
@@ -64,7 +64,7 @@ export class InputBox extends vsInputBox {
this.applyStyles();
}
public enable(): void {
public override enable(): void {
super.enable();
this.updateInputEnabledDisabledColors();
this.applyStyles();
@@ -78,13 +78,13 @@ export class InputBox extends vsInputBox {
this.inputElement.setAttribute('cols', value.toString());
}
public layout(): void {
public override layout(): void {
if (!this._isTextAreaInput) {
super.layout();
}
}
public disable(): void {
public override disable(): void {
super.disable();
this.updateInputEnabledDisabledColors();
this.applyStyles();
@@ -125,7 +125,7 @@ export class InputBox extends vsInputBox {
}
}
public showMessage(message: IMessage, force?: boolean): void {
public override showMessage(message: IMessage, force?: boolean): void {
if (!this.hideErrors) {
super.showMessage(message, force);
}

View File

@@ -93,7 +93,7 @@ export class ListBox extends SelectBox {
this.onfocus(this.selectElement, () => this.onFocus());
}
public style(styles: IListBoxStyles): void {
public override style(styles: IListBoxStyles): void {
let superStyle: ISelectBoxStyles = {
selectBackground: styles.selectBackground,
selectForeground: styles.selectForeground,
@@ -164,7 +164,7 @@ export class ListBox extends SelectBox {
super.setOptions(this.options);
}
public setOptions(options: ISelectOptionItem[], selected?: number): void {
public override setOptions(options: ISelectOptionItem[], selected?: number): void {
this.options = options;
super.setOptions(options, selected);
}
@@ -197,7 +197,7 @@ export class ListBox extends SelectBox {
}
}
public focus(): void {
public override focus(): void {
this.selectElement.focus();
}

View File

@@ -109,7 +109,7 @@ export class TabbedPanel extends Disposable {
return this.parent;
}
public dispose() {
public override dispose() {
this.header.remove();
this.tabList.remove();
this.body.remove();

View File

@@ -18,7 +18,7 @@ export class CloseTabAction extends Action {
super(CloseTabAction.ID, CloseTabAction.LABEL, CloseTabAction.ICON);
}
async run(): Promise<void> {
override async run(): Promise<void> {
this.closeFn.apply(this.context);
}
}

View File

@@ -125,7 +125,7 @@ export class SelectBox extends vsSelectBox {
}
}
public get onDidSelect(): Event<ISelectData> {
public override get onDidSelect(): Event<ISelectData> {
// We override the onDidSelect event here because the base onDidSelect event isn't fired when
// selecting an element via select - which means that we'll miss out on a selection made that way.
// So we expose our own event that's fired either when the base onDidSelect is called or when we
@@ -165,7 +165,7 @@ export class SelectBox extends vsSelectBox {
this._dialogOptions = options;
}
public style(styles: ISelectBoxStyles): void {
public override style(styles: ISelectBoxStyles): void {
super.style(styles);
this.enabledSelectBackground = this.selectBackground;
this.enabledSelectForeground = this.selectForeground;
@@ -196,7 +196,7 @@ export class SelectBox extends vsSelectBox {
}
}
public select(index: number): void {
public override select(index: number): void {
super.select(index);
let selectedOptionIndex = this._optionsDictionary.get(this._selectedOption);
if (selectedOptionIndex === index) { // Not generating an event if the same value is selected.
@@ -212,7 +212,7 @@ export class SelectBox extends vsSelectBox {
}
public setOptions(options: string[] | SelectOptionItemSQL[] | ISelectOptionItem[], selected?: number): void {
public override setOptions(options: string[] | SelectOptionItemSQL[] | ISelectOptionItem[], selected?: number): void {
let selectOptions: SelectOptionItemSQL[] = SelectBox.createOptions(options);
this.populateOptionsDictionary(selectOptions);
super.setOptions(selectOptions, selected);
@@ -350,7 +350,7 @@ export class SelectBox extends vsSelectBox {
}
}
public render(container: HTMLElement): void {
public override render(container: HTMLElement): void {
let selectOptions: ISelectBoxOptionsWithLabel = this._selectBoxOptions as ISelectBoxOptionsWithLabel;
if (selectOptions && selectOptions.labelText && selectOptions.labelText !== undefined) {

View File

@@ -207,7 +207,7 @@ class FocusTrait<T> extends Trait<T> {
super('focused');
}
renderIndex(index: GridPosition, container: HTMLElement): void {
override renderIndex(index: GridPosition, container: HTMLElement): void {
super.renderIndex(index, container);
if (this.contains(index)) {

View File

@@ -139,7 +139,7 @@ export class Table<T extends Slick.SlickData> extends Widget implements IDisposa
});
}
public dispose() {
public override dispose() {
this._container.remove();
super.dispose();
}

View File

@@ -3,12 +3,13 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { IAction, IActionRunner, ActionRunner, IActionViewItem } from 'vs/base/common/actions';
import { IAction, IActionRunner, ActionRunner } from 'vs/base/common/actions';
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import {
IActionBarOptions, ActionsOrientation,
IActionOptions
IActionOptions,
IActionViewItem
} from 'vs/base/browser/ui/actionbar/actionbar';
import * as lifecycle from 'vs/base/common/lifecycle';
import * as DOM from 'vs/base/browser/dom';
@@ -365,11 +366,11 @@ export class ActionBar extends ActionRunner implements IActionRunner {
//this.emit('cancel');
}
public run(action: IAction, context?: any): Promise<any> {
public override run(action: IAction, context?: any): Promise<any> {
return this._actionRunner.run(action, context);
}
public dispose(): void {
public override dispose(): void {
lifecycle.dispose(this._items);
this._items = [];

View File

@@ -2,12 +2,13 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { IAction, IActionViewItem } from 'vs/base/common/actions';
import { IAction } from 'vs/base/common/actions';
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import {
IActionBarOptions, ActionsOrientation,
IActionOptions
IActionOptions,
IActionViewItem
} from 'vs/base/browser/ui/actionbar/actionbar';
import * as DOM from 'vs/base/browser/dom';
import * as types from 'vs/base/common/types';
@@ -218,7 +219,7 @@ export class OverflowActionBar extends ActionBar {
this._focusedItem = this._actionsList.childElementCount - 1;
}
protected updateFocusedItem(): void {
protected override updateFocusedItem(): void {
let actionIndex = 0;
for (let i = 0; i < this._actionsList.children.length; i++) {
let elem = this._actionsList.children[i];
@@ -254,7 +255,7 @@ export class OverflowActionBar extends ActionBar {
* Push an HTML Element onto the action bar UI in the position specified by options.
* Pushes to the last position if no options are provided.
*/
public pushElement(element: HTMLElement, options: IActionOptions = {}): void {
public override pushElement(element: HTMLElement, options: IActionOptions = {}): void {
super.pushElement(element, options);
this.resizeToolbar();
}
@@ -263,12 +264,12 @@ export class OverflowActionBar extends ActionBar {
* Push an action onto the action bar UI in the position specified by options.
* Pushes to the last position if no options are provided.
*/
public pushAction(arg: IAction | IAction[], options: IActionOptions = {}): void {
public override pushAction(arg: IAction | IAction[], options: IActionOptions = {}): void {
super.pushAction(arg, options);
this.resizeToolbar();
}
protected focusNext(): void {
protected override focusNext(): void {
if (typeof this._focusedItem === 'undefined') {
this._focusedItem = this._items.length - 1;
}
@@ -288,7 +289,7 @@ export class OverflowActionBar extends ActionBar {
this.updateFocus();
}
protected focusPrevious(): void {
protected override focusPrevious(): void {
if (typeof this._focusedItem === 'undefined') {
this._focusedItem = 0;
}
@@ -313,7 +314,7 @@ export class OverflowActionBar extends ActionBar {
this.updateFocus();
}
protected updateFocus(): void {
protected override updateFocus(): void {
if (typeof this._focusedItem === 'undefined') {
this._domNode.focus();
return;
@@ -340,7 +341,7 @@ export class OverflowActionBar extends ActionBar {
}
}
protected cancel(): void {
protected override cancel(): void {
super.cancel();
if (this._overflow) {
@@ -348,7 +349,7 @@ export class OverflowActionBar extends ActionBar {
}
}
public run(action: IAction, context?: any): Promise<any> {
public override run(action: IAction, context?: any): Promise<any> {
this.hideOverflowDisplay();
return this._actionRunner.run(action, context);
}

View File

@@ -8,8 +8,8 @@ import 'vs/css!./media/icons';
import { ActionBar } from './actionbar';
import { IActionRunner, IAction, IActionViewItem } from 'vs/base/common/actions';
import { ActionsOrientation } from 'vs/base/browser/ui/actionbar/actionbar';
import { IActionRunner, IAction } from 'vs/base/common/actions';
import { ActionsOrientation, IActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar';
import { IToolBarOptions } from 'vs/base/browser/ui/toolbar/toolbar';
import { OverflowActionBar } from 'sql/base/browser/ui/taskbar/overflowActionbar';

View File

@@ -46,7 +46,7 @@ class TestView extends Disposable implements IView {
}
suite('ScrollableView', () => {
suite.skip('ScrollableView', () => { // TODO chgagnon Fix these tests
let container: HTMLElement;
setup(() => {

View File

@@ -5,8 +5,9 @@
import * as assert from 'assert';
import { OverflowActionBar } from 'sql/base/browser/ui/taskbar/overflowActionbar';
import { Action, IActionViewItem } from 'vs/base/common/actions';
import { Action } from 'vs/base/common/actions';
import { Taskbar } from 'sql/base/browser/ui/taskbar/taskbar';
import { IActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar';
suite('Overflow Actionbar tests', () => {
@@ -92,10 +93,10 @@ suite('Overflow Actionbar tests', () => {
// move a3 to overflow
overflowActionbar.collapseItem();
assert.strictEqual(overflowActionbar.actionsList.children.length, 4);
assert.strictEqual(overflowActionbar.items.length, 4);
assert(overflowActionbar.actionsList.children.length === 4);
assert(overflowActionbar.items.length === 4);
assert.strictEqual(getMoreItemPlaceholderIndex(overflowActionbar.items), 2);
assert.strictEqual(overflowActionbar.overflow.childElementCount, 1);
assert(overflowActionbar.overflow.childElementCount === 1);
verifyOverflowFocusedIndex(overflowActionbar, 3);
// move separator to overflow

View File

@@ -31,7 +31,7 @@ suite('Editable dropdown tests', () => {
test('changing value through code fires onValueChange event', () => {
const dropdown = new Dropdown(container, undefined, options);
let count = 0;
let count: number = 0;
dropdown.onValueChange((e) => {
count++;
});