Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998 (#7880)

* Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998

* fix pipelines

* fix strict-null-checks

* add missing files
This commit is contained in:
Anthony Dresser
2019-10-21 22:12:22 -07:00
committed by GitHub
parent 7c9be74970
commit 1e22f47304
913 changed files with 18898 additions and 16536 deletions

View File

@@ -206,19 +206,20 @@ export class MenuEntryActionViewItem extends ActionViewItem {
}
updateLabel(): void {
if (this.options.label) {
if (this.options.label && this.label) {
this.label.textContent = this._commandAction.label;
}
}
updateTooltip(): void {
const element = this.label;
const keybinding = this._keybindingService.lookupKeybinding(this._commandAction.id);
const keybindingLabel = keybinding && keybinding.getLabel();
if (this.label) {
const keybinding = this._keybindingService.lookupKeybinding(this._commandAction.id);
const keybindingLabel = keybinding && keybinding.getLabel();
element.title = keybindingLabel
? localize('titleAndKb', "{0} ({1})", this._commandAction.label, keybindingLabel)
: this._commandAction.label;
this.label.title = keybindingLabel
? localize('titleAndKb', "{0} ({1})", this._commandAction.label, keybindingLabel)
: this._commandAction.label;
}
}
updateClass(): void {
@@ -250,8 +251,14 @@ export class MenuEntryActionViewItem extends ActionViewItem {
MenuEntryActionViewItem.ICON_PATH_TO_CSS_RULES.set(iconPathMapKey, iconClass);
}
addClasses(this.label, 'icon', iconClass);
this._itemClassDispose.value = toDisposable(() => removeClasses(this.label, 'icon', iconClass));
if (this.label) {
addClasses(this.label, 'icon', iconClass);
this._itemClassDispose.value = toDisposable(() => {
if (this.label) {
removeClasses(this.label, 'icon', iconClass);
}
});
}
}
}
}