。asp的VSIX IViewTaggerProvider

问题描述 投票:0回答:1

我在经典的asp(.asp)中有一些代码,但是visual stuio 2019(或2013)不支持可视匹配括号,仅使用GotoBrace命令(Ctrl +]进行匹配括号。因此,我决定创建一个Visual Studio扩展,并在此处修改了示例以添加对.asp的支持:https://docs.microsoft.com/en-us/visualstudio/extensibility/walkthrough-displaying-matching-braces?view=vs-2019

但是我可以将它用于asp。我为.asp创建了ContentTypeDefinition,并没有成功使用它。

internal static class FileAndContentTypeDefinitions
{
    [Export]
    [Name("aspwithbrace")]
    [BaseDefinition("html")]
    internal static ContentTypeDefinition hidingContentTypeDefinition;

    [Export]
    [FileExtension(".asp")]
    [ContentType("aspwithbrace")]
    internal static FileExtensionToContentTypeDefinition hiddenFileExtensionDefinition;
}

[Export(typeof(IViewTaggerProvider))]
[ContentType("aspwithbrace")]
[TagType(typeof(TextMarkerTag))]
internal class BraceMatchingTaggerProvider : IViewTaggerProvider
{

我为BaseDefinition测试了其他类型,例如“ text”,“ asp”“ html”,但未成功。因为可以放置断点,所以已加载扩展,但它在构造函数或函数中从未中断。经典asp似乎使用“工具”>“选项”>“文本编辑器HTML(Web表单)”中的“ html(Web表单)”类型。

我想念什么吗?还有另一种方法可以将我的扩展名添加到已经存在的asp模式中吗?

c# visual-studio-2019 vsix
1个回答
0
投票

事实上,在清洗解决方案之后,重新构建它并卸载它可以与[BaseDefinition("html")]一起使用的扩展名,但是我无法确定为什么在我的第一个测试中它不起作用...

© www.soinside.com 2019 - 2024. All rights reserved.