ExportCodeFixProviderAttribute 类

定义

使用此属性声明实现 CodeFixProvider ,以便主机可以发现它。

public ref class ExportCodeFixProviderAttribute sealed : System::Composition::ExportAttribute
[System.Composition.MetadataAttribute]
public sealed class ExportCodeFixProviderAttribute : System.Composition.ExportAttribute
[System.AttributeUsage(System.AttributeTargets.Class)]
[System.Composition.MetadataAttribute]
public sealed class ExportCodeFixProviderAttribute : System.Composition.ExportAttribute
[System.Composition.MetadataAttribute]
[System.AttributeUsage(System.AttributeTargets.Class, Inherited=false)]
public sealed class ExportCodeFixProviderAttribute : System.Composition.ExportAttribute
[<System.Composition.MetadataAttribute>]
type ExportCodeFixProviderAttribute = class
    inherit ExportAttribute
[<System.AttributeUsage(System.AttributeTargets.Class)>]
[<System.Composition.MetadataAttribute>]
type ExportCodeFixProviderAttribute = class
    inherit ExportAttribute
[<System.Composition.MetadataAttribute>]
[<System.AttributeUsage(System.AttributeTargets.Class, Inherited=false)>]
type ExportCodeFixProviderAttribute = class
    inherit ExportAttribute
Public NotInheritable Class ExportCodeFixProviderAttribute
Inherits ExportAttribute
继承
ExportCodeFixProviderAttribute
属性

构造函数

ExportCodeFixProviderAttribute(String, String[])

用于指定代码修复提供程序的自动应用的属性构造函数。

属性

DocumentExtensions

此提供程序可以提供代码修复的文档扩展。 每个扩展字符串都必须包含前导句点,例如“.txt”、“.xaml”、“.editorconfig”等。默认情况下,此值为 null,不考虑文档扩展来确定代码修复的适用性。

DocumentKinds

此提供程序可以提供代码修复的文档类型。 请参阅 TextDocumentKind。 默认情况下,提供程序仅支持对源文档 Document进行代码修复。 为此属性提供文档类型的字符串表示形式,例如:DocumentKinds = new[] { nameof (TextDocumentKind.AdditionalDocument) }

Languages

此提供程序可以提供修补程序的源语言。 请参阅 LanguageNames

Name

CodeFixProvider可选名称。

适用于