From 4b513b805e2beee1ff2ccfaf2c8e7635d450544f Mon Sep 17 00:00:00 2001 From: Nicholas Stenbeck Date: Wed, 25 Sep 2019 10:08:17 +0200 Subject: [PATCH] Made Preferences widget rebindable Signed-off-by: Nicholas Stenbeck --- .../preferences/src/browser/preference-frontend-module.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/preferences/src/browser/preference-frontend-module.ts b/packages/preferences/src/browser/preference-frontend-module.ts index 91a5576175ff6..d9a7adb7dd5e0 100644 --- a/packages/preferences/src/browser/preference-frontend-module.ts +++ b/packages/preferences/src/browser/preference-frontend-module.ts @@ -25,6 +25,8 @@ import { bindPreferenceProviders } from './preference-bindings'; import './preferences-monaco-contribution'; +export const PreferencesWidgetFactory = Symbol('PreferencesWidgetFactory'); + export function bindPreferences(bind: interfaces.Bind, unbind: interfaces.Unbind): void { bindPreferenceProviders(bind, unbind); @@ -36,10 +38,11 @@ export function bindPreferences(bind: interfaces.Bind, unbind: interfaces.Unbind createWidget: () => container.get(PreferencesContainer) })); - bind(WidgetFactory).toDynamicValue(({ container }) => ({ + bind(PreferencesWidgetFactory).toDynamicValue(({ container }) => ({ id: PreferencesTreeWidget.ID, createWidget: () => createPreferencesTreeWidget(container) })).inSingletonScope(); + bind(WidgetFactory).toService(PreferencesWidgetFactory); bind(PreferencesEditorsContainer).toSelf(); bind(WidgetFactory).toDynamicValue(({ container }) => ({