Merge from vscode e3c4990c67c40213af168300d1cfeb71d680f877 (#16569)

This commit is contained in:
Cory Rivera
2021-08-25 16:28:29 -07:00
committed by GitHub
parent ab1112bfb3
commit cb7b7da0a4
1752 changed files with 59525 additions and 33878 deletions

View File

@@ -3,7 +3,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { EditorInput, IEditorInput } from 'vs/workbench/common/editor';
import { IEditorInput } from 'vs/workbench/common/editor';
import { IConnectionManagementService, IConnectableInput, INewConnectionParams } from 'sql/platform/connection/common/connectionManagement';
import { IQueryModelService } from 'sql/workbench/services/query/common/queryModel';
import { Event, Emitter } from 'vs/base/common/event';
@@ -18,6 +18,7 @@ import { UntitledTextEditorInput } from 'vs/workbench/services/untitled/common/u
import { IResolvedTextEditorModel } from 'vs/editor/common/services/resolverService';
import { IUntitledTextEditorModel, UntitledTextEditorModel } from 'vs/workbench/services/untitled/common/untitledTextEditorModel';
import { EncodingMode } from 'vs/workbench/services/textfile/common/textfiles';
import { EditorInput } from 'vs/workbench/common/editor/editorInput';
/**
* Input for the EditDataEditor.

View File

@@ -3,7 +3,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { EditorInput } from 'vs/workbench/common/editor';
import { EditorInput } from 'vs/workbench/common/editor/editorInput';
import { Emitter } from 'vs/base/common/event';
import { URI } from 'vs/base/common/uri';

View File

@@ -3,7 +3,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { EditorInput } from 'vs/workbench/common/editor';
import { EditorInput } from 'vs/workbench/common/editor/editorInput';
import { IDisposable } from 'vs/base/common/lifecycle';
import { URI } from 'vs/base/common/uri';
import { IModelService } from 'vs/editor/common/services/modelService';

View File

@@ -11,7 +11,7 @@ import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
import * as azdata from 'azdata';
import * as nls from 'vs/nls';
import { EditorInput } from 'vs/workbench/common/editor';
import { EditorInput } from 'vs/workbench/common/editor/editorInput';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { Event, Emitter } from 'vs/base/common/event';
import { generateUuid } from 'vs/base/common/uuid';

View File

@@ -5,7 +5,7 @@
import * as azdata from 'azdata';
import * as nls from 'vs/nls';
import { EditorInput } from 'vs/workbench/common/editor';
import { EditorInput } from 'vs/workbench/common/editor/editorInput';
import { Event, Emitter } from 'vs/base/common/event';
import { URI } from 'vs/base/common/uri';
import { DataGridProvider, IDataGridProviderService } from 'sql/workbench/services/dataGridProvider/common/dataGridProviderService';

View File

@@ -5,7 +5,7 @@
import { SelectBox } from 'sql/base/browser/ui/selectBox/selectBox';
import { Button } from 'sql/base/browser/ui/button/button';
import { append, $, addClass, addClasses } from 'vs/base/browser/dom';
import { append, $ } from 'vs/base/browser/dom';
import * as types from 'vs/base/common/types';
@@ -15,9 +15,9 @@ export function appendRow(container: HTMLElement, label: string, labelClass: str
let rowContainer = append(container, $('tr'));
if (rowContainerClass) {
if (types.isString(rowContainerClass)) {
addClass(rowContainer, rowContainerClass);
rowContainer.classList.add(rowContainerClass);
} else {
addClasses(rowContainer, ...rowContainerClass);
rowContainer.classList.add(...rowContainerClass);
}
}
const labelContainer = append(append(rowContainer, $(`td.${labelClass}`)), $('div.dialog-label-container'));

View File

@@ -161,7 +161,7 @@ export abstract class Modal extends Disposable implements IThemable {
* (hyoshi - 10/2/2017 tracked by https://github.com/Microsoft/carbon/issues/1836)
*/
public setWide(isWide: boolean): void {
DOM.toggleClass(this._bodyContainer!, 'wide', isWide);
this._bodyContainer!.classList.toggle('wide', isWide);
}
/**
@@ -356,18 +356,18 @@ export abstract class Modal extends Disposable implements IThemable {
if (this.shouldShowExpandMessageButton) {
DOM.append(this._detailsButtonContainer!, this._toggleMessageDetailButton!.element);
} else {
DOM.removeNode(this._toggleMessageDetailButton!.element);
this._toggleMessageDetailButton!.element.remove();
}
}
private toggleMessageDetail() {
const isExpanded = DOM.hasClass(this._messageSummary!, MESSAGE_EXPANDED_MODE_CLASS);
DOM.toggleClass(this._messageSummary!, MESSAGE_EXPANDED_MODE_CLASS, !isExpanded);
const isExpanded = this._messageSummary!.classList.contains(MESSAGE_EXPANDED_MODE_CLASS);
this._messageSummary!.classList.toggle(MESSAGE_EXPANDED_MODE_CLASS, !isExpanded);
this._toggleMessageDetailButton!.label = isExpanded ? SHOW_DETAILS_TEXT : localize('hideMessageDetails', "Hide Details");
if (this._messageDetailText) {
if (isExpanded) {
DOM.removeNode(this._messageDetail!);
this._messageDetail!.remove();
} else {
DOM.append(this._messageBody!, this._messageDetail!);
}
@@ -576,8 +576,8 @@ export abstract class Modal extends Disposable implements IThemable {
severityText = WARNING_ALT_TEXT;
}
levelClasses.forEach(level => {
DOM.toggleClass(this._messageIcon!, level, selectedLevel === level);
DOM.toggleClass(this._messageElement!, level, selectedLevel === level);
this._messageIcon!.classList.toggle(level, selectedLevel === level);
this._messageElement!.classList.toggle(level, selectedLevel === level);
});
this._messageIcon!.title = severityText;
@@ -586,7 +586,7 @@ export abstract class Modal extends Disposable implements IThemable {
this._messageSummary!.title = message!;
this._messageDetail!.innerText = description;
}
DOM.removeNode(this._messageDetail!);
this._messageDetail!.remove();
this.messagesElementVisible = !!this._messageSummaryText;
// Read out the description to screen readers so they don't have to
// search around for the alert box to hear the extra information

View File

@@ -268,9 +268,10 @@ export default class DeclarativeTableComponent extends ContainerBase<any, azdata
}
private static ACCEPTABLE_VALUES = new Set<string>(['number', 'string', 'boolean']);
public override setProperties(properties: azdata.DeclarativeTableProperties): void {
const basicData: any[][] = properties.data ?? [];
const complexData: azdata.DeclarativeTableCellValue[][] = properties.dataValues ?? [];
public override setProperties(properties: { [key: string]: any; }): void {
let castProperties = properties as azdata.DeclarativeTableProperties;
const basicData: any[][] = castProperties.data ?? [];
const complexData: azdata.DeclarativeTableCellValue[][] = castProperties.dataValues ?? [];
let finalData: azdata.DeclarativeTableCellValue[][];
finalData = basicData.map(row => {
@@ -291,7 +292,7 @@ export default class DeclarativeTableComponent extends ContainerBase<any, azdata
finalData = complexData;
}
this.columns = properties.columns ?? [];
this.columns = castProperties.columns ?? [];
// check whether the data property is changed before actually setting the properties.
const isDataPropertyChanged = !arrayEquals(this.data, finalData ?? [], (a, b) => {

View File

@@ -10,7 +10,7 @@ import {
import * as azdata from 'azdata';
import * as DOM from 'vs/base/browser/dom';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput';
import { TextResourceEditorInput } from 'vs/workbench/common/editor/textResourceEditorInput';
import { URI } from 'vs/base/common/uri';
import { IModeService } from 'vs/editor/common/services/modeService';
import { IModelService } from 'vs/editor/common/services/modelService';
@@ -96,8 +96,8 @@ export default class DiffEditorComponent extends ComponentBase<azdata.DiffEditor
}
});
let editorinput1 = this._instantiationService.createInstance(ResourceEditorInput, uri1, 'source', undefined, undefined);
let editorinput2 = this._instantiationService.createInstance(ResourceEditorInput, uri2, 'target', undefined, undefined);
let editorinput1 = this._instantiationService.createInstance(TextResourceEditorInput, uri1, 'source', undefined, undefined, undefined);
let editorinput2 = this._instantiationService.createInstance(TextResourceEditorInput, uri2, 'target', undefined, undefined, undefined);
this._editorInput = new DiffEditorInput('DiffEditor', undefined, editorinput1, editorinput2, true,
this.labelService, this.fileService);
this._editor.setInput(this._editorInput, undefined, undefined, cancellationTokenSource.token);

View File

@@ -12,7 +12,6 @@ import {
import { GroupLayout, GroupContainerProperties, CssStyles } from 'azdata';
import { ContainerBase } from 'sql/workbench/browser/modelComponents/componentBase';
import { endsWith } from 'vs/base/common/strings';
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { KeyCode } from 'vs/base/common/keyCodes';
import * as DOM from 'vs/base/browser/dom';
@@ -107,7 +106,7 @@ export default class GroupContainer extends ContainerBase<GroupLayout, GroupCont
public getContainerWidth(): string {
if (this._containerLayout && this._containerLayout.width) {
let width: string = this._containerLayout.width.toString();
if (!endsWith(width, '%') && !endsWith(width.toLowerCase(), 'px')) {
if (!width.endsWith('%') && !width.toLowerCase().endsWith('px')) {
width = width + 'px';
}
return width;

View File

@@ -8,7 +8,6 @@ import {
OnDestroy, AfterViewInit, ElementRef, ViewChild
} from '@angular/core';
import * as DOM from 'vs/base/browser/dom';
import * as azdata from 'azdata';
import { ITitledComponent } from 'sql/workbench/browser/modelComponents/interfaces';
import { ComponentWithIconBase } from 'sql/workbench/browser/modelComponents/componentWithIconBase';
@@ -56,7 +55,7 @@ export default class ImageComponent extends ComponentWithIconBase<azdata.ImageCo
if (this.iconPath) {
if (!this._iconClass) {
super.updateIcon();
DOM.addClasses(this.imageContainer.nativeElement, this._iconClass, 'icon');
this.imageContainer.nativeElement.classList.add(this._iconClass, 'icon');
} else {
super.updateIcon();
}

View File

@@ -22,7 +22,6 @@ import { inputBackground, inputBorder } from 'vs/platform/theme/common/colorRegi
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { KeyCode } from 'vs/base/common/keyCodes';
import * as DOM from 'vs/base/browser/dom';
import { assign } from 'vs/base/common/objects';
import { IComponent, IComponentDescriptor, IModelStore, ComponentEventType } from 'sql/platform/dashboard/browser/interfaces';
import { isNumber } from 'vs/base/common/types';
import { convertSize, convertSizeToNumber } from 'sql/base/browser/dom';
@@ -89,7 +88,7 @@ export default class InputBoxComponent extends ComponentBase<azdata.InputBoxProp
this.registerInput(this._input, () => !this.multiline);
}
if (this._textareaContainer) {
let textAreaInputOptions = assign({}, inputOptions, { flexibleHeight: true, type: 'textarea' });
let textAreaInputOptions = Object.assign({}, inputOptions, { flexibleHeight: true, type: 'textarea' });
this._textAreaInput = new InputBox(this._textareaContainer.nativeElement, this.contextViewService, textAreaInputOptions);
this.onkeydown(this._textAreaInput.inputElement, (e: StandardKeyboardEvent) => {
if (this.tryHandleKeyEvent(e)) {

View File

@@ -7,12 +7,13 @@ import 'vs/css!./media/modelViewEditor';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { EditorPane } from 'vs/workbench/browser/parts/editor/editorPane';
import { EditorOptions, IEditorOpenContext } from 'vs/workbench/common/editor';
import { IEditorOpenContext } from 'vs/workbench/common/editor';
import * as DOM from 'vs/base/browser/dom';
import { ModelViewInput } from 'sql/workbench/browser/modelComponents/modelViewInput';
import { CancellationToken } from 'vs/base/common/cancellation';
import { IStorageService } from 'vs/platform/storage/common/storage';
import { IEditorOptions } from 'vs/platform/editor/common/editor';
export class ModelViewEditor extends EditorPane {
@@ -62,7 +63,7 @@ export class ModelViewEditor extends EditorPane {
}
}
override async setInput(input: ModelViewInput, options?: EditorOptions, context?: IEditorOpenContext): Promise<void> {
override async setInput(input: ModelViewInput, options?: IEditorOptions, context?: IEditorOpenContext): Promise<void> {
if (this.input && this.input.matches(input)) {
return Promise.resolve(undefined);
}

View File

@@ -6,7 +6,7 @@
import * as azdata from 'azdata';
import { IEditorModel } from 'vs/platform/editor/common/editor';
import { EditorInput, EditorModel, IEditorInput } from 'vs/workbench/common/editor';
import { IEditorInput } from 'vs/workbench/common/editor';
import * as DOM from 'vs/base/browser/dom';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
@@ -15,6 +15,8 @@ import { Emitter, Event } from 'vs/base/common/event';
import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { URI } from 'vs/base/common/uri';
import { EditorModel } from 'vs/workbench/common/editor/editorModel';
import { EditorInput } from 'vs/workbench/common/editor/editorInput';
export type ModeViewSaveHandler = (handle: number) => Thenable<boolean>;

View File

@@ -6,7 +6,7 @@
import { IEditorOptions, EditorOption } from 'vs/editor/common/config/editorOptions';
import * as nls from 'vs/nls';
import * as DOM from 'vs/base/browser/dom';
import { ResourceEditorModel } from 'vs/workbench/common/editor/resourceEditorModel';
import { TextResourceEditorModel } from 'vs/workbench/common/editor/textResourceEditorModel';
import * as editorCommon from 'vs/editor/common/editorCommon';
import { BaseTextEditor, IEditorConfiguration } from 'vs/workbench/browser/parts/editor/textEditor';
@@ -15,13 +15,14 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { IStorageService } from 'vs/platform/storage/common/storage';
import { ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfigurationService';
import { EditorOptions, IEditorOpenContext } from 'vs/workbench/common/editor';
import { IEditorOpenContext } from 'vs/workbench/common/editor';
import { CancellationToken } from 'vs/base/common/cancellation';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
import { UntitledTextEditorInput } from 'vs/workbench/services/untitled/common/untitledTextEditorInput';
import { CodeEditorWidget } from 'vs/editor/browser/widget/codeEditorWidget';
import { ITextEditorOptions } from 'vs/platform/editor/common/editor';
/**
* Extension of TextResourceEditor that is always readonly rather than only with non UntitledInputs
@@ -85,9 +86,9 @@ export class QueryTextEditor extends BaseTextEditor {
return options;
}
override async setInput(input: UntitledTextEditorInput, options: EditorOptions, context: IEditorOpenContext): Promise<void> {
override async setInput(input: UntitledTextEditorInput, options: ITextEditorOptions, context: IEditorOpenContext): Promise<void> {
await super.setInput(input, options, context, CancellationToken.None);
const editorModel = await this.input.resolve() as ResourceEditorModel;
const editorModel = await this.input.resolve() as TextResourceEditorModel;
await editorModel.resolve();
this.getControl().setModel(editorModel.textEditorModel);
}

View File

@@ -17,8 +17,7 @@ import { Link } from 'vs/platform/opener/browser/link';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import * as DOM from 'vs/base/browser/dom';
import { ILogService } from 'vs/platform/log/common/log';
import { attachLinkStyler } from 'vs/platform/theme/common/styler';
import { IColorTheme, ICssStyleCollector, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
import { IColorTheme, ICssStyleCollector, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
import { errorForeground } from 'vs/platform/theme/common/colorRegistry';
export enum TextType {
@@ -52,8 +51,7 @@ export default class TextComponent extends TitledComponent<azdata.TextComponentP
@Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef,
@Inject(forwardRef(() => ElementRef)) el: ElementRef,
@Inject(IInstantiationService) private instantiationService: IInstantiationService,
@Inject(ILogService) logService: ILogService,
@Inject(IThemeService) private themeService: IThemeService) {
@Inject(ILogService) logService: ILogService) {
super(changeRef, el, logService);
}
@@ -150,7 +148,7 @@ export default class TextComponent extends TitledComponent<azdata.TextComponentP
const linkElement = this._register(this.instantiationService.createInstance(Link, {
label: link.text,
href: link.url
}));
}, undefined));
if (link.accessibilityInformation) {
linkElement.el.setAttribute('aria-label', link.accessibilityInformation.label);
if (link.accessibilityInformation.role) {
@@ -158,7 +156,6 @@ export default class TextComponent extends TitledComponent<azdata.TextComponentP
}
}
this._register(attachLinkStyler(linkElement, this.themeService));
(<HTMLElement>this.textContainer.nativeElement).appendChild(linkElement.el);
// And finally update the text to remove the text up through the placeholder we just added

View File

@@ -144,7 +144,7 @@ export class TreeComponentRenderer extends Disposable implements IRenderer {
templateData.icon.style.backgroundImage = iconUri ? `url('${iconUri.toString(true)}')` : '';
templateData.icon.style.backgroundRepeat = 'no-repeat';
templateData.icon.style.backgroundPosition = 'center';
dom.toggleClass(templateData.icon, 'model-view-tree-node-item-icon', !!icon);
templateData.icon.classList.toggle('model-view-tree-node-item-icon', !!icon);
if (element) {
element.onCheckedChanged = (checked: boolean) => {
this._dataProvider.onNodeCheckedChanged(element.handle, checked);

View File

@@ -14,7 +14,6 @@ import { Extensions, IComponentRegistry } from 'sql/platform/dashboard/browser/m
import { AngularDisposable } from 'sql/base/browser/lifecycle';
import { ModelStore } from 'sql/workbench/browser/modelComponents/modelStore';
import { Event, Emitter } from 'vs/base/common/event';
import { assign } from 'vs/base/common/objects';
import { IModelStore, IComponentDescriptor, IComponent, ModelComponentTypes } from 'sql/platform/dashboard/browser/interfaces';
import { ILogService } from 'vs/platform/log/common/log';
@@ -191,7 +190,7 @@ export abstract class ViewBase extends AngularDisposable implements IModelView {
this.queueAction(componentId, (component) => {
this.logService.debug(`Registering event handler for component ${componentId}`);
this._register(component.registerEventHandler(e => {
let modelViewEvent: IModelViewEventArgs = assign({
let modelViewEvent: IModelViewEventArgs = Object.assign({
componentId: componentId,
isRootComponent: componentId === this.rootDescriptor.id
}, e);