eclipse-tm4e / tm4e

TextMate support in Eclipse IDE
https://projects.eclipse.org/projects/technology.tm4e
Eclipse Public License 2.0
94 stars 57 forks source link

Default theme can't be specified via plugin customization #713

Closed iloveeclipse closed 9 months ago

iloveeclipse commented 9 months ago

The code below only asks for a user preference, not for all possible configured preferences like plugin customization. https://github.com/eclipse/tm4e/blob/e87d06b6a2afd5fbb2b68a91345508b1ce09b2ac/org.eclipse.tm4e.ui/src/main/java/org/eclipse/tm4e/ui/internal/themes/ThemeManager.java#L125

So plugin customization file that contains something like this doesn't work:

# Use "classic" theme for textmate
org.eclipse.tm4e.ui/org.eclipse.tm4e.ui.themes.defaultLightTheme=org.eclipse.tm4e.ui.themes.WtpXmlClassic

The right way is to read preferences from preferences service and write to the instance scope.

sebthom commented 9 months ago

Before I start researching into Eclipse preferences. Could you give me a few lines of pseudo code, then I can change this.

iloveeclipse commented 9 months ago
IPreferencesService preferenceService = Platform.getPreferencesService();
String value = preferenceService.getString(PLUGIN_ID, KEY, DEFAULT_VALUE, /* search in all scopes is null */ null);
iloveeclipse commented 9 months ago

Verified fix https://github.com/eclipse/tm4e/pull/716 : works fine in 0.10.1.202402162114 version & product customization.

iloveeclipse commented 9 months ago

@sebthom : do you plan to release 0.10.1 may be? I'm particularly interested in https://github.com/eclipse/tm4e/issues/709 & https://github.com/eclipse/tm4e/issues/713 fixes.

sebthom commented 9 months ago

@sebthom : do you plan to release 0.10.1 may be? I'm particularly interested in #709 & #713 fixes.

I just released it