I am trying to add syntax highlighting for a custom content type based on text e.g.
static class RTextContentType
{
public const string ContentTypeName = Constants.CONTENT_TYPE;
[Export, Name(ContentTypeName), BaseDefinition("text")]
internal static ContentTypeDefinition ContentTypeDefinition = null; // set via MEF
}
Then the classifier provider is declared like this,
[Export(typeof(IClassifierProvider)), ContentType(Constants.CONTENT_TYPE)]
class RTextClassifierProvider : IClassifierProvider
{
...
}
The problem is, that the constructor of the provider is never get called for my specified extensions. Note here, that I provide the editor factories and the file extensions are associated with the factory. I can see the factory getting initialized through debugging for all associated files.
If I change the content type to "text"
the constructor gets called.
So the question is, how can one map a custom content type to a file extension ?
Second note, using FileExtensionToContentTypeDefintion
is not an option, as this does not allow a lot of features..
Thanks for the help :)