Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

How to define theme specific ClassificationFormatDefinitions in VSPackage

$
0
0

I would like to create a Syntax Highlighter in Visual Studio 2012 (and later) that supports different themes (Dark, Light, Blue).

Visual Studio's Editor Classifier project template explains how to create your own colors in the environment using Microsoft.VisualStudio.Text.Classification.ClassificationFormatDefinition. It works fine...

... until you realize that there are different themes in Visual Studio 2012 (and later) and you don't really support them. Your pretty dark blue colored identifiers on the light theme just become unreadable in a dark themed environment.

To my understanding if you change your ClassificationFormatDefinition in the Tools/Options/Fonts & Colors in a given theme (e.g.: Light) it won't affect the same ClassificationFormatDefinition in a different theme (e.g.: Dark). The colors seem to be independent across different themes.

That is good. But how do I achieve defining the same ClassificationFormatDefinition (e.g.: MyKeywords) that has the same name in all the themes, but provides different colors for them? Just like Visual Studio's own "Identifier", which is default black on the Light theme and default while on the Black theme.

I haven't found any attribute that would assign the given ClassificationFormatDefinition to a specific theme nor found much helpful article on the subject.

Any help appreciated.


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>