More layering and compile strictness (#8973)

* add more folders to strictire compile, add more strict compile options

* update ci

* wip

* add more layering and fix issues

* add more strictness

* remove unnecessary assertion

* add missing checks

* fix indentation

* remove jsdoc
This commit is contained in:
Anthony Dresser
2020-01-29 20:35:11 -08:00
committed by GitHub
parent ddfdd43fc3
commit 56695be14a
185 changed files with 725 additions and 635 deletions

View File

@@ -313,7 +313,9 @@ export class LabeledMenuItemActionItem extends MenuEntryActionViewItem {
}
updateLabel(): void {
this.label.innerText = this._commandAction.label;
if (this.label) {
this.label.innerText = this._commandAction.label;
}
}
// Overwrite item class to ensure that we can pass in a CSS class that other items use
@@ -327,19 +329,28 @@ export class LabeledMenuItemActionItem extends MenuEntryActionViewItem {
} else if (item.icon) {
let iconClass: string;
const iconPathMapKey = item.icon.dark.toString();
if (MenuEntryActionViewItem.ICON_PATH_TO_CSS_RULES.has(iconPathMapKey)) {
iconClass = MenuEntryActionViewItem.ICON_PATH_TO_CSS_RULES.get(iconPathMapKey)!;
} else {
iconClass = ids.nextId();
createCSSRule(`.codicon.${iconClass}`, `background-image: ${asCSSUrl(item.icon.light || item.icon.dark)}`);
createCSSRule(`.vs-dark .codicon.${iconClass}, .hc-black .codicon.${iconClass}`, `background-image: ${asCSSUrl(item.icon.dark)}`);
MenuEntryActionViewItem.ICON_PATH_TO_CSS_RULES.set(iconPathMapKey, iconClass);
if (item.icon?.dark?.scheme) {
const iconPathMapKey = item.icon.dark.toString();
if (MenuEntryActionViewItem.ICON_PATH_TO_CSS_RULES.has(iconPathMapKey)) {
iconClass = MenuEntryActionViewItem.ICON_PATH_TO_CSS_RULES.get(iconPathMapKey)!;
} else {
iconClass = ids.nextId();
createCSSRule(`.codicon.${iconClass}`, `background-image: ${asCSSUrl(item.icon.light || item.icon.dark)}`);
createCSSRule(`.vs-dark .codicon.${iconClass}, .hc-black .codicon.${iconClass}`, `background-image: ${asCSSUrl(item.icon.dark)}`);
MenuEntryActionViewItem.ICON_PATH_TO_CSS_RULES.set(iconPathMapKey, iconClass);
}
if (this.label) {
addClasses(this.label, 'codicon', this._defaultCSSClassToAdd, iconClass);
this._labeledItemClassDispose = toDisposable(() => {
if (this.label) {
removeClasses(this.label, 'codicon', this._defaultCSSClassToAdd, iconClass);
}
});
}
}
addClasses(this.label, 'codicon', this._defaultCSSClassToAdd, iconClass);
this._labeledItemClassDispose = toDisposable(() => removeClasses(this.label, 'codicon', this._defaultCSSClassToAdd, iconClass));
}
}