diff --git a/src/Microsoft.AspNetCore.Razor.Language/TagHelperBoundAttributeDescriptorBuilder.cs b/src/Microsoft.AspNetCore.Razor.Language/BoundAttributeDescriptorBuilder.cs similarity index 89% rename from src/Microsoft.AspNetCore.Razor.Language/TagHelperBoundAttributeDescriptorBuilder.cs rename to src/Microsoft.AspNetCore.Razor.Language/BoundAttributeDescriptorBuilder.cs index 17903b99d2..07f6c52814 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/TagHelperBoundAttributeDescriptorBuilder.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/BoundAttributeDescriptorBuilder.cs @@ -7,7 +7,7 @@ using System.Linq; namespace Microsoft.AspNetCore.Razor.Language { - public sealed class TagHelperBoundAttributeDescriptorBuilder + public sealed class BoundAttributeDescriptorBuilder { internal const string DescriptorKind = "ITagHelper"; internal const string PropertyNameKey = "ITagHelper.PropertyName"; @@ -43,46 +43,46 @@ namespace Microsoft.AspNetCore.Razor.Language private readonly Dictionary _metadata; private HashSet _diagnostics; - private TagHelperBoundAttributeDescriptorBuilder(string containingTypeName) + private BoundAttributeDescriptorBuilder(string containingTypeName) { _containingTypeName = containingTypeName; _metadata = new Dictionary(); } - public static TagHelperBoundAttributeDescriptorBuilder Create(string containingTypeName) + public static BoundAttributeDescriptorBuilder Create(string containingTypeName) { - return new TagHelperBoundAttributeDescriptorBuilder(containingTypeName); + return new BoundAttributeDescriptorBuilder(containingTypeName); } - public TagHelperBoundAttributeDescriptorBuilder Name(string name) + public BoundAttributeDescriptorBuilder Name(string name) { _name = name; return this; } - public TagHelperBoundAttributeDescriptorBuilder PropertyName(string propertyName) + public BoundAttributeDescriptorBuilder PropertyName(string propertyName) { _propertyName = propertyName; return this; } - public TagHelperBoundAttributeDescriptorBuilder TypeName(string typeName) + public BoundAttributeDescriptorBuilder TypeName(string typeName) { _typeName = typeName; return this; } - public TagHelperBoundAttributeDescriptorBuilder AsEnum() + public BoundAttributeDescriptorBuilder AsEnum() { _isEnum = true; return this; } - public TagHelperBoundAttributeDescriptorBuilder AsDictionary(string attributeNamePrefix, string valueTypeName) + public BoundAttributeDescriptorBuilder AsDictionary(string attributeNamePrefix, string valueTypeName) { _indexerNamePrefix = attributeNamePrefix; _indexerValueTypeName = valueTypeName; @@ -91,21 +91,21 @@ namespace Microsoft.AspNetCore.Razor.Language return this; } - public TagHelperBoundAttributeDescriptorBuilder Documentation(string documentation) + public BoundAttributeDescriptorBuilder Documentation(string documentation) { _documentation = documentation; return this; } - public TagHelperBoundAttributeDescriptorBuilder AddMetadata(string key, string value) + public BoundAttributeDescriptorBuilder AddMetadata(string key, string value) { _metadata[key] = value; return this; } - public TagHelperBoundAttributeDescriptorBuilder AddDiagnostic(RazorDiagnostic diagnostic) + public BoundAttributeDescriptorBuilder AddDiagnostic(RazorDiagnostic diagnostic) { EnsureDiagnostics(); _diagnostics.Add(diagnostic); diff --git a/src/Microsoft.AspNetCore.Razor.Language/BoundAttributeDescriptorExtensions.cs b/src/Microsoft.AspNetCore.Razor.Language/BoundAttributeDescriptorExtensions.cs index 597ab40bee..137b605abd 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/BoundAttributeDescriptorExtensions.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/BoundAttributeDescriptorExtensions.cs @@ -9,12 +9,12 @@ namespace Microsoft.AspNetCore.Razor.Language { public static string GetPropertyName(this BoundAttributeDescriptor descriptor) { - descriptor.Metadata.TryGetValue(TagHelperBoundAttributeDescriptorBuilder.PropertyNameKey, out var propertyName); + descriptor.Metadata.TryGetValue(BoundAttributeDescriptorBuilder.PropertyNameKey, out var propertyName); return propertyName; } public static bool IsDefaultKind(this BoundAttributeDescriptor descriptor) - => string.Equals(descriptor.Kind, TagHelperBoundAttributeDescriptorBuilder.DescriptorKind, StringComparison.Ordinal); + => string.Equals(descriptor.Kind, BoundAttributeDescriptorBuilder.DescriptorKind, StringComparison.Ordinal); } } \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Razor.Language/TagHelperDescriptorBuilder.cs b/src/Microsoft.AspNetCore.Razor.Language/TagHelperDescriptorBuilder.cs index d2c18947f4..82f0f90e70 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/TagHelperDescriptorBuilder.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/TagHelperDescriptorBuilder.cs @@ -49,14 +49,14 @@ namespace Microsoft.AspNetCore.Razor.Language return this; } - public TagHelperDescriptorBuilder BindAttribute(Action configure) + public TagHelperDescriptorBuilder BindAttribute(Action configure) { if (configure == null) { throw new ArgumentNullException(nameof(configure)); } - var builder = TagHelperBoundAttributeDescriptorBuilder.Create(_typeName); + var builder = BoundAttributeDescriptorBuilder.Create(_typeName); configure(builder); diff --git a/src/Microsoft.CodeAnalysis.Razor/DefaultTagHelperDescriptorFactory.cs b/src/Microsoft.CodeAnalysis.Razor/DefaultTagHelperDescriptorFactory.cs index 1330f0db34..148e35a557 100644 --- a/src/Microsoft.CodeAnalysis.Razor/DefaultTagHelperDescriptorFactory.cs +++ b/src/Microsoft.CodeAnalysis.Razor/DefaultTagHelperDescriptorFactory.cs @@ -181,7 +181,7 @@ namespace Microsoft.CodeAnalysis.Razor } private void ConfigureBoundAttribute( - TagHelperBoundAttributeDescriptorBuilder builder, + BoundAttributeDescriptorBuilder builder, IPropertySymbol property, INamedTypeSymbol containingType) { @@ -241,7 +241,7 @@ namespace Microsoft.CodeAnalysis.Razor } private void ConfigureDictionaryBoundAttribute( - TagHelperBoundAttributeDescriptorBuilder builder, + BoundAttributeDescriptorBuilder builder, IPropertySymbol property, INamedTypeSymbol containingType, AttributeData attributeNameAttribute, diff --git a/src/Microsoft.VisualStudio.LanguageServices.Razor/TagHelperDescriptorJsonConverter.cs b/src/Microsoft.VisualStudio.LanguageServices.Razor/TagHelperDescriptorJsonConverter.cs index 0dbc2a6837..639270b2f6 100644 --- a/src/Microsoft.VisualStudio.LanguageServices.Razor/TagHelperDescriptorJsonConverter.cs +++ b/src/Microsoft.VisualStudio.LanguageServices.Razor/TagHelperDescriptorJsonConverter.cs @@ -136,10 +136,10 @@ namespace Microsoft.VisualStudio.LanguageServices.Razor } } - private void ReadBoundAttribute(TagHelperBoundAttributeDescriptorBuilder builder, JObject attribute, JsonSerializer serializer) + private void ReadBoundAttribute(BoundAttributeDescriptorBuilder builder, JObject attribute, JsonSerializer serializer) { var descriptorKind = attribute[nameof(BoundAttributeDescriptor.Kind)].Value(); - if (descriptorKind != TagHelperBoundAttributeDescriptorBuilder.DescriptorKind) + if (descriptorKind != BoundAttributeDescriptorBuilder.DescriptorKind) { throw new NotSupportedException(); } @@ -182,7 +182,7 @@ namespace Microsoft.VisualStudio.LanguageServices.Razor builder.AddMetadata(item.Key, item.Value); } - var propertyName = metadataValue[TagHelperBoundAttributeDescriptorBuilder.PropertyNameKey]; + var propertyName = metadataValue[BoundAttributeDescriptorBuilder.PropertyNameKey]; builder.PropertyName(propertyName); } } diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/IntegrationTests/InstrumentationPassIntegrationTest.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/IntegrationTests/InstrumentationPassIntegrationTest.cs index 96e22b8a8c..5d7bf3ed1e 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/IntegrationTests/InstrumentationPassIntegrationTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/IntegrationTests/InstrumentationPassIntegrationTest.cs @@ -30,7 +30,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.IntegrationTests tagName: "input", typeName: "InputTagHelper", assemblyName: "TestAssembly", - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("value") @@ -69,7 +69,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.IntegrationTests string tagName, string typeName, string assemblyName, - IEnumerable> attributes = null) + IEnumerable> attributes = null) { var builder = TagHelperDescriptorBuilder.Create(typeName, assemblyName); diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/BoundAttributeDescriptorExtensionsTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/BoundAttributeDescriptorExtensionsTest.cs index b07afaca35..0eba3ee16d 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/BoundAttributeDescriptorExtensionsTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/BoundAttributeDescriptorExtensionsTest.cs @@ -12,7 +12,7 @@ namespace Microsoft.AspNetCore.Razor.Language { // Arrange var expectedPropertyName = "IntProperty"; - var descriptor = TagHelperBoundAttributeDescriptorBuilder.Create("TestTagHelper") + var descriptor = BoundAttributeDescriptorBuilder.Create("TestTagHelper") .Name("test") .PropertyName(expectedPropertyName) .TypeName(typeof(int).FullName) @@ -29,7 +29,7 @@ namespace Microsoft.AspNetCore.Razor.Language public void GetPropertyName_ReturnsNullIfNoPropertyName() { // Arrange - var descriptor = TagHelperBoundAttributeDescriptorBuilder.Create("TestTagHelper") + var descriptor = BoundAttributeDescriptorBuilder.Create("TestTagHelper") .Name("test") .TypeName(typeof(int).FullName) .Build(); @@ -45,7 +45,7 @@ namespace Microsoft.AspNetCore.Razor.Language public void IsDefaultKind_ReturnsTrueIfFromDefaultBuilder() { // Arrange - var descriptor = TagHelperBoundAttributeDescriptorBuilder.Create("TestTagHelper") + var descriptor = BoundAttributeDescriptorBuilder.Create("TestTagHelper") .Name("test") .PropertyName("IntProperty") .TypeName(typeof(int).FullName) diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/CodeGeneration/DesignTimeTagHelperWriterTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/CodeGeneration/DesignTimeTagHelperWriterTest.cs index bd2d5345b5..3cf147c856 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/CodeGeneration/DesignTimeTagHelperWriterTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/CodeGeneration/DesignTimeTagHelperWriterTest.cs @@ -67,7 +67,7 @@ private global::MyTagHelper __MyTagHelper = null; tagName: "input", typeName: "InputTagHelper", assemblyName: "TestAssembly", - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("bound") @@ -110,7 +110,7 @@ __InputTagHelper.FooProp = ""value""; tagName: "input", typeName: "InputTagHelper", assemblyName: "TestAssembly", - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("bound") @@ -156,7 +156,7 @@ __InputTagHelper.FooProp = 42; tagName: "input", typeName: "InputTagHelper", assemblyName: "TestAssembly", - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("bound") @@ -244,7 +244,7 @@ __InputTagHelper.FooProp[""bound""] = 42; string tagName, string typeName, string assemblyName, - IEnumerable> attributes = null) + IEnumerable> attributes = null) { var builder = TagHelperDescriptorBuilder.Create(typeName, assemblyName); diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/CodeGeneration/PreallocatedAttributeTargetExtensionTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/CodeGeneration/PreallocatedAttributeTargetExtensionTest.cs index 27e55718ec..be69c43458 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/CodeGeneration/PreallocatedAttributeTargetExtensionTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/CodeGeneration/PreallocatedAttributeTargetExtensionTest.cs @@ -136,7 +136,7 @@ namespace Microsoft.AspNetCore.Razor.Language.CodeGeneration Writer = new CSharpCodeWriter() }; - var descriptor = TagHelperBoundAttributeDescriptorBuilder + var descriptor = BoundAttributeDescriptorBuilder .Create("FooTagHelper") .Name("Foo") .TypeName("System.String") @@ -174,7 +174,7 @@ __tagHelperExecutionContext.AddTagHelperAttribute(_tagHelper1); Writer = new CSharpCodeWriter() }; - var descriptor = TagHelperBoundAttributeDescriptorBuilder + var descriptor = BoundAttributeDescriptorBuilder .Create("FooTagHelper") .Name("Foo") .TypeName("System.Collections.Generic.Dictionary") diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/CodeGeneration/RuntimeTagHelperWriterTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/CodeGeneration/RuntimeTagHelperWriterTest.cs index 0ee980b9cf..777ccf781d 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/CodeGeneration/RuntimeTagHelperWriterTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/CodeGeneration/RuntimeTagHelperWriterTest.cs @@ -291,7 +291,7 @@ EndAddHtmlAttributeValues(__tagHelperExecutionContext); tagName: "input", typeName: "InputTagHelper", assemblyName: "TestAssembly", - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("bound") @@ -339,7 +339,7 @@ __tagHelperExecutionContext.AddTagHelperAttribute(""bound"", __InputTagHelper.Fo tagName: "input", typeName: "InputTagHelper", assemblyName: "TestAssembly", - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("bound") @@ -386,7 +386,7 @@ __tagHelperExecutionContext.AddTagHelperAttribute(""bound"", __InputTagHelper.Fo tagName: "input", typeName: "InputTagHelper", assemblyName: "TestAssembly", - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("bound") @@ -478,7 +478,7 @@ __tagHelperExecutionContext.AddTagHelperAttribute(""foo-bound"", __InputTagHelpe string tagName, string typeName, string assemblyName, - IEnumerable> attributes = null) + IEnumerable> attributes = null) { var builder = TagHelperDescriptorBuilder.Create(typeName, assemblyName); diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/DefaultRazorIRLoweringPhaseIntegrationTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/DefaultRazorIRLoweringPhaseIntegrationTest.cs index abe3445289..7047569149 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/DefaultRazorIRLoweringPhaseIntegrationTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/DefaultRazorIRLoweringPhaseIntegrationTest.cs @@ -343,7 +343,7 @@ namespace Microsoft.AspNetCore.Razor.Language tagName: "input", typeName: "InputTagHelper", assemblyName: "TestAssembly", - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("bound") @@ -495,7 +495,7 @@ namespace Microsoft.AspNetCore.Razor.Language string tagName, string typeName, string assemblyName, - IEnumerable> attributes = null) + IEnumerable> attributes = null) { var builder = TagHelperDescriptorBuilder.Create(typeName, assemblyName); diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/DefaultRazorTagHelperBinderPhaseTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/DefaultRazorTagHelperBinderPhaseTest.cs index 557d390b0a..6bbb4b77a7 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/DefaultRazorTagHelperBinderPhaseTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/DefaultRazorTagHelperBinderPhaseTest.cs @@ -1387,7 +1387,7 @@ namespace Microsoft.AspNetCore.Razor.Language string tagName, string typeName, string assemblyName, - IEnumerable> attributes = null, + IEnumerable> attributes = null, IEnumerable> ruleBuilders = null) { var builder = TagHelperDescriptorBuilder.Create(typeName, assemblyName); diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/IntegrationTests/TagHelpersIntegrationTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/IntegrationTests/TagHelpersIntegrationTest.cs index e946f1dd86..d65c605d6c 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/IntegrationTests/TagHelpersIntegrationTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/IntegrationTests/TagHelpersIntegrationTest.cs @@ -41,7 +41,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests tagName: "input", typeName: "InputTagHelper", assemblyName: "TestAssembly", - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("bound") @@ -78,7 +78,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests tagName: "input", typeName: "InputTagHelper", assemblyName: "TestAssembly", - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("value") @@ -101,7 +101,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests string tagName, string typeName, string assemblyName, - IEnumerable> attributes = null) + IEnumerable> attributes = null) { var builder = TagHelperDescriptorBuilder.Create(typeName, assemblyName); diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/IntegrationTests/TestTagHelperDescriptors.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/IntegrationTests/TestTagHelperDescriptors.cs index d86bf89000..94a891ac10 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/IntegrationTests/TestTagHelperDescriptors.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/IntegrationTests/TestTagHelperDescriptors.cs @@ -27,7 +27,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests tagName: "input", typeName: "InputTagHelper", assemblyName: "TestAssembly", - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("value") @@ -90,7 +90,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests tagName: "input", typeName: "TestNamespace.InputTagHelper", assemblyName: "TestAssembly", - attributes: new Action[] + attributes: new Action[] { builder => BuildBoundAttributeDescriptorFromPropertyInfo(builder, "type", inputTypePropertyInfo), }, @@ -107,7 +107,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests tagName: "input", typeName: "TestNamespace.InputTagHelper2", assemblyName: "TestAssembly", - attributes: new Action[] + attributes: new Action[] { builder => BuildBoundAttributeDescriptorFromPropertyInfo(builder, "type", inputTypePropertyInfo), }, @@ -156,7 +156,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests tagName: "*", typeName: "TestNamespace.CatchAllTagHelper", assemblyName: "TestAssembly", - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("catch-all") @@ -168,7 +168,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests tagName: "input", typeName: "TestNamespace.InputTagHelper", assemblyName: "TestAssembly", - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("value") @@ -190,7 +190,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests tagName: "*", typeName: "TestNamespace.CatchAllTagHelper", assemblyName: "TestAssembly", - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("[item]") @@ -235,7 +235,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests tagName: "*", typeName: "TestNamespace.CatchAllTagHelper", assemblyName: "TestAssembly", - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("catchall-bound-string") @@ -250,7 +250,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests tagName: "input", typeName: "TestNamespace.InputTagHelper", assemblyName: "TestAssembly", - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("input-bound-required-string") @@ -281,7 +281,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests tagName: "input", typeName: "TestNamespace.InputTagHelper", assemblyName: "TestAssembly", - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("bound") @@ -312,7 +312,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests tagName: "input", typeName: "TestNamespace.InputTagHelper", assemblyName: "TestAssembly", - attributes: new Action[] + attributes: new Action[] { builder => BuildBoundAttributeDescriptorFromPropertyInfo(builder, "type", inputTypePropertyInfo), }, @@ -324,7 +324,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests tagName: "input", typeName: "TestNamespace.InputTagHelper2", assemblyName: "TestAssembly", - attributes: new Action[] + attributes: new Action[] { builder => BuildBoundAttributeDescriptorFromPropertyInfo(builder, "type", inputTypePropertyInfo), builder => BuildBoundAttributeDescriptorFromPropertyInfo(builder, "checked", inputCheckedPropertyInfo), @@ -357,7 +357,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests tagName: "input", typeName: "TestNamespace.InputTagHelper1", assemblyName: "TestAssembly", - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("int-prefix-grabber") @@ -382,7 +382,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests tagName: "input", typeName: "TestNamespace.InputTagHelper2", assemblyName: "TestAssembly", - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("int-dictionary") @@ -410,7 +410,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests tagName: "MyTagHelper", typeName: "TestNamespace.MyTagHelper", assemblyName: "TestAssembly", - attributes: new Action[] + attributes: new Action[] { builder => BuildBoundAttributeDescriptorFromPropertyInfo(builder, "BoundProperty", propertyInfo), }), @@ -436,7 +436,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests tagName: "p", typeName: "TestNamespace.PTagHelper", assemblyName: "TestAssembly", - attributes: new Action[] + attributes: new Action[] { builder => BuildBoundAttributeDescriptorFromPropertyInfo(builder, "age", pAgePropertyInfo), }, @@ -448,7 +448,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests tagName: "input", typeName: "TestNamespace.InputTagHelper", assemblyName: "TestAssembly", - attributes: new Action[] + attributes: new Action[] { builder => BuildBoundAttributeDescriptorFromPropertyInfo(builder, "type", inputTypePropertyInfo), }, @@ -460,7 +460,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests tagName: "input", typeName: "TestNamespace.InputTagHelper2", assemblyName: "TestAssembly", - attributes: new Action[] + attributes: new Action[] { builder => BuildBoundAttributeDescriptorFromPropertyInfo(builder, "type", inputTypePropertyInfo), builder => BuildBoundAttributeDescriptorFromPropertyInfo(builder, "checked", checkedPropertyInfo), @@ -473,7 +473,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests string tagName, string typeName, string assemblyName, - IEnumerable> attributes = null, + IEnumerable> attributes = null, IEnumerable> ruleBuilders = null) { var builder = TagHelperDescriptorBuilder.Create(typeName, assemblyName); @@ -507,7 +507,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests } private static void BuildBoundAttributeDescriptorFromPropertyInfo( - TagHelperBoundAttributeDescriptorBuilder builder, + BoundAttributeDescriptorBuilder builder, string name, PropertyInfo propertyInfo) { diff --git a/test/Microsoft.CodeAnalysis.Razor.Test/DefaultTagHelperDescriptorFactoryTest.cs b/test/Microsoft.CodeAnalysis.Razor.Test/DefaultTagHelperDescriptorFactoryTest.cs index afded7d9e9..5987b16aa9 100644 --- a/test/Microsoft.CodeAnalysis.Razor.Test/DefaultTagHelperDescriptorFactoryTest.cs +++ b/test/Microsoft.CodeAnalysis.Razor.Test/DefaultTagHelperDescriptorFactoryTest.cs @@ -570,7 +570,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces tagName: "inherited-editor-browsable", typeName: typeof(InheritedEditorBrowsableTagHelper).FullName, assemblyName: AssemblyName, - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("property") @@ -586,7 +586,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces tagName: "editor-browsable", typeName: typeof(EditorBrowsableTagHelper).FullName, assemblyName: AssemblyName, - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("property") @@ -609,7 +609,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces tagName: "hidden-property-editor-browsable", typeName: typeof(HiddenPropertyEditorBrowsableTagHelper).FullName, assemblyName: AssemblyName, - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("property") @@ -624,7 +624,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces tagName: "overridden-editor-browsable", typeName: typeof(OverriddenEditorBrowsableTagHelper).FullName, assemblyName: AssemblyName, - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("property") @@ -639,7 +639,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces tagName: "multi-property-editor-browsable", typeName: typeof(MultiPropertyEditorBrowsableTagHelper).FullName, assemblyName: AssemblyName, - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("property2") @@ -654,7 +654,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces tagName: "multi-property-editor-browsable", typeName: typeof(MultiPropertyEditorBrowsableTagHelper).FullName, assemblyName: AssemblyName, - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("property") @@ -681,7 +681,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces tagName: "overridden-property-editor-browsable", typeName: typeof(OverriddenPropertyEditorBrowsableTagHelper).FullName, assemblyName: AssemblyName, - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("property2") @@ -700,7 +700,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces tagName: "default-editor-browsable", typeName: typeof(DefaultEditorBrowsableTagHelper).FullName, assemblyName: AssemblyName, - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("property") @@ -981,7 +981,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces "overridden-attribute", typeof(OverriddenAttributeTagHelper).FullName, AssemblyName, - new Action[] + new Action[] { builder => builder .Name("SomethingElse") @@ -1015,7 +1015,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces "inherited-overridden-attribute", typeof(InheritedOverriddenAttributeTagHelper).FullName, AssemblyName, - new Action[] + new Action[] { builder => builder .Name("valid-attribute1") @@ -1049,7 +1049,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces "inherited-not-overridden-attribute", typeof(InheritedNotOverriddenAttributeTagHelper).FullName, AssemblyName, - new Action[] + new Action[] { builder => builder .Name("SomethingElse") @@ -1078,7 +1078,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces "inherited-single-attribute", typeof(InheritedSingleAttributeTagHelper).FullName, AssemblyName, - new Action[] + new Action[] { builder => builder .Name("int-attribute") @@ -1104,7 +1104,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces "single-attribute", typeof(SingleAttributeTagHelper).FullName, AssemblyName, - new Action[] + new Action[] { builder => builder .Name("int-attribute") @@ -1131,7 +1131,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces "missing-accessor", typeof(MissingAccessorTagHelper).FullName, AssemblyName, - new Action[] + new Action[] { builder => builder .Name("valid-attribute") @@ -1158,7 +1158,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces "non-public-accessor", typeof(NonPublicAccessorTagHelper).FullName, AssemblyName, - new Action[] + new Action[] { builder => builder .Name("valid-attribute") @@ -1183,7 +1183,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces "not-bound-attribute", typeof(NotBoundAttributeTagHelper).FullName, AssemblyName, - new Action[] + new Action[] { builder => builder .Name("bound-property") @@ -1209,7 +1209,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces string.Empty, typeof(MultiTagTagHelper).FullName, AssemblyName, - new Action[] + new Action[] { builder => builder .Name("valid-attribute") @@ -1240,7 +1240,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces "inherited-multi-tag", typeof(InheritedMultiTagTagHelper).FullName, AssemblyName, - new Action[] + new Action[] { builder => builder .Name("valid-attribute") @@ -1382,7 +1382,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces typeof(InvalidBoundAttribute), new[] { - TagHelperBoundAttributeDescriptorBuilder.Create(typeof(InvalidBoundAttribute).FullName) + BoundAttributeDescriptorBuilder.Create(typeof(InvalidBoundAttribute).FullName) .Name("data-something") .PropertyName(nameof(InvalidBoundAttribute.DataSomething)) .TypeName(typeof(string).FullName) @@ -1398,7 +1398,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces typeof(InvalidBoundAttributeWithValid), new[] { - TagHelperBoundAttributeDescriptorBuilder.Create(typeof(InvalidBoundAttributeWithValid).FullName) + BoundAttributeDescriptorBuilder.Create(typeof(InvalidBoundAttributeWithValid).FullName) .Name("data-something") .PropertyName(nameof(InvalidBoundAttributeWithValid.DataSomething)) .TypeName(typeof(string).FullName) @@ -1408,7 +1408,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces nameof(InvalidBoundAttributeWithValid.DataSomething), "data-something")) .Build(), - TagHelperBoundAttributeDescriptorBuilder.Create(typeof(InvalidBoundAttributeWithValid).FullName) + BoundAttributeDescriptorBuilder.Create(typeof(InvalidBoundAttributeWithValid).FullName) .Name("int-attribute") .PropertyName(nameof(InvalidBoundAttributeWithValid.IntAttribute)) .TypeName(typeof(int).FullName) @@ -1419,7 +1419,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces typeof(OverriddenInvalidBoundAttributeWithValid), new[] { - TagHelperBoundAttributeDescriptorBuilder.Create(typeof(OverriddenInvalidBoundAttributeWithValid).FullName) + BoundAttributeDescriptorBuilder.Create(typeof(OverriddenInvalidBoundAttributeWithValid).FullName) .Name("valid-something") .PropertyName(nameof(OverriddenInvalidBoundAttributeWithValid.DataSomething)) .TypeName(typeof(string).FullName) @@ -1430,7 +1430,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces typeof(OverriddenValidBoundAttributeWithInvalid), new[] { - TagHelperBoundAttributeDescriptorBuilder.Create(typeof(OverriddenValidBoundAttributeWithInvalid).FullName) + BoundAttributeDescriptorBuilder.Create(typeof(OverriddenValidBoundAttributeWithInvalid).FullName) .Name("data-something") .PropertyName(nameof(OverriddenValidBoundAttributeWithInvalid.ValidSomething)) .TypeName(typeof(string).FullName) @@ -1446,7 +1446,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces typeof(OverriddenValidBoundAttributeWithInvalidUpperCase), new[] { - TagHelperBoundAttributeDescriptorBuilder.Create(typeof(OverriddenValidBoundAttributeWithInvalidUpperCase).FullName) + BoundAttributeDescriptorBuilder.Create(typeof(OverriddenValidBoundAttributeWithInvalidUpperCase).FullName) .Name("DATA-SOMETHING") .PropertyName(nameof(OverriddenValidBoundAttributeWithInvalidUpperCase.ValidSomething)) .TypeName(typeof(string).FullName) @@ -1762,7 +1762,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces typeof(DefaultValidHtmlAttributePrefix), new[] { - TagHelperBoundAttributeDescriptorBuilder.Create(typeof(DefaultValidHtmlAttributePrefix).FullName) + BoundAttributeDescriptorBuilder.Create(typeof(DefaultValidHtmlAttributePrefix).FullName) .Name("dictionary-property") .PropertyName(nameof(DefaultValidHtmlAttributePrefix.DictionaryProperty)) .TypeName($"{dictionaryNamespace}") @@ -1775,7 +1775,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces typeof(SingleValidHtmlAttributePrefix), new[] { - TagHelperBoundAttributeDescriptorBuilder.Create(typeof(SingleValidHtmlAttributePrefix).FullName) + BoundAttributeDescriptorBuilder.Create(typeof(SingleValidHtmlAttributePrefix).FullName) .Name("valid-name") .PropertyName(nameof(SingleValidHtmlAttributePrefix.DictionaryProperty)) .TypeName($"{dictionaryNamespace}") @@ -1788,47 +1788,47 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces typeof(MultipleValidHtmlAttributePrefix), new[] { - TagHelperBoundAttributeDescriptorBuilder.Create(typeof(MultipleValidHtmlAttributePrefix).FullName) + BoundAttributeDescriptorBuilder.Create(typeof(MultipleValidHtmlAttributePrefix).FullName) .Name("valid-name1") .PropertyName(nameof(MultipleValidHtmlAttributePrefix.DictionaryProperty)) .TypeName($"{typeof(Dictionary<,>).Namespace}.Dictionary") .AsDictionary("valid-prefix1-", typeof(object).FullName) .Build(), - TagHelperBoundAttributeDescriptorBuilder.Create(typeof(MultipleValidHtmlAttributePrefix).FullName) + BoundAttributeDescriptorBuilder.Create(typeof(MultipleValidHtmlAttributePrefix).FullName) .Name("valid-name2") .PropertyName(nameof(MultipleValidHtmlAttributePrefix.DictionarySubclassProperty)) .TypeName(typeof(DictionarySubclass).FullName) .AsDictionary("valid-prefix2-", typeof(string).FullName) .Build(), - TagHelperBoundAttributeDescriptorBuilder.Create(typeof(MultipleValidHtmlAttributePrefix).FullName) + BoundAttributeDescriptorBuilder.Create(typeof(MultipleValidHtmlAttributePrefix).FullName) .Name("valid-name3") .PropertyName(nameof(MultipleValidHtmlAttributePrefix.DictionaryWithoutParameterlessConstructorProperty)) .TypeName(typeof(DictionaryWithoutParameterlessConstructor).FullName) .AsDictionary("valid-prefix3-", typeof(string).FullName) .Build(), - TagHelperBoundAttributeDescriptorBuilder.Create(typeof(MultipleValidHtmlAttributePrefix).FullName) + BoundAttributeDescriptorBuilder.Create(typeof(MultipleValidHtmlAttributePrefix).FullName) .Name("valid-name4") .PropertyName(nameof(MultipleValidHtmlAttributePrefix.GenericDictionarySubclassProperty)) .TypeName(typeof(GenericDictionarySubclass).Namespace + ".GenericDictionarySubclass") .AsDictionary("valid-prefix4-", typeof(object).FullName) .Build(), - TagHelperBoundAttributeDescriptorBuilder.Create(typeof(MultipleValidHtmlAttributePrefix).FullName) + BoundAttributeDescriptorBuilder.Create(typeof(MultipleValidHtmlAttributePrefix).FullName) .Name("valid-name5") .PropertyName(nameof(MultipleValidHtmlAttributePrefix.SortedDictionaryProperty)) .TypeName(typeof(SortedDictionary).Namespace + ".SortedDictionary") .AsDictionary("valid-prefix5-", typeof(int).FullName) .Build(), - TagHelperBoundAttributeDescriptorBuilder.Create(typeof(MultipleValidHtmlAttributePrefix).FullName) + BoundAttributeDescriptorBuilder.Create(typeof(MultipleValidHtmlAttributePrefix).FullName) .Name("valid-name6") .PropertyName(nameof(MultipleValidHtmlAttributePrefix.StringProperty)) .TypeName(typeof(string).FullName) .Build(), - TagHelperBoundAttributeDescriptorBuilder.Create(typeof(MultipleValidHtmlAttributePrefix).FullName) + BoundAttributeDescriptorBuilder.Create(typeof(MultipleValidHtmlAttributePrefix).FullName) .PropertyName(nameof(MultipleValidHtmlAttributePrefix.GetOnlyDictionaryProperty)) .TypeName($"{dictionaryNamespace}") .AsDictionary("get-only-dictionary-property-", typeof(int).FullName) .Build(), - TagHelperBoundAttributeDescriptorBuilder.Create(typeof(MultipleValidHtmlAttributePrefix).FullName) + BoundAttributeDescriptorBuilder.Create(typeof(MultipleValidHtmlAttributePrefix).FullName) .PropertyName(nameof(MultipleValidHtmlAttributePrefix.GetOnlyDictionaryPropertyWithAttributePrefix)) .TypeName($"{dictionaryNamespace}") .AsDictionary("valid-prefix6", typeof(string).FullName) @@ -1840,7 +1840,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces typeof(SingleInvalidHtmlAttributePrefix), new[] { - TagHelperBoundAttributeDescriptorBuilder.Create(typeof(SingleInvalidHtmlAttributePrefix).FullName) + BoundAttributeDescriptorBuilder.Create(typeof(SingleInvalidHtmlAttributePrefix).FullName) .Name("valid-name") .PropertyName(nameof(SingleInvalidHtmlAttributePrefix.StringProperty)) .TypeName(typeof(string).FullName) @@ -1860,12 +1860,12 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces typeof(MultipleInvalidHtmlAttributePrefix), new[] { - TagHelperBoundAttributeDescriptorBuilder.Create(typeof(MultipleInvalidHtmlAttributePrefix).FullName) + BoundAttributeDescriptorBuilder.Create(typeof(MultipleInvalidHtmlAttributePrefix).FullName) .Name("valid-name1") .PropertyName(nameof(MultipleInvalidHtmlAttributePrefix.LongProperty)) .TypeName(typeof(long).FullName) .Build(), - TagHelperBoundAttributeDescriptorBuilder.Create(typeof(MultipleInvalidHtmlAttributePrefix).FullName) + BoundAttributeDescriptorBuilder.Create(typeof(MultipleInvalidHtmlAttributePrefix).FullName) .Name("valid-name2") .PropertyName(nameof(MultipleInvalidHtmlAttributePrefix.DictionaryOfIntProperty)) .TypeName($"{typeof(Dictionary<,>).Namespace}.Dictionary") @@ -1875,7 +1875,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces typeof(MultipleInvalidHtmlAttributePrefix).FullName, nameof(MultipleInvalidHtmlAttributePrefix.DictionaryOfIntProperty))) .Build(), - TagHelperBoundAttributeDescriptorBuilder.Create(typeof(MultipleInvalidHtmlAttributePrefix).FullName) + BoundAttributeDescriptorBuilder.Create(typeof(MultipleInvalidHtmlAttributePrefix).FullName) .Name("valid-name3") .PropertyName(nameof(MultipleInvalidHtmlAttributePrefix.ReadOnlyDictionaryProperty)) .TypeName($"{typeof(IReadOnlyDictionary<,>).Namespace}.IReadOnlyDictionary") @@ -1884,7 +1884,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces typeof(MultipleInvalidHtmlAttributePrefix).FullName, nameof(MultipleInvalidHtmlAttributePrefix.ReadOnlyDictionaryProperty))) .Build(), - TagHelperBoundAttributeDescriptorBuilder.Create(typeof(MultipleInvalidHtmlAttributePrefix).FullName) + BoundAttributeDescriptorBuilder.Create(typeof(MultipleInvalidHtmlAttributePrefix).FullName) .Name("valid-name4") .PropertyName(nameof(MultipleInvalidHtmlAttributePrefix.IntProperty)) .TypeName(typeof(int).FullName) @@ -1893,7 +1893,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces typeof(MultipleInvalidHtmlAttributePrefix).FullName, nameof(MultipleInvalidHtmlAttributePrefix.IntProperty))) .Build(), - TagHelperBoundAttributeDescriptorBuilder.Create(typeof(MultipleInvalidHtmlAttributePrefix).FullName) + BoundAttributeDescriptorBuilder.Create(typeof(MultipleInvalidHtmlAttributePrefix).FullName) .Name("valid-name5") .PropertyName(nameof(MultipleInvalidHtmlAttributePrefix.DictionaryOfIntSubclassProperty)) .TypeName(typeof(DictionaryOfIntSubclass).FullName) @@ -1903,7 +1903,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces typeof(MultipleInvalidHtmlAttributePrefix).FullName, nameof(MultipleInvalidHtmlAttributePrefix.DictionaryOfIntSubclassProperty))) .Build(), - TagHelperBoundAttributeDescriptorBuilder.Create(typeof(MultipleInvalidHtmlAttributePrefix).FullName) + BoundAttributeDescriptorBuilder.Create(typeof(MultipleInvalidHtmlAttributePrefix).FullName) .PropertyName(nameof(MultipleInvalidHtmlAttributePrefix.GetOnlyDictionaryAttributePrefix)) .TypeName($"{dictionaryNamespace}") .AsDictionary("valid-prefix6", typeof(string).FullName) @@ -1912,7 +1912,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces typeof(MultipleInvalidHtmlAttributePrefix).FullName, nameof(MultipleInvalidHtmlAttributePrefix.GetOnlyDictionaryAttributePrefix))) .Build(), - TagHelperBoundAttributeDescriptorBuilder.Create(typeof(MultipleInvalidHtmlAttributePrefix).FullName) + BoundAttributeDescriptorBuilder.Create(typeof(MultipleInvalidHtmlAttributePrefix).FullName) .PropertyName(nameof(MultipleInvalidHtmlAttributePrefix.GetOnlyDictionaryPropertyWithAttributeName)) .TypeName($"{dictionaryNamespace}") .AsDictionary("invalid-name7-", typeof(object).FullName) @@ -2262,7 +2262,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces string tagName, string typeName, string assemblyName, - IEnumerable> attributes = null, + IEnumerable> attributes = null, IEnumerable> ruleBuilders = null) { var builder = TagHelperDescriptorBuilder.Create(typeName, assemblyName); diff --git a/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/TagHelperDescriptorSerializationTest.cs b/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/TagHelperDescriptorSerializationTest.cs index 99b346a4bc..ffd16b23ac 100644 --- a/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/TagHelperDescriptorSerializationTest.cs +++ b/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/TagHelperDescriptorSerializationTest.cs @@ -20,7 +20,7 @@ namespace Microsoft.VisualStudio.LanguageServices.Razor tagName: "tag-name", typeName: "type name", assemblyName: "assembly name", - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("test-attribute") @@ -63,7 +63,7 @@ namespace Microsoft.VisualStudio.LanguageServices.Razor tagName: "tag-name", typeName: "type name", assemblyName: "assembly name", - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("test-attribute") @@ -108,7 +108,7 @@ namespace Microsoft.VisualStudio.LanguageServices.Razor tagName: "tag-name", typeName: "type name", assemblyName: "assembly name", - attributes: new Action[] + attributes: new Action[] { builder => builder .Name("test-attribute") @@ -149,7 +149,7 @@ namespace Microsoft.VisualStudio.LanguageServices.Razor string tagName, string typeName, string assemblyName, - IEnumerable> attributes = null, + IEnumerable> attributes = null, IEnumerable> ruleBuilders = null, Action configureAction = null) {