Craig Presti - MSFT
Craig Presti - MSFT

Reputation: 1145

Extending Visual Studio 2012 HTML IntelliSense

I've got an interest in extending the HTML editor in Visual Studio 2012 to support some additional elements and attributes, beyond those supplied as part of the HTML5 specification.

For example:

<html>
    <body>
        <h1>Header Text</h1>
        <mycustomelement>some info</mycustomelement>
    </body>
</html>

I saw Mads Kristensen's excellent post, Custom schemas in VS2012 CSS editor, that shows how to do something similar for CSS in a very simple manner by implementing ICssSchemaFileProvider.

From my research, there doesn't seem to be a simple way of doing this for HTML. Implementing an editor classifier seems to be the way to handle custom IntelliSense, and it's fairly daunting vs the CSS provider that Mads implements.

I really just want to throw an XML schema into the classifier and have it complete HTML5 and my custom additions.

Is there a simple implementation of an editor classifier or some alternative approach?

Upvotes: 2

Views: 1800

Answers (1)

Jon Galloway
Jon Galloway

Reputation: 53115

According to Mads' post on implementing Angular IntelliSense, the HTML editor isn't extended in the same way. Instead, you would extend C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Packages\schemas\html\commonHTML5Types.xsd.

I think you could also create a new exampleNameTypes.xsd and reference it from commonHTML5Types.xsd using <xsd:import schemaLocation="exampleNameTypes.xsd"/> as they do for SVG.

Upvotes: 3

Related Questions