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

@@ -18,7 +18,7 @@ export interface IToolBarOptions {
orientation?: ActionsOrientation;
actionItemProvider?: IActionItemProvider;
ariaLabel?: string;
getKeyBinding?: (action: IAction) => ResolvedKeybinding;
getKeyBinding?: (action: IAction) => ResolvedKeybinding | undefined;
actionRunner?: IActionRunner;
toggleMenuTitle?: string;
anchorAlignmentProvider?: () => AnchorAlignment;
@@ -31,7 +31,7 @@ export class ToolBar extends Disposable {
private options: IToolBarOptions;
private actionBar: ActionBar;
private toggleMenuAction: ToggleMenuAction;
private toggleMenuActionItem: DropdownMenuActionItem;
private toggleMenuActionItem?: DropdownMenuActionItem;
private hasSecondaryActions: boolean;
private lookupKeybindings: boolean;
@@ -72,9 +72,9 @@ export class ToolBar extends Disposable {
'toolbar-toggle-more',
this.options.anchorAlignmentProvider
);
this.toggleMenuActionItem.setActionContext(this.actionBar.context);
this.toggleMenuActionItem!.setActionContext(this.actionBar.context);
return this.toggleMenuActionItem;
return this.toggleMenuActionItem || null;
}
return options.actionItemProvider ? options.actionItemProvider(action) : null;
@@ -118,8 +118,8 @@ export class ToolBar extends Disposable {
let primaryActionsToSet = primaryActions ? primaryActions.slice(0) : [];
// Inject additional action to open secondary actions if present
this.hasSecondaryActions = secondaryActions && secondaryActions.length > 0;
if (this.hasSecondaryActions) {
this.hasSecondaryActions = !!(secondaryActions && secondaryActions.length > 0);
if (this.hasSecondaryActions && secondaryActions) {
this.toggleMenuAction.menuActions = secondaryActions.slice(0);
primaryActionsToSet.push(this.toggleMenuAction);
}
@@ -132,10 +132,10 @@ export class ToolBar extends Disposable {
};
}
private getKeybindingLabel(action: IAction): string {
const key = this.lookupKeybindings ? this.options.getKeyBinding(action) : void 0;
private getKeybindingLabel(action: IAction): string | undefined {
const key = this.lookupKeybindings && this.options.getKeyBinding ? this.options.getKeyBinding(action) : undefined;
return key ? key.getLabel() : void 0;
return (key && key.getLabel()) || undefined;
}
addPrimaryAction(primaryAction: IAction): () => void {
@@ -157,7 +157,7 @@ export class ToolBar extends Disposable {
dispose(): void {
if (this.toggleMenuActionItem) {
this.toggleMenuActionItem.dispose();
this.toggleMenuActionItem = void 0;
this.toggleMenuActionItem = undefined;
}
super.dispose();
@@ -173,7 +173,7 @@ class ToggleMenuAction extends Action {
constructor(toggleDropdownMenu: () => void, title?: string) {
title = title || nls.localize('moreActions', "More Actions...");
super(ToggleMenuAction.ID, title, null, true);
super(ToggleMenuAction.ID, title, undefined, true);
this.toggleDropdownMenu = toggleDropdownMenu;
}