Merge VS Code 1.31.1 (#4283)

This commit is contained in:
Matt Irvine
2019-03-15 13:09:45 -07:00
committed by GitHub
parent 7d31575149
commit 86bac90001
1716 changed files with 53308 additions and 48375 deletions

View File

@@ -14,7 +14,7 @@ import { IListStyles } from 'vs/base/browser/ui/list/listWidget';
import { SelectBoxNative } from 'vs/base/browser/ui/selectBox/selectBoxNative';
import { SelectBoxList } from 'vs/base/browser/ui/selectBox/selectBoxCustom';
import { isMacintosh } from 'vs/base/common/platform';
import { IContentActionHandler } from 'vs/base/browser/htmlContentRenderer';
// Public SelectBox interface - Calls routed to appropriate select implementation class
@@ -22,10 +22,9 @@ export interface ISelectBoxDelegate {
// Public SelectBox Interface
readonly onDidSelect: Event<ISelectData>;
setOptions(options: string[], selected?: number, disabled?: number): void;
setOptions(options: ISelectOptionItem[], selected?: number);
select(index: number): void;
setAriaLabel(label: string);
setDetailsProvider(provider: (index: number) => { details: string, isMarkdown: boolean });
focus(): void;
blur(): void;
dispose(): void;
@@ -37,16 +36,25 @@ export interface ISelectBoxDelegate {
}
export interface ISelectBoxOptions {
useCustomDrawn?: boolean;
ariaLabel?: string;
minBottomMargin?: number;
hasDetails?: boolean;
markdownActionHandler?: IContentActionHandler;
}
// Utilize optionItem interface to capture all option parameters
export interface ISelectOptionItem {
text: string;
decoratorRight?: string;
description?: string;
descriptionIsMarkdown?: boolean;
isDisabled?: boolean;
}
export interface ISelectBoxStyles extends IListStyles {
selectBackground?: Color;
selectListBackground?: Color;
selectForeground?: Color;
decoratorRightForeground?: Color;
selectBorder?: Color;
selectListBorder?: Color;
focusBorder?: Color;
@@ -72,13 +80,13 @@ export class SelectBox extends Widget implements ISelectBoxDelegate {
private styles: ISelectBoxStyles;
private selectBoxDelegate: ISelectBoxDelegate;
constructor(options: string[], selected: number, contextViewProvider: IContextViewProvider, styles: ISelectBoxStyles = deepClone(defaultStyles), selectBoxOptions?: ISelectBoxOptions) {
constructor(options: ISelectOptionItem[], selected: number, contextViewProvider: IContextViewProvider, styles: ISelectBoxStyles = deepClone(defaultStyles), selectBoxOptions?: ISelectBoxOptions) {
super();
mixin(this.styles, defaultStyles, false);
// Instantiate select implementation based on platform
if (isMacintosh && !(selectBoxOptions && selectBoxOptions.hasDetails)) {
// Default to native SelectBox for OSX unless overridden
if (isMacintosh && !(selectBoxOptions && selectBoxOptions.useCustomDrawn)) {
this.selectBoxDelegate = new SelectBoxNative(options, selected, styles, selectBoxOptions);
} else {
this.selectBoxDelegate = new SelectBoxList(options, selected, contextViewProvider, styles, selectBoxOptions);
@@ -96,8 +104,8 @@ export class SelectBox extends Widget implements ISelectBoxDelegate {
return this.selectBoxDelegate.onDidSelect;
}
public setOptions(options: string[], selected?: number, disabled?: number): void {
this.selectBoxDelegate.setOptions(options, selected, disabled);
public setOptions(options: ISelectOptionItem[], selected?: number): void {
this.selectBoxDelegate.setOptions(options, selected);
}
public select(index: number): void {
@@ -108,10 +116,6 @@ export class SelectBox extends Widget implements ISelectBoxDelegate {
this.selectBoxDelegate.setAriaLabel(label);
}
public setDetailsProvider(provider: (index: number) => { details: string, isMarkdown: boolean }): void {
this.selectBoxDelegate.setDetailsProvider(provider);
}
public focus(): void {
this.selectBoxDelegate.focus();
}