2

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?

4

1 回答 1

3

根据Mads 关于实现 Angular IntelliSense 的帖子,HTML 编辑器的扩展方式不同。相反,您将扩展C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Packages\schemas\html\commonHTML5Types.xsd.

我认为你也可以创建一个新的exampleNameTypes.xsd并引用它,commonHTML5Types.xsd就像<xsd:import schemaLocation="exampleNameTypes.xsd"/>他们对 SVG 所做的那样。

于 2013-02-25T19:20:06.910 回答