I am trying to include a custom language support for Visual Studio.
To start with, I need to have GoToDefinition
support. And I am struggling to get the context menu to include this command.
I have defined a ContentTypeDefinition
and have included the FileExtensionToContentTypeDefinition
such as:
internal sealed class GaugeFileContentType
{
[Export]
[Name("Gauge")]
[BaseDefinition("code")]
internal static ContentTypeDefinition GaugeContentTypeDefinition = null;
[Export]
[FileExtension(".spec")]
[ContentType("Gauge")]
internal static FileExtensionToContentTypeDefinition GaugeFileExtensionDefinition = null;
}
Now, despite this, on debugging, I see that DTE.ActiveDocument.Type
is text
, despite me adding the [BaseDefinition('code')]
attribute. What am I missing here?
Are the above definitions enough to tell Visual Studio to bring up Context menu for code?
I am using Visual Studio 2013 Ultimate.