Thank you for providing the sample. When I run the application, the application is in dark mode and the text is blue, not yellow. That appears to correspond with the value in the provided vssettings file. I changed the color in the vssettings file, re-ran the application, and the new color was applied from the file. For me, everything appears to be working as expected and I used our latest NuGet packages for v25.1.
It is worth noting that your sample is currently managing themes the "old way" where you have to manually change colors when switching between light and dark themes. If you want to switch to the "new way" that does not require loading styles from a vssettings file, the following changes could be made to your sample project:
Remove the event handler for "ThemeManager.CurrentThemeChanged". This is tracked automatically by SyntaxEditorThemeManager, so you no longer need to do anything special.
You only have to load the language once, and do not need to re-load it just because a theme changed. So move your "language.LoadLanguage()" call to the App startup logic. I tested placing it after you configure the current theme.
Finally, you need to make sure your classification types are initializing colors for the dark palette if you don't like the default colors. When you register a HighlightingStyle, it assumes the colors you define are for a light theme and attempts to auto-translate the given color to one appropriate for a dark theme. If you want to set a specific color for the dark theme instead of the automatic one, you just need to make sure the dark color palette is configured before you register the style. The following is an update to your Identifier classification type that sets the color to Blue like your vssettings file had.
public IClassificationType Identifier
{
get
{
if ((identifierValue == null))
{
string key = "Identifier";
identifierValue = registryValue.GetClassificationType(key);
if ((identifierValue == null))
{
// Make sure dark colors are configured
var darkColorPalette = registryValue.DarkColorPalette;
if (darkColorPalette != null)
darkColorPalette.SetForeground(key, Colors.Blue);
// Register default style, which also configures light colors
identifierValue = new ClassificationType(key, "Identifier");
registryValue.Register(identifierValue, new HighlightingStyle(Colors.Yellow));
}
}
return identifierValue;
}
}
You'd want to make the above change to any classification type whose color was not automatically adapting to a dark theme. You can find more details about color adaptation here. For example, your sample was configured to use Yellow. That color is automatically adapted to a pale yellow that is more appropriate for a dark theme, so you actually didn't have to do anything to support a dark theme for that color. You only need to manually define a corresponding color in the dark color palette if you don't like the automatically adapted color.
With the "new way", we tried to remove most of the effort involved in supporting dark themes by automatically watching for theme changes and automatically adapting colors to work with a dark background. If you want to continue managing themes the "old way", I suggest disabling the new functionality by unmanaging the AmbientHighlightingStyleRegistry from SyntaxEditorThemeManager as discussed here.