You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am building a component that is lazily loaded (and therefore lazily calls registerThemingParticipant). The callback passed in to registerThemingParticipant is never getting called though and it seems like this is because workbenchThemeService.setColorTheme disposes any previous themingParticipantChangeListener and does not add it back for some code paths.
It looks like setColorTheme assumes that applyTheme will add back the listener here, but there are multiple code paths in setColorTheme that neither call setColorTheme nor add back the listener.
if (themeId === this.currentColorTheme.id && !this.currentColorTheme.isLoaded && this.currentColorTheme.hasEqualData(themeData)) {
// the loaded theme is identical to the perisisted theme. Don't need to send an event.
this.currentColorTheme = themeData;
themeData.setCustomColors(this.colorCustomizations);
return TPromise.as(themeData);
}
When this case is hit, the listener is never re-registered, so subsequent calls to registerThemingParticipant will have no effect.
The text was updated successfully, but these errors were encountered:
I am building a component that is lazily loaded (and therefore lazily calls registerThemingParticipant). The callback passed in to registerThemingParticipant is never getting called though and it seems like this is because workbenchThemeService.setColorTheme disposes any previous
themingParticipantChangeListener
and does not add it back for some code paths.It looks like
setColorTheme
assumes thatapplyTheme
will add back the listener here, but there are multiple code paths insetColorTheme
that neither callsetColorTheme
nor add back the listener.The specific case I am hitting is
https://sourcegraph.com/github.com/Microsoft/vscode/-/blob/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts#L411
When this case is hit, the listener is never re-registered, so subsequent calls to
registerThemingParticipant
will have no effect.The text was updated successfully, but these errors were encountered: