Make duplicate attribute names an error (dotnet/aspnetcore-tooling#604)

This came up in the context of discussion around aspnet/AspNetCoredotnet/aspnetcore-tooling#5071.

Browsers use a 'first attribute wins' rule for evaluating attributes and
building the DOM - though duplicate attributes are considered to be a
spec violation.

Blazor wants to use 'last attribute wins' rules because that's most
sensible when you consider evaluation order and splatting.

This means that we have to have the markup block pass do the same thing
as the Blazor runtime when duplicates appear. However, since this is a
spec violation I'm proposing that we just make it an error (like we do
for malformed tags). There's no useful purpose for duplicate attributes
since browsers ignore it.

Since we're not going to allow this for elements. Let's go all of the
way and block it for components as well. And while we're here, lets
block some of the invalid cases where users try to mix onchange and
bind. These don't work today, so we should make them an error. If we
decide to add support for this case to the runtime that would require
compiler work anyway.
\n\nCommit migrated from 0c59ca5f74
This commit is contained in:
Ryan Nowak 2019-05-21 16:37:08 -07:00 committed by Nate McMaster
parent 72d017cc1b
commit 95bb698c5a
89 changed files with 2466 additions and 6 deletions

View File

@ -330,6 +330,10 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
{
var valueNode = new HtmlAttributeIntermediateNode()
{
Annotations =
{
[ComponentMetadata.Common.OriginalAttributeName] = node.AttributeName,
},
AttributeName = valueAttributeName,
Source = node.Source,
@ -350,6 +354,10 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
var changeNode = new HtmlAttributeIntermediateNode()
{
Annotations =
{
[ComponentMetadata.Common.OriginalAttributeName] = node.AttributeName,
},
AttributeName = changeAttributeName,
Source = node.Source,
@ -369,6 +377,10 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
{
var valueNode = new ComponentAttributeIntermediateNode(node)
{
Annotations =
{
[ComponentMetadata.Common.OriginalAttributeName] = node.AttributeName,
},
AttributeName = valueAttributeName,
BoundAttribute = valueAttribute, // Might be null if it doesn't match a component attribute
PropertyName = valueAttribute?.GetPropertyName(),
@ -385,6 +397,10 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
var changeNode = new ComponentAttributeIntermediateNode(node)
{
Annotations =
{
[ComponentMetadata.Common.OriginalAttributeName] = node.AttributeName,
},
AttributeName = changeAttributeName,
BoundAttribute = changeAttribute, // Might be null if it doesn't match a component attribute
PropertyName = changeAttribute?.GetPropertyName(),
@ -406,6 +422,10 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
{
expressionNode = new ComponentAttributeIntermediateNode(node)
{
Annotations =
{
[ComponentMetadata.Common.OriginalAttributeName] = node.AttributeName,
},
AttributeName = expressionAttributeName,
BoundAttribute = expressionAttribute,
PropertyName = expressionAttribute.GetPropertyName(),

View File

@ -364,7 +364,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
public static readonly RazorDiagnosticDescriptor BindAttribute_FormatNode_Unsupported =
new RazorDiagnosticDescriptor(
$"{DiagnosticPrefix}10005",
$"{DiagnosticPrefix}10006",
() => "Specifying format using 'format-...' attributes are no longer supported. Specify it using the 'bind-...:format=...' attribute instead.",
RazorDiagnosticSeverity.Warning);
@ -375,5 +375,53 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
source ?? SourceSpan.Undefined);
return diagnostic;
}
public static readonly RazorDiagnosticDescriptor DuplicateMarkupAttribute =
new RazorDiagnosticDescriptor(
$"{DiagnosticPrefix}10007",
() => "The attribute '{0}' is used two or more times for this element. Attributes must be unique (case-insensitive).",
RazorDiagnosticSeverity.Error);
public static RazorDiagnostic Create_DuplicateMarkupAttribute(string attributeName, SourceSpan? source = null)
{
return RazorDiagnostic.Create(DuplicateMarkupAttribute, source ?? SourceSpan.Undefined, attributeName);
}
public static readonly RazorDiagnosticDescriptor DuplicateMarkupAttributeDirective =
new RazorDiagnosticDescriptor(
$"{DiagnosticPrefix}10008",
() =>
"The attribute '{0}' is used two or more times for this element. Attributes must be unique (case-insensitive). " +
"The attribute '{0}' is used by the '{1}' directive attribute.",
RazorDiagnosticSeverity.Error);
public static RazorDiagnostic Create_DuplicateMarkupAttributeDirective(string attributeName, string directiveAttributeName, SourceSpan? source = null)
{
return RazorDiagnostic.Create(DuplicateMarkupAttributeDirective, source ?? SourceSpan.Undefined, attributeName, directiveAttributeName);
}
public static readonly RazorDiagnosticDescriptor DuplicateComponentParameter =
new RazorDiagnosticDescriptor(
$"{DiagnosticPrefix}10009",
() => "The component parameter '{0}' is used two or more times for this component. Parameters must be unique (case-insensitive).",
RazorDiagnosticSeverity.Error);
public static RazorDiagnostic Create_DuplicateComponentParameter(string attributeName, SourceSpan? source = null)
{
return RazorDiagnostic.Create(DuplicateComponentParameter, source ?? SourceSpan.Undefined, attributeName);
}
public static readonly RazorDiagnosticDescriptor DuplicateComponentParameterDirective =
new RazorDiagnosticDescriptor(
$"{DiagnosticPrefix}10010",
() =>
"The component parameter '{0}' is used two or more times for this component. Parameters must be unique (case-insensitive). " +
"The component parameter '{0}' is generated by the '{1}' directive attribute.",
RazorDiagnosticSeverity.Error);
public static RazorDiagnostic Create_DuplicateComponentParameterDirective(string attributeName, string directiveAttributeName, SourceSpan? source = null)
{
return RazorDiagnostic.Create(DuplicateComponentParameterDirective, source ?? SourceSpan.Undefined, attributeName, directiveAttributeName);
}
}
}

View File

@ -0,0 +1,113 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Razor.Language.Intermediate;
namespace Microsoft.AspNetCore.Razor.Language.Components
{
internal sealed class ComponentMarkupDiagnosticPass : ComponentIntermediateNodePassBase, IRazorOptimizationPass
{
public static readonly int DefaultOrder = 10000;
public override int Order => DefaultOrder;
protected override void ExecuteCore(RazorCodeDocument codeDocument, DocumentIntermediateNode documentNode)
{
var visitor = new Visitor();
visitor.Visit(documentNode);
}
private class Visitor : IntermediateNodeWalker
{
private Dictionary<string, (string name, IntermediateNode node)> _attributes = new Dictionary<string, (string, IntermediateNode)>(StringComparer.OrdinalIgnoreCase);
public override void VisitMarkupElement(MarkupElementIntermediateNode node)
{
for (var i = 0; i < node.Children.Count; i++)
{
if (node.Children[i] is HtmlAttributeIntermediateNode attribute && attribute.AttributeName != null)
{
if (_attributes.TryGetValue(attribute.AttributeName, out var other))
{
// As a special case we want to point it out explicitly where a directive or other construct
// has emitted an attribute that causes a conflict. We're already looking at the lowered version
// of this construct, so it's easy to detect. We just need the original name to report the issue.
//
// Example: `bind-value` will set `value` and `onchange`.
var originalAttributeName =
attribute.Annotations[ComponentMetadata.Common.OriginalAttributeName] as string ??
other.node.Annotations[ComponentMetadata.Common.OriginalAttributeName] as string;
if (originalAttributeName != null)
{
other.node.Diagnostics.Add(ComponentDiagnosticFactory.Create_DuplicateMarkupAttributeDirective(
other.name,
originalAttributeName,
other.node.Source ?? node.Source));
}
else
{
// This is a conflict in the code the user wrote.
other.node.Diagnostics.Add(ComponentDiagnosticFactory.Create_DuplicateMarkupAttribute(
other.name,
other.node.Source ?? node.Source));
}
}
// Replace the attribute we were previously tracking. Then if you have three, the two on the left will have
// diagnostics.
_attributes[attribute.AttributeName] = (attribute.AttributeName, attribute);
}
}
_attributes.Clear();
base.VisitMarkupElement(node);
}
public override void VisitComponent(ComponentIntermediateNode node)
{
for (var i = 0; i < node.Children.Count; i++)
{
// Note that we don't handle ChildContent cases here. Those have their own pass for diagnostics.
if (node.Children[i] is ComponentAttributeIntermediateNode attribute && attribute.AttributeName != null)
{
if (_attributes.TryGetValue(attribute.AttributeName, out var other))
{
// As a special case we want to point it out explicitly where a directive or other construct
// has emitted an attribute that causes a conflict. We're already looking at the lowered version
// of this construct, so it's easy to detect. We just need the original name to report the issue.
//
// Example: `bind-Value` will set `Value` and `ValueChanged`.
var originalAttributeName =
attribute.Annotations[ComponentMetadata.Common.OriginalAttributeName] as string ??
other.node.Annotations[ComponentMetadata.Common.OriginalAttributeName] as string;
if (originalAttributeName != null)
{
other.node.Diagnostics.Add(ComponentDiagnosticFactory.Create_DuplicateComponentParameterDirective(
other.name,
originalAttributeName,
other.node.Source ?? node.Source));
}
else
{
// This is a conflict in the code the user wrote.
other.node.Diagnostics.Add(ComponentDiagnosticFactory.Create_DuplicateComponentParameter(
other.name,
other.node.Source ?? node.Source));
}
}
// Replace the attribute we were previously tracking. Then if you have three, the two on the left will have
// diagnostics.
_attributes[attribute.AttributeName] = (attribute.AttributeName, attribute);
}
}
_attributes.Clear();
base.VisitComponent(node);
}
}
}
}

View File

@ -151,6 +151,10 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
{
var result = new HtmlAttributeIntermediateNode()
{
Annotations =
{
[ComponentMetadata.Common.OriginalAttributeName] = node.AttributeName,
},
AttributeName = node.AttributeName,
Source = node.Source,
@ -173,7 +177,13 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
}
else
{
var result = new ComponentAttributeIntermediateNode(node);
var result = new ComponentAttributeIntermediateNode(node)
{
Annotations =
{
[ComponentMetadata.Common.OriginalAttributeName] = node.AttributeName,
},
};
result.Children.Clear();
result.Children.Add(new CSharpExpressionIntermediateNode());

View File

@ -17,7 +17,10 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
internal class ComponentMarkupBlockPass : ComponentIntermediateNodePassBase, IRazorOptimizationPass
{
// Runs LATE because we want to destroy structure.
public override int Order => 10000;
//
// We also need to run after ComponentMarkupDiagnosticPass to avoid destroying diagnostics
// added in that pass.
public override int Order => ComponentMarkupDiagnosticPass.DefaultOrder + 10;
protected override void ExecuteCore(
RazorCodeDocument codeDocument,

View File

@ -3,9 +3,7 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using Microsoft.AspNetCore.Razor.Language.Intermediate;
using Microsoft.AspNetCore.Razor.Language.Legacy;
@ -14,7 +12,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
internal class ComponentMarkupEncodingPass : ComponentIntermediateNodePassBase, IRazorOptimizationPass
{
// Runs after ComponentMarkupBlockPass
public override int Order => 10010;
public override int Order => ComponentMarkupDiagnosticPass.DefaultOrder + 20;
protected override void ExecuteCore(RazorCodeDocument codeDocument, DocumentIntermediateNode documentNode)
{

View File

@ -47,6 +47,11 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
return className.StartsWith(MangledClassNamePrefix, StringComparison.Ordinal);
}
public static class Common
{
public static readonly string OriginalAttributeName = "Common.OriginalAttributeName";
}
public static class Bind
{
public static readonly string RuntimeName = "Components.None";

View File

@ -235,6 +235,7 @@ namespace Microsoft.AspNetCore.Razor.Language
builder.Features.Add(new ComponentTemplateDiagnosticPass());
builder.Features.Add(new ComponentGenericTypePass());
builder.Features.Add(new ComponentChildContentDiagnosticPass());
builder.Features.Add(new ComponentMarkupDiagnosticPass());
builder.Features.Add(new ComponentMarkupBlockPass());
builder.Features.Add(new ComponentMarkupEncodingPass());
}

View File

@ -0,0 +1,196 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Razor.Language.Intermediate;
using Xunit;
namespace Microsoft.AspNetCore.Razor.Language.Components
{
// These tests are really basic and cover a few different structures. The components part of this
// pass is hard to unit test, so component cases are covered by integration tests.
public class ComponentDuplicateAttributeDiagnosticPassTest
{
public ComponentDuplicateAttributeDiagnosticPassTest()
{
Pass = new ComponentMarkupDiagnosticPass();
ProjectEngine = (DefaultRazorProjectEngine)RazorProjectEngine.Create(
RazorConfiguration.Default,
RazorProjectFileSystem.Create(Environment.CurrentDirectory),
b =>
{
// Don't run the markup mutating passes.
b.Features.Remove(b.Features.OfType<ComponentMarkupDiagnosticPass>().Single());
b.Features.Remove(b.Features.OfType<ComponentMarkupBlockPass>().Single());
b.Features.Remove(b.Features.OfType<ComponentMarkupEncodingPass>().Single());
});
Engine = ProjectEngine.Engine;
Pass.Engine = Engine;
}
private DefaultRazorProjectEngine ProjectEngine { get; }
private RazorEngine Engine { get; }
private ComponentMarkupDiagnosticPass Pass { get; }
[Fact]
public void Execute_NoDuplicates()
{
// Arrange
var document = CreateDocument(@"
<html>
<head cool=""beans"">
<div></div>
<ul a=""d"" b="""" c>
<li id=""15""></li>
</ul>
</head>
</html>");
var documentNode = Lower(document);
// Act
Pass.Execute(document, documentNode);
// Assert
Assert.Empty(documentNode.GetAllDiagnostics());
}
[Fact]
public void Execute_FindDuplicate()
{
// Arrange
var document = CreateDocument(@"
<html>
<head cool=""beans"">
<div></div>
<ul a=""d"" b="""" c a=""another"">
<li id=""15""></li>
</ul>
</head>
</html>");
var documentNode = Lower(document);
// Act
Pass.Execute(document, documentNode);
// Assert
var diagnostic = Assert.Single(documentNode.GetAllDiagnostics());
Assert.Equal(ComponentDiagnosticFactory.DuplicateMarkupAttribute.Id, diagnostic.Id);
var node = documentNode.FindDescendantNodes<HtmlAttributeIntermediateNode>().Where(n => n.HasDiagnostics).Single();
Assert.Equal("a", node.AttributeName);
Assert.Equal(node.Source, diagnostic.Span);
}
[Fact]
public void Execute_FindDuplicate_CaseInsensitive()
{
// Arrange
var document = CreateDocument(@"
<html>
<head cool=""beans"">
<div></div>
<ul attr=""d"" b="""" c ATTR=""another"">
<li id=""15""></li>
</ul>
</head>
</html>");
var documentNode = Lower(document);
// Act
Pass.Execute(document, documentNode);
// Assert
var diagnostic = Assert.Single(documentNode.GetAllDiagnostics());
Assert.Equal(ComponentDiagnosticFactory.DuplicateMarkupAttribute.Id, diagnostic.Id);
var node = documentNode.FindDescendantNodes<HtmlAttributeIntermediateNode>().Where(n => n.HasDiagnostics).Single();
Assert.Equal("attr", node.AttributeName);
Assert.Equal(node.Source, diagnostic.Span);
}
[Fact]
public void Execute_FindDuplicate_Multiple()
{
// Arrange
var document = CreateDocument(@"
<html>
<head cool=""beans"">
<div></div>
<ul attr=""d"" b="""" c attr=""another"" attr>
<li id=""15""></li>
</ul>
</head>
</html>");
var documentNode = Lower(document);
// Act
Pass.Execute(document, documentNode);
// Assert
var diagnostics = documentNode.GetAllDiagnostics();
var nodes = documentNode.FindDescendantNodes<HtmlAttributeIntermediateNode>().Where(n => n.HasDiagnostics).ToArray();
Assert.Equal(2, diagnostics.Count);
Assert.Equal(2, nodes.Length);
for (var i = 0; i < 2; i++)
{
var diagnostic = diagnostics[i];
var node = nodes[i];
Assert.Equal(ComponentDiagnosticFactory.DuplicateMarkupAttribute.Id, diagnostic.Id);
Assert.Equal("attr", node.AttributeName);
Assert.Equal(node.Source, diagnostic.Span);
}
}
private RazorCodeDocument CreateDocument(string content)
{
// Normalize newlines since we are testing lengths of things.
content = content.Replace("\r", "");
content = content.Replace("\n", "\r\n");
var source = RazorSourceDocument.Create(content, "test.cshtml");
return ProjectEngine.CreateCodeDocumentCore(source, FileKinds.Component);
}
private DocumentIntermediateNode Lower(RazorCodeDocument codeDocument)
{
for (var i = 0; i < Engine.Phases.Count; i++)
{
var phase = Engine.Phases[i];
if (phase is IRazorCSharpLoweringPhase)
{
break;
}
phase.Execute(codeDocument);
}
var document = codeDocument.GetDocumentIntermediateNode();
Engine.Features.OfType<ComponentDocumentClassifierPass>().Single().Execute(codeDocument, document);
return document;
}
private class StaticTagHelperFeature : ITagHelperFeature
{
public RazorEngine Engine { get; set; }
public List<TagHelperDescriptor> TagHelpers { get; set; }
public IReadOnlyList<TagHelperDescriptor> GetDescriptors()
{
return TagHelpers;
}
}
}
}

View File

@ -325,6 +325,32 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
Assert.Empty(documentNode.FindDescendantNodes<MarkupBlockIntermediateNode>());
}
// We want duplicate attributes to result in an error and prevent rewriting.
//
// This is because Blazor de-duplicates attributes differently from browsers, so we don't
// want to allow any markup blocks to exist with duplicate attributes or else they will have
// the browser's behavior.
[Fact]
public void Execute_CannotRewriteHtml_DuplicateAttribute()
{
// Arrange
var document = CreateDocument(@"
<html>
<a href=""test1"" href=""test2""></a>
</html>");
var documentNode = Lower(document);
// Act
Pass.Execute(document, documentNode);
// Assert
Assert.Empty(documentNode.FindDescendantNodes<MarkupBlockIntermediateNode>());
var diagnostic = Assert.Single(documentNode.GetAllDiagnostics());
Assert.Same(ComponentDiagnosticFactory.DuplicateMarkupAttribute.Id, diagnostic.Id);
}
[Fact]
public void Execute_RewritesHtml_MismatchedClosingTag()
{
@ -385,6 +411,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
var document = codeDocument.GetDocumentIntermediateNode();
Engine.Features.OfType<ComponentDocumentClassifierPass>().Single().Execute(codeDocument, document);
Engine.Features.OfType<ComponentMarkupDiagnosticPass>().Single().Execute(codeDocument, document);
return document;
}

View File

@ -2,6 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Linq;
using Microsoft.AspNetCore.Razor.Language.Components;
using Xunit;
namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
@ -3795,6 +3796,308 @@ namespace New.Test
CompileToAssembly(generated);
}
[Fact]
public void DuplicateMarkupAttributes_IsAnError()
{
// Arrange
// Act
var generated = CompileToCSharp(@"
<div>
<a href=""/cool-url"" style="""" disabled href=""/even-cooler-url"">Learn the ten cool tricks your compiler author will hate!</a>
</div>");
// Assert
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
var diagnostic = Assert.Single(generated.Diagnostics);
Assert.Same(ComponentDiagnosticFactory.DuplicateMarkupAttribute.Id, diagnostic.Id);
}
// Right now this is almost indistinguishable from the previous case, but when we add the @ for directive attributes
// it won't be. This is a placeholder to be updated when that change goes in.
[Fact]
public void DuplicateMarkupAttributes_IsAnError_EventHandler()
{
// Arrange
// Act
var generated = CompileToCSharp(@"
<div>
<a onclick=""test()"" onclick=""@(() => {})"">Learn the ten cool tricks your compiler author will hate!</a>
</div>");
// Assert
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
var diagnostic = Assert.Single(generated.Diagnostics);
Assert.Same(ComponentDiagnosticFactory.DuplicateMarkupAttributeDirective.Id, diagnostic.Id);
}
[Fact]
public void DuplicateMarkupAttributes_Multiple_IsAnError()
{
// Arrange
// Act
var generated = CompileToCSharp(@"
<div>
<a href=""/cool-url"" style="""" disabled href=""/even-cooler-url"" href>Learn the ten cool tricks your compiler author will hate!</a>
</div>");
// Assert
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
Assert.All(generated.Diagnostics, d =>
{
Assert.Same(ComponentDiagnosticFactory.DuplicateMarkupAttribute.Id, d.Id);
});
}
[Fact]
public void DuplicateMarkupAttributes_IsAnError_BindValue()
{
// Arrange
// Act
var generated = CompileToCSharp(@"
<div>
<input type=""text"" value=""17"" bind=""@text""></input>
</div>
@functions {
private string text = ""hi"";
}
");
// Assert
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
var diagnostic = Assert.Single(generated.Diagnostics);
Assert.Same(ComponentDiagnosticFactory.DuplicateMarkupAttributeDirective.Id, diagnostic.Id);
}
[Fact]
public void DuplicateMarkupAttributes_IsAnError_BindOnInput()
{
// Arrange
// Act
var generated = CompileToCSharp(@"
<div>
<input type=""text"" bind-value=""@text"" bind-value:event=""oninput"" oninput=""@(() => {})""></input>
</div>
@functions {
private string text = ""hi"";
}
");
// Assert
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
var diagnostic = Assert.Single(generated.Diagnostics);
Assert.Same(ComponentDiagnosticFactory.DuplicateMarkupAttributeDirective.Id, diagnostic.Id);
}
[Fact]
public void DuplicateComponentParameters_IsAnError()
{
// Arrange
AdditionalSyntaxTrees.Add(Parse(@"
using System;
using Microsoft.AspNetCore.Components;
namespace Test
{
public class MyComponent : ComponentBase
{
[Parameter] public string Message { get; private set; }
}
}
"));
// Act
var generated = CompileToCSharp(@"
<MyComponent Message=""test"" mESSAGE=""test"" />
");
// Assert
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
var diagnostic = Assert.Single(generated.Diagnostics);
Assert.Same(ComponentDiagnosticFactory.DuplicateComponentParameter.Id, diagnostic.Id);
}
[Fact]
public void DuplicateComponentParameters_IsAnError_Multiple()
{
// Arrange
AdditionalSyntaxTrees.Add(Parse(@"
using System;
using Microsoft.AspNetCore.Components;
namespace Test
{
public class MyComponent : ComponentBase
{
[Parameter] public string Message { get; private set; }
}
}
"));
// Act
var generated = CompileToCSharp(@"
<MyComponent Message=""test"" mESSAGE=""test"" Message=""anotherone"" />
");
// Assert
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
Assert.All(generated.Diagnostics, d =>
{
Assert.Same(ComponentDiagnosticFactory.DuplicateComponentParameter.Id, d.Id);
});
}
[Fact]
public void DuplicateComponentParameters_IsAnError_WeaklyTyped()
{
// Arrange
AdditionalSyntaxTrees.Add(Parse(@"
using System;
using Microsoft.AspNetCore.Components;
namespace Test
{
public class MyComponent : ComponentBase
{
[Parameter] public string Message { get; private set; }
}
}
"));
// Act
var generated = CompileToCSharp(@"
<MyComponent Foo=""test"" foo=""test"" />
");
// Assert
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
var diagnostic = Assert.Single(generated.Diagnostics);
Assert.Same(ComponentDiagnosticFactory.DuplicateComponentParameter.Id, diagnostic.Id);
}
[Fact]
public void DuplicateComponentParameters_IsAnError_BindMessage()
{
// Arrange
AdditionalSyntaxTrees.Add(Parse(@"
using System;
using System.Linq.Expressions;
using Microsoft.AspNetCore.Components;
namespace Test
{
public class MyComponent : ComponentBase
{
[Parameter] public string Message { get; private set; }
[Parameter] public EventCallback<string> MessageChanged { get; private set; }
[Parameter] public Expression<Action<string>> MessageExpression { get; private set; }
}
}
"));
// Act
var generated = CompileToCSharp(@"
<MyComponent Message=""@message"" bind-Message=""@message"" />
@functions {
string message = ""hi"";
}
");
// Assert
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
var diagnostic = Assert.Single(generated.Diagnostics);
Assert.Same(ComponentDiagnosticFactory.DuplicateComponentParameterDirective.Id, diagnostic.Id);
}
[Fact]
public void DuplicateComponentParameters_IsAnError_BindMessageChanged()
{
// Arrange
AdditionalSyntaxTrees.Add(Parse(@"
using System;
using System.Linq.Expressions;
using Microsoft.AspNetCore.Components;
namespace Test
{
public class MyComponent : ComponentBase
{
[Parameter] public string Message { get; private set; }
[Parameter] public EventCallback<string> MessageChanged { get; private set; }
[Parameter] public Expression<Action<string>> MessageExpression { get; private set; }
}
}
"));
// Act
var generated = CompileToCSharp(@"
<MyComponent MessageChanged=""@((s) => {})"" bind-Message=""@message"" />
@functions {
string message = ""hi"";
}
");
// Assert
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
var diagnostic = Assert.Single(generated.Diagnostics);
Assert.Same(ComponentDiagnosticFactory.DuplicateComponentParameterDirective.Id, diagnostic.Id);
}
[Fact]
public void DuplicateComponentParameters_IsAnError_BindMessageExpression()
{
// Arrange
AdditionalSyntaxTrees.Add(Parse(@"
using System;
using System.Linq.Expressions;
using Microsoft.AspNetCore.Components;
namespace Test
{
public class MyComponent : ComponentBase
{
[Parameter] public string Message { get; private set; }
[Parameter] public EventCallback<string> MessageChanged { get; private set; }
[Parameter] public Expression<Action<string>> MessageExpression { get; private set; }
}
}
"));
// Act
var generated = CompileToCSharp(@"
<MyComponent bind-Message=""@message"" MessageExpression=""@((s) => {})"" />
@functions {
string message = ""hi"";
}
");
// Assert
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
var diagnostic = Assert.Single(generated.Diagnostics);
Assert.Same(ComponentDiagnosticFactory.DuplicateComponentParameterDirective.Id, diagnostic.Id);
}
[Fact]
public void ScriptTag_WithErrorSuppressed()
{

View File

@ -57,6 +57,7 @@ namespace Microsoft.AspNetCore.Razor.Language
feature => Assert.IsType<ComponentLayoutDirectivePass>(feature),
feature => Assert.IsType<ComponentLoweringPass>(feature),
feature => Assert.IsType<ComponentMarkupBlockPass>(feature),
feature => Assert.IsType<ComponentMarkupDiagnosticPass>(feature),
feature => Assert.IsType<ComponentMarkupEncodingPass>(feature),
feature => Assert.IsType<ComponentPageDirectivePass>(feature),
feature => Assert.IsType<ComponentReferenceCaptureLoweringPass>(feature),

View File

@ -0,0 +1,39 @@
// <auto-generated/>
#pragma warning disable 1591
namespace Test
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {
}
#pragma warning restore 219
#pragma warning disable 0414
private static System.Object __o = null;
#pragma warning restore 0414
#pragma warning disable 1998
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder)
{
__o = "";
__o = "";
builder.AddAttribute(-1, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((builder2) => {
}
));
#nullable restore
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml"
__o = typeof(MyComponent);
#line default
#line hidden
#nullable disable
}
#pragma warning restore 1998
}
}
#pragma warning restore 1591

View File

@ -0,0 +1 @@
x:\dir\subdir\Test\TestComponent.cshtml(1,23): Error RZ10009: The component parameter 'Message' is used two or more times for this component. Parameters must be unique (case-insensitive).

View File

@ -0,0 +1,25 @@
Document -
NamespaceDeclaration - - Test
UsingDirective - (3:1,1 [12] ) - System
UsingDirective - (18:2,1 [32] ) - System.Collections.Generic
UsingDirective - (53:3,1 [17] ) - System.Linq
UsingDirective - (73:4,1 [28] ) - System.Threading.Tasks
UsingDirective - (104:5,1 [37] ) - Microsoft.AspNetCore.Components
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
CSharpCode -
IntermediateToken - - CSharp - private static System.Object __o = null;
CSharpCode -
IntermediateToken - - CSharp - #pragma warning restore 0414
MethodDeclaration - - protected override - void - BuildRenderTree
Component - (0:0,0 [45] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent
ComponentAttribute - (22:0,22 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Message - AttributeStructure.DoubleQuotes
HtmlContent - (22:0,22 [4] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (22:0,22 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - test
ComponentAttribute - - mESSAGE - AttributeStructure.DoubleQuotes
HtmlContent - (37:0,37 [4] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (37:0,37 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - test
HtmlContent - (45:0,45 [2] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (45:0,45 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n

View File

@ -0,0 +1,66 @@
// <auto-generated/>
#pragma warning disable 1591
namespace Test
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {
}
#pragma warning restore 219
#pragma warning disable 0414
private static System.Object __o = null;
#pragma warning restore 0414
#pragma warning disable 1998
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder)
{
__o = Microsoft.AspNetCore.Components.RuntimeHelpers.TypeCheck<System.String>(
#nullable restore
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml"
message
#line default
#line hidden
#nullable disable
);
__o = Microsoft.AspNetCore.Components.RuntimeHelpers.TypeCheck<System.String>(Microsoft.AspNetCore.Components.BindMethods.GetValue(
#nullable restore
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml"
message
#line default
#line hidden
#nullable disable
));
__o = Microsoft.AspNetCore.Components.RuntimeHelpers.TypeCheck<Microsoft.AspNetCore.Components.EventCallback<System.String>>(Microsoft.AspNetCore.Components.EventCallback.Factory.Create<System.String>(this,
Microsoft.AspNetCore.Components.EventCallback.Factory.CreateInferred(this, __value => message = __value, message)));
__o = Microsoft.AspNetCore.Components.RuntimeHelpers.TypeCheck<System.Linq.Expressions.Expression<System.Action<System.String>>>(() => message);
builder.AddAttribute(-1, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((builder2) => {
}
));
#nullable restore
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml"
__o = typeof(MyComponent);
#line default
#line hidden
#nullable disable
}
#pragma warning restore 1998
#nullable restore
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml"
string message = "hi";
#line default
#line hidden
#nullable disable
}
}
#pragma warning restore 1591

View File

@ -0,0 +1 @@
x:\dir\subdir\Test\TestComponent.cshtml(1,23): Error RZ10010: The component parameter 'Message' is used two or more times for this component. Parameters must be unique (case-insensitive). The component parameter 'Message' is generated by the 'bind-Message' directive attribute.

View File

@ -0,0 +1,37 @@
Document -
NamespaceDeclaration - - Test
UsingDirective - (3:1,1 [12] ) - System
UsingDirective - (18:2,1 [32] ) - System.Collections.Generic
UsingDirective - (53:3,1 [17] ) - System.Linq
UsingDirective - (73:4,1 [28] ) - System.Threading.Tasks
UsingDirective - (104:5,1 [37] ) - Microsoft.AspNetCore.Components
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
CSharpCode -
IntermediateToken - - CSharp - private static System.Object __o = null;
CSharpCode -
IntermediateToken - - CSharp - #pragma warning restore 0414
MethodDeclaration - - protected override - void - BuildRenderTree
Component - (0:0,0 [58] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent
ComponentAttribute - (22:0,22 [8] x:\dir\subdir\Test\TestComponent.cshtml) - Message - AttributeStructure.DoubleQuotes
CSharpExpression - (23:0,23 [7] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (23:0,23 [7] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - message
ComponentAttribute - (46:0,46 [8] x:\dir\subdir\Test\TestComponent.cshtml) - Message - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.BindMethods.GetValue(
IntermediateToken - (47:0,47 [7] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - message
IntermediateToken - - CSharp - )
ComponentAttribute - (46:0,46 [8] x:\dir\subdir\Test\TestComponent.cshtml) - MessageChanged - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.EventCallback.Factory.CreateInferred(this, __value => message = __value, message)
ComponentAttribute - (46:0,46 [8] x:\dir\subdir\Test\TestComponent.cshtml) - MessageExpression - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - () => message
HtmlContent - (58:0,58 [2] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (58:0,58 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
HtmlContent - (103:3,1 [2] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (103:3,1 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
CSharpCode - (72:1,12 [30] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (72:1,12 [30] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n string message = "hi";\n

View File

@ -0,0 +1,19 @@
Source Location: (23:0,23 [7] x:\dir\subdir\Test\TestComponent.cshtml)
|message|
Generated Location: (958:25,23 [7] )
|message|
Source Location: (47:0,47 [7] x:\dir\subdir\Test\TestComponent.cshtml)
|message|
Generated Location: (1295:34,47 [7] )
|message|
Source Location: (72:1,12 [30] x:\dir\subdir\Test\TestComponent.cshtml)
|
string message = "hi";
|
Generated Location: (2310:57,12 [30] )
|
string message = "hi";
|

View File

@ -0,0 +1,66 @@
// <auto-generated/>
#pragma warning disable 1591
namespace Test
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {
}
#pragma warning restore 219
#pragma warning disable 0414
private static System.Object __o = null;
#pragma warning restore 0414
#pragma warning disable 1998
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder)
{
__o = Microsoft.AspNetCore.Components.RuntimeHelpers.TypeCheck<Microsoft.AspNetCore.Components.EventCallback<System.String>>(Microsoft.AspNetCore.Components.EventCallback.Factory.Create<System.String>(this,
#nullable restore
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml"
(s) => {}
#line default
#line hidden
#nullable disable
));
__o = Microsoft.AspNetCore.Components.RuntimeHelpers.TypeCheck<System.String>(Microsoft.AspNetCore.Components.BindMethods.GetValue(
#nullable restore
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml"
message
#line default
#line hidden
#nullable disable
));
__o = Microsoft.AspNetCore.Components.RuntimeHelpers.TypeCheck<Microsoft.AspNetCore.Components.EventCallback<System.String>>(Microsoft.AspNetCore.Components.EventCallback.Factory.Create<System.String>(this,
Microsoft.AspNetCore.Components.EventCallback.Factory.CreateInferred(this, __value => message = __value, message)));
__o = Microsoft.AspNetCore.Components.RuntimeHelpers.TypeCheck<System.Linq.Expressions.Expression<System.Action<System.String>>>(() => message);
builder.AddAttribute(-1, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((builder2) => {
}
));
#nullable restore
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml"
__o = typeof(MyComponent);
#line default
#line hidden
#nullable disable
}
#pragma warning restore 1998
#nullable restore
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml"
string message = "hi";
#line default
#line hidden
#nullable disable
}
}
#pragma warning restore 1591

View File

@ -0,0 +1 @@
x:\dir\subdir\Test\TestComponent.cshtml(1,30): Error RZ10010: The component parameter 'MessageChanged' is used two or more times for this component. Parameters must be unique (case-insensitive). The component parameter 'MessageChanged' is generated by the 'bind-Message' directive attribute.

View File

@ -0,0 +1,37 @@
Document -
NamespaceDeclaration - - Test
UsingDirective - (3:1,1 [12] ) - System
UsingDirective - (18:2,1 [32] ) - System.Collections.Generic
UsingDirective - (53:3,1 [17] ) - System.Linq
UsingDirective - (73:4,1 [28] ) - System.Threading.Tasks
UsingDirective - (104:5,1 [37] ) - Microsoft.AspNetCore.Components
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
CSharpCode -
IntermediateToken - - CSharp - private static System.Object __o = null;
CSharpCode -
IntermediateToken - - CSharp - #pragma warning restore 0414
MethodDeclaration - - protected override - void - BuildRenderTree
Component - (0:0,0 [69] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent
ComponentAttribute - (29:0,29 [12] x:\dir\subdir\Test\TestComponent.cshtml) - MessageChanged - AttributeStructure.DoubleQuotes
CSharpExpression - (30:0,30 [11] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (31:0,31 [9] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - (s) => {}
ComponentAttribute - (57:0,57 [8] x:\dir\subdir\Test\TestComponent.cshtml) - Message - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.BindMethods.GetValue(
IntermediateToken - (58:0,58 [7] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - message
IntermediateToken - - CSharp - )
ComponentAttribute - (57:0,57 [8] x:\dir\subdir\Test\TestComponent.cshtml) - MessageChanged - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.EventCallback.Factory.CreateInferred(this, __value => message = __value, message)
ComponentAttribute - (57:0,57 [8] x:\dir\subdir\Test\TestComponent.cshtml) - MessageExpression - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - () => message
HtmlContent - (69:0,69 [2] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (69:0,69 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
HtmlContent - (114:3,1 [2] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (114:3,1 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
CSharpCode - (83:1,12 [30] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (83:1,12 [30] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n string message = "hi";\n

View File

@ -0,0 +1,19 @@
Source Location: (31:0,31 [9] x:\dir\subdir\Test\TestComponent.cshtml)
|(s) => {}|
Generated Location: (1095:25,31 [9] )
|(s) => {}|
Source Location: (58:0,58 [7] x:\dir\subdir\Test\TestComponent.cshtml)
|message|
Generated Location: (1446:34,58 [7] )
|message|
Source Location: (83:1,12 [30] x:\dir\subdir\Test\TestComponent.cshtml)
|
string message = "hi";
|
Generated Location: (2461:57,12 [30] )
|
string message = "hi";
|

View File

@ -0,0 +1,66 @@
// <auto-generated/>
#pragma warning disable 1591
namespace Test
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {
}
#pragma warning restore 219
#pragma warning disable 0414
private static System.Object __o = null;
#pragma warning restore 0414
#pragma warning disable 1998
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder)
{
__o = Microsoft.AspNetCore.Components.RuntimeHelpers.TypeCheck<System.Linq.Expressions.Expression<System.Action<System.String>>>(
#nullable restore
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml"
(s) => {}
#line default
#line hidden
#nullable disable
);
__o = Microsoft.AspNetCore.Components.RuntimeHelpers.TypeCheck<System.String>(Microsoft.AspNetCore.Components.BindMethods.GetValue(
#nullable restore
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml"
message
#line default
#line hidden
#nullable disable
));
__o = Microsoft.AspNetCore.Components.RuntimeHelpers.TypeCheck<Microsoft.AspNetCore.Components.EventCallback<System.String>>(Microsoft.AspNetCore.Components.EventCallback.Factory.Create<System.String>(this,
Microsoft.AspNetCore.Components.EventCallback.Factory.CreateInferred(this, __value => message = __value, message)));
__o = Microsoft.AspNetCore.Components.RuntimeHelpers.TypeCheck<System.Linq.Expressions.Expression<System.Action<System.String>>>(() => message);
builder.AddAttribute(-1, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((builder2) => {
}
));
#nullable restore
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml"
__o = typeof(MyComponent);
#line default
#line hidden
#nullable disable
}
#pragma warning restore 1998
#nullable restore
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml"
string message = "hi";
#line default
#line hidden
#nullable disable
}
}
#pragma warning restore 1591

View File

@ -0,0 +1 @@
x:\dir\subdir\Test\TestComponent.cshtml(1,57): Error RZ10010: The component parameter 'MessageExpression' is used two or more times for this component. Parameters must be unique (case-insensitive). The component parameter 'MessageExpression' is generated by the 'bind-Message' directive attribute.

View File

@ -0,0 +1,37 @@
Document -
NamespaceDeclaration - - Test
UsingDirective - (3:1,1 [12] ) - System
UsingDirective - (18:2,1 [32] ) - System.Collections.Generic
UsingDirective - (53:3,1 [17] ) - System.Linq
UsingDirective - (73:4,1 [28] ) - System.Threading.Tasks
UsingDirective - (104:5,1 [37] ) - Microsoft.AspNetCore.Components
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
CSharpCode -
IntermediateToken - - CSharp - private static System.Object __o = null;
CSharpCode -
IntermediateToken - - CSharp - #pragma warning restore 0414
MethodDeclaration - - protected override - void - BuildRenderTree
Component - (0:0,0 [72] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent
ComponentAttribute - (56:0,56 [12] x:\dir\subdir\Test\TestComponent.cshtml) - MessageExpression - AttributeStructure.DoubleQuotes
CSharpExpression - (57:0,57 [11] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (58:0,58 [9] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - (s) => {}
ComponentAttribute - (27:0,27 [8] x:\dir\subdir\Test\TestComponent.cshtml) - Message - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.BindMethods.GetValue(
IntermediateToken - (28:0,28 [7] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - message
IntermediateToken - - CSharp - )
ComponentAttribute - (27:0,27 [8] x:\dir\subdir\Test\TestComponent.cshtml) - MessageChanged - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.EventCallback.Factory.CreateInferred(this, __value => message = __value, message)
ComponentAttribute - (27:0,27 [8] x:\dir\subdir\Test\TestComponent.cshtml) - MessageExpression - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - () => message
HtmlContent - (72:0,72 [2] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (72:0,72 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
HtmlContent - (117:3,1 [2] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (117:3,1 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
CSharpCode - (86:1,12 [30] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (86:1,12 [30] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n string message = "hi";\n

View File

@ -0,0 +1,19 @@
Source Location: (58:0,58 [9] x:\dir\subdir\Test\TestComponent.cshtml)
|(s) => {}|
Generated Location: (1044:25,58 [9] )
|(s) => {}|
Source Location: (28:0,28 [7] x:\dir\subdir\Test\TestComponent.cshtml)
|message|
Generated Location: (1364:34,28 [7] )
|message|
Source Location: (86:1,12 [30] x:\dir\subdir\Test\TestComponent.cshtml)
|
string message = "hi";
|
Generated Location: (2379:57,12 [30] )
|
string message = "hi";
|

View File

@ -0,0 +1,40 @@
// <auto-generated/>
#pragma warning disable 1591
namespace Test
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {
}
#pragma warning restore 219
#pragma warning disable 0414
private static System.Object __o = null;
#pragma warning restore 0414
#pragma warning disable 1998
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder)
{
__o = "";
__o = "";
__o = "";
builder.AddAttribute(-1, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((builder2) => {
}
));
#nullable restore
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml"
__o = typeof(MyComponent);
#line default
#line hidden
#nullable disable
}
#pragma warning restore 1998
}
}
#pragma warning restore 1591

View File

@ -0,0 +1,2 @@
x:\dir\subdir\Test\TestComponent.cshtml(1,1): Error RZ10009: The component parameter 'mESSAGE' is used two or more times for this component. Parameters must be unique (case-insensitive).
x:\dir\subdir\Test\TestComponent.cshtml(1,23): Error RZ10009: The component parameter 'Message' is used two or more times for this component. Parameters must be unique (case-insensitive).

View File

@ -0,0 +1,28 @@
Document -
NamespaceDeclaration - - Test
UsingDirective - (3:1,1 [12] ) - System
UsingDirective - (18:2,1 [32] ) - System.Collections.Generic
UsingDirective - (53:3,1 [17] ) - System.Linq
UsingDirective - (73:4,1 [28] ) - System.Threading.Tasks
UsingDirective - (104:5,1 [37] ) - Microsoft.AspNetCore.Components
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
CSharpCode -
IntermediateToken - - CSharp - private static System.Object __o = null;
CSharpCode -
IntermediateToken - - CSharp - #pragma warning restore 0414
MethodDeclaration - - protected override - void - BuildRenderTree
Component - (0:0,0 [66] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent
ComponentAttribute - (22:0,22 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Message - AttributeStructure.DoubleQuotes
HtmlContent - (22:0,22 [4] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (22:0,22 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - test
ComponentAttribute - - mESSAGE - AttributeStructure.DoubleQuotes
HtmlContent - (37:0,37 [4] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (37:0,37 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - test
ComponentAttribute - - Message - AttributeStructure.DoubleQuotes
HtmlContent - (52:0,52 [10] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (52:0,52 [10] x:\dir\subdir\Test\TestComponent.cshtml) - Html - anotherone
HtmlContent - (66:0,66 [2] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (66:0,66 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n

View File

@ -0,0 +1,39 @@
// <auto-generated/>
#pragma warning disable 1591
namespace Test
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {
}
#pragma warning restore 219
#pragma warning disable 0414
private static System.Object __o = null;
#pragma warning restore 0414
#pragma warning disable 1998
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder)
{
__o = "";
__o = "";
builder.AddAttribute(-1, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((builder2) => {
}
));
#nullable restore
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml"
__o = typeof(MyComponent);
#line default
#line hidden
#nullable disable
}
#pragma warning restore 1998
}
}
#pragma warning restore 1591

View File

@ -0,0 +1 @@
x:\dir\subdir\Test\TestComponent.cshtml(1,1): Error RZ10009: The component parameter 'Foo' is used two or more times for this component. Parameters must be unique (case-insensitive).

View File

@ -0,0 +1,25 @@
Document -
NamespaceDeclaration - - Test
UsingDirective - (3:1,1 [12] ) - System
UsingDirective - (18:2,1 [32] ) - System.Collections.Generic
UsingDirective - (53:3,1 [17] ) - System.Linq
UsingDirective - (73:4,1 [28] ) - System.Threading.Tasks
UsingDirective - (104:5,1 [37] ) - Microsoft.AspNetCore.Components
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
CSharpCode -
IntermediateToken - - CSharp - private static System.Object __o = null;
CSharpCode -
IntermediateToken - - CSharp - #pragma warning restore 0414
MethodDeclaration - - protected override - void - BuildRenderTree
Component - (0:0,0 [37] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent
ComponentAttribute - - Foo - AttributeStructure.DoubleQuotes
HtmlContent - (18:0,18 [4] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (18:0,18 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - test
ComponentAttribute - - foo - AttributeStructure.DoubleQuotes
HtmlContent - (29:0,29 [4] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (29:0,29 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - test
HtmlContent - (37:0,37 [2] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (37:0,37 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n

View File

@ -0,0 +1,27 @@
// <auto-generated/>
#pragma warning disable 1591
namespace Test
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {
}
#pragma warning restore 219
#pragma warning disable 0414
private static System.Object __o = null;
#pragma warning restore 0414
#pragma warning disable 1998
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder)
{
}
#pragma warning restore 1998
}
}
#pragma warning restore 1591

View File

@ -0,0 +1 @@
x:\dir\subdir\Test\TestComponent.cshtml(2,5): Error RZ10007: The attribute 'href' is used two or more times for this element. Attributes must be unique (case-insensitive).

View File

@ -0,0 +1,32 @@
Document -
NamespaceDeclaration - - Test
UsingDirective - (3:1,1 [12] ) - System
UsingDirective - (18:2,1 [32] ) - System.Collections.Generic
UsingDirective - (53:3,1 [17] ) - System.Linq
UsingDirective - (73:4,1 [28] ) - System.Threading.Tasks
UsingDirective - (104:5,1 [37] ) - Microsoft.AspNetCore.Components
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
CSharpCode -
IntermediateToken - - CSharp - private static System.Object __o = null;
CSharpCode -
IntermediateToken - - CSharp - #pragma warning restore 0414
MethodDeclaration - - protected override - void - BuildRenderTree
MarkupElement - (0:0,0 [140] x:\dir\subdir\Test\TestComponent.cshtml) - div
HtmlContent - (5:0,5 [4] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (5:0,5 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
MarkupElement - (9:1,2 [123] x:\dir\subdir\Test\TestComponent.cshtml) - a
HtmlAttribute - (11:1,4 [17] x:\dir\subdir\Test\TestComponent.cshtml) - href=" - "
HtmlAttributeValue - (18:1,11 [9] x:\dir\subdir\Test\TestComponent.cshtml) -
IntermediateToken - (18:1,11 [9] x:\dir\subdir\Test\TestComponent.cshtml) - Html - /cool-url
HtmlAttribute - (28:1,21 [9] x:\dir\subdir\Test\TestComponent.cshtml) - style=" - "
HtmlAttribute - (37:1,30 [9] x:\dir\subdir\Test\TestComponent.cshtml) - disabled -
HtmlAttribute - (46:1,39 [24] x:\dir\subdir\Test\TestComponent.cshtml) - href=" - "
HtmlAttributeValue - (53:1,46 [16] x:\dir\subdir\Test\TestComponent.cshtml) -
IntermediateToken - (53:1,46 [16] x:\dir\subdir\Test\TestComponent.cshtml) - Html - /even-cooler-url
HtmlContent - (71:1,64 [57] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (71:1,64 [57] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Learn the ten cool tricks your compiler author will hate!
HtmlContent - (132:1,125 [2] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (132:1,125 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n

View File

@ -0,0 +1,54 @@
// <auto-generated/>
#pragma warning disable 1591
namespace Test
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {
}
#pragma warning restore 219
#pragma warning disable 0414
private static System.Object __o = null;
#pragma warning restore 0414
#pragma warning disable 1998
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder)
{
__o = Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.UIChangeEventArgs>(this,
#nullable restore
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml"
() => {}
#line default
#line hidden
#nullable disable
);
__o = Microsoft.AspNetCore.Components.BindMethods.GetValue(
#nullable restore
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml"
text
#line default
#line hidden
#nullable disable
);
__o = Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => text = __value, text);
}
#pragma warning restore 1998
#nullable restore
#line 4 "x:\dir\subdir\Test\TestComponent.cshtml"
private string text = "hi";
#line default
#line hidden
#nullable disable
}
}
#pragma warning restore 1591

View File

@ -0,0 +1 @@
x:\dir\subdir\Test\TestComponent.cshtml(2,77): Error RZ10008: The attribute 'oninput' is used two or more times for this element. Attributes must be unique (case-insensitive). The attribute 'oninput' is used by the 'bind-value' directive attribute.

View File

@ -0,0 +1,44 @@
Document -
NamespaceDeclaration - - Test
UsingDirective - (3:1,1 [12] ) - System
UsingDirective - (18:2,1 [32] ) - System.Collections.Generic
UsingDirective - (53:3,1 [17] ) - System.Linq
UsingDirective - (73:4,1 [28] ) - System.Threading.Tasks
UsingDirective - (104:5,1 [37] ) - Microsoft.AspNetCore.Components
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
CSharpCode -
IntermediateToken - - CSharp - private static System.Object __o = null;
CSharpCode -
IntermediateToken - - CSharp - #pragma warning restore 0414
MethodDeclaration - - protected override - void - BuildRenderTree
MarkupElement - (0:0,0 [112] x:\dir\subdir\Test\TestComponent.cshtml) - div
HtmlContent - (5:0,5 [4] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (5:0,5 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
MarkupElement - (9:1,2 [95] x:\dir\subdir\Test\TestComponent.cshtml) - input
HtmlAttribute - - type=" - "
HtmlAttributeValue - (22:1,15 [4] x:\dir\subdir\Test\TestComponent.cshtml) -
IntermediateToken - (22:1,15 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - text
HtmlAttribute - (83:1,76 [11] x:\dir\subdir\Test\TestComponent.cshtml) - oninput=" - "
CSharpExpressionAttributeValue - -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.UIChangeEventArgs>(this,
IntermediateToken - (85:1,78 [8] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - () => {}
IntermediateToken - - CSharp - )
HtmlAttribute - (40:1,33 [5] x:\dir\subdir\Test\TestComponent.cshtml) - value=" - "
CSharpExpressionAttributeValue - -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.BindMethods.GetValue(
IntermediateToken - (41:1,34 [4] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - text
IntermediateToken - - CSharp - )
HtmlAttribute - (40:1,33 [5] x:\dir\subdir\Test\TestComponent.cshtml) - oninput=" - "
CSharpExpressionAttributeValue - -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => text = __value, text)
HtmlContent - (104:1,97 [2] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (104:1,97 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
HtmlContent - (112:2,6 [2] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (112:2,6 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
HtmlContent - (162:5,1 [2] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (162:5,1 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
CSharpCode - (126:3,12 [35] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (126:3,12 [35] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n private string text = "hi";\n

View File

@ -0,0 +1,19 @@
Source Location: (85:1,78 [8] x:\dir\subdir\Test\TestComponent.cshtml)
|() => {}|
Generated Location: (1059:25,78 [8] )
|() => {}|
Source Location: (41:1,34 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|text|
Generated Location: (1312:34,34 [4] )
|text|
Source Location: (126:3,12 [35] x:\dir\subdir\Test\TestComponent.cshtml)
|
private string text = "hi";
|
Generated Location: (1641:45,12 [35] )
|
private string text = "hi";
|

View File

@ -0,0 +1,45 @@
// <auto-generated/>
#pragma warning disable 1591
namespace Test
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {
}
#pragma warning restore 219
#pragma warning disable 0414
private static System.Object __o = null;
#pragma warning restore 0414
#pragma warning disable 1998
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder)
{
__o = Microsoft.AspNetCore.Components.BindMethods.GetValue(
#nullable restore
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml"
text
#line default
#line hidden
#nullable disable
);
__o = Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => text = __value, text);
}
#pragma warning restore 1998
#nullable restore
#line 4 "x:\dir\subdir\Test\TestComponent.cshtml"
private string text = "hi";
#line default
#line hidden
#nullable disable
}
}
#pragma warning restore 1591

View File

@ -0,0 +1 @@
x:\dir\subdir\Test\TestComponent.cshtml(2,3): Error RZ10008: The attribute 'value' is used two or more times for this element. Attributes must be unique (case-insensitive). The attribute 'value' is used by the 'bind' directive attribute.

View File

@ -0,0 +1,42 @@
Document -
NamespaceDeclaration - - Test
UsingDirective - (3:1,1 [12] ) - System
UsingDirective - (18:2,1 [32] ) - System.Collections.Generic
UsingDirective - (53:3,1 [17] ) - System.Linq
UsingDirective - (73:4,1 [28] ) - System.Threading.Tasks
UsingDirective - (104:5,1 [37] ) - Microsoft.AspNetCore.Components
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
CSharpCode -
IntermediateToken - - CSharp - private static System.Object __o = null;
CSharpCode -
IntermediateToken - - CSharp - #pragma warning restore 0414
MethodDeclaration - - protected override - void - BuildRenderTree
MarkupElement - (0:0,0 [68] x:\dir\subdir\Test\TestComponent.cshtml) - div
HtmlContent - (5:0,5 [4] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (5:0,5 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
MarkupElement - (9:1,2 [51] x:\dir\subdir\Test\TestComponent.cshtml) - input
HtmlAttribute - - type=" - "
HtmlAttributeValue - (22:1,15 [4] x:\dir\subdir\Test\TestComponent.cshtml) -
IntermediateToken - (22:1,15 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - text
HtmlAttribute - - value=" - "
HtmlAttributeValue - (35:1,28 [2] x:\dir\subdir\Test\TestComponent.cshtml) -
IntermediateToken - (35:1,28 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - 17
HtmlAttribute - (45:1,38 [5] x:\dir\subdir\Test\TestComponent.cshtml) - value=" - "
CSharpExpressionAttributeValue - -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.BindMethods.GetValue(
IntermediateToken - (46:1,39 [4] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - text
IntermediateToken - - CSharp - )
HtmlAttribute - (45:1,38 [5] x:\dir\subdir\Test\TestComponent.cshtml) - onchange=" - "
CSharpExpressionAttributeValue - -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => text = __value, text)
HtmlContent - (60:1,53 [2] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (60:1,53 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
HtmlContent - (68:2,6 [2] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (68:2,6 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
HtmlContent - (118:5,1 [2] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (118:5,1 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
CSharpCode - (82:3,12 [35] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (82:3,12 [35] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n private string text = "hi";\n

View File

@ -0,0 +1,14 @@
Source Location: (46:1,39 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|text|
Generated Location: (955:25,39 [4] )
|text|
Source Location: (82:3,12 [35] x:\dir\subdir\Test\TestComponent.cshtml)
|
private string text = "hi";
|
Generated Location: (1284:36,12 [35] )
|
private string text = "hi";
|

View File

@ -0,0 +1,35 @@
// <auto-generated/>
#pragma warning disable 1591
namespace Test
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {
}
#pragma warning restore 219
#pragma warning disable 0414
private static System.Object __o = null;
#pragma warning restore 0414
#pragma warning disable 1998
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder)
{
__o = Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.UIMouseEventArgs>(this, "test()");
#nullable restore
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml"
__o = () => {};
#line default
#line hidden
#nullable disable
}
#pragma warning restore 1998
}
}
#pragma warning restore 1591

View File

@ -0,0 +1 @@
x:\dir\subdir\Test\TestComponent.cshtml(2,15): Error RZ10008: The attribute 'onclick' is used two or more times for this element. Attributes must be unique (case-insensitive). The attribute 'onclick' is used by the 'onclick' directive attribute.

View File

@ -0,0 +1,32 @@
Document -
NamespaceDeclaration - - Test
UsingDirective - (3:1,1 [12] ) - System
UsingDirective - (18:2,1 [32] ) - System.Collections.Generic
UsingDirective - (53:3,1 [17] ) - System.Linq
UsingDirective - (73:4,1 [28] ) - System.Threading.Tasks
UsingDirective - (104:5,1 [37] ) - Microsoft.AspNetCore.Components
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
CSharpCode -
IntermediateToken - - CSharp - private static System.Object __o = null;
CSharpCode -
IntermediateToken - - CSharp - #pragma warning restore 0414
MethodDeclaration - - protected override - void - BuildRenderTree
MarkupElement - (0:0,0 [120] x:\dir\subdir\Test\TestComponent.cshtml) - div
HtmlContent - (5:0,5 [4] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (5:0,5 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
MarkupElement - (9:1,2 [103] x:\dir\subdir\Test\TestComponent.cshtml) - a
HtmlContent - (51:1,44 [57] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (51:1,44 [57] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Learn the ten cool tricks your compiler author will hate!
HtmlAttribute - (21:1,14 [6] x:\dir\subdir\Test\TestComponent.cshtml) - onclick=" - "
CSharpExpressionAttributeValue - -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.UIMouseEventArgs>(this,
IntermediateToken - - CSharp - "test()"
IntermediateToken - - CSharp - )
HtmlAttribute - - onclick=" - "
CSharpExpression - (40:1,33 [8] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (40:1,33 [8] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - () => {}
HtmlContent - (112:1,105 [2] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (112:1,105 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n

View File

@ -0,0 +1,5 @@
Source Location: (40:1,33 [8] x:\dir\subdir\Test\TestComponent.cshtml)
|() => {}|
Generated Location: (1023:25,33 [8] )
|() => {}|

View File

@ -0,0 +1,27 @@
// <auto-generated/>
#pragma warning disable 1591
namespace Test
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {
}
#pragma warning restore 219
#pragma warning disable 0414
private static System.Object __o = null;
#pragma warning restore 0414
#pragma warning disable 1998
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder)
{
}
#pragma warning restore 1998
}
}
#pragma warning restore 1591

View File

@ -0,0 +1,2 @@
x:\dir\subdir\Test\TestComponent.cshtml(2,5): Error RZ10007: The attribute 'href' is used two or more times for this element. Attributes must be unique (case-insensitive).
x:\dir\subdir\Test\TestComponent.cshtml(2,40): Error RZ10007: The attribute 'href' is used two or more times for this element. Attributes must be unique (case-insensitive).

View File

@ -0,0 +1,33 @@
Document -
NamespaceDeclaration - - Test
UsingDirective - (3:1,1 [12] ) - System
UsingDirective - (18:2,1 [32] ) - System.Collections.Generic
UsingDirective - (53:3,1 [17] ) - System.Linq
UsingDirective - (73:4,1 [28] ) - System.Threading.Tasks
UsingDirective - (104:5,1 [37] ) - Microsoft.AspNetCore.Components
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
CSharpCode -
IntermediateToken - - CSharp - private static System.Object __o = null;
CSharpCode -
IntermediateToken - - CSharp - #pragma warning restore 0414
MethodDeclaration - - protected override - void - BuildRenderTree
MarkupElement - (0:0,0 [145] x:\dir\subdir\Test\TestComponent.cshtml) - div
HtmlContent - (5:0,5 [4] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (5:0,5 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
MarkupElement - (9:1,2 [128] x:\dir\subdir\Test\TestComponent.cshtml) - a
HtmlAttribute - (11:1,4 [17] x:\dir\subdir\Test\TestComponent.cshtml) - href=" - "
HtmlAttributeValue - (18:1,11 [9] x:\dir\subdir\Test\TestComponent.cshtml) -
IntermediateToken - (18:1,11 [9] x:\dir\subdir\Test\TestComponent.cshtml) - Html - /cool-url
HtmlAttribute - (28:1,21 [9] x:\dir\subdir\Test\TestComponent.cshtml) - style=" - "
HtmlAttribute - (37:1,30 [9] x:\dir\subdir\Test\TestComponent.cshtml) - disabled -
HtmlAttribute - (46:1,39 [24] x:\dir\subdir\Test\TestComponent.cshtml) - href=" - "
HtmlAttributeValue - (53:1,46 [16] x:\dir\subdir\Test\TestComponent.cshtml) -
IntermediateToken - (53:1,46 [16] x:\dir\subdir\Test\TestComponent.cshtml) - Html - /even-cooler-url
HtmlAttribute - (70:1,63 [5] x:\dir\subdir\Test\TestComponent.cshtml) - href -
HtmlContent - (76:1,69 [57] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (76:1,69 [57] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Learn the ten cool tricks your compiler author will hate!
HtmlContent - (137:1,130 [2] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (137:1,130 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n

View File

@ -0,0 +1,24 @@
// <auto-generated/>
#pragma warning disable 1591
namespace Test
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 1998
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder)
{
builder.OpenComponent<Test.MyComponent>(0);
builder.AddAttribute(1, "Message", "test");
builder.AddAttribute(2, "mESSAGE", "test");
builder.CloseComponent();
}
#pragma warning restore 1998
}
}
#pragma warning restore 1591

View File

@ -0,0 +1 @@
x:\dir\subdir\Test\TestComponent.cshtml(1,23): Error RZ10009: The component parameter 'Message' is used two or more times for this component. Parameters must be unique (case-insensitive).

View File

@ -0,0 +1,16 @@
Document -
NamespaceDeclaration - - Test
UsingDirective - (3:1,1 [14] ) - System
UsingDirective - (18:2,1 [34] ) - System.Collections.Generic
UsingDirective - (53:3,1 [19] ) - System.Linq
UsingDirective - (73:4,1 [30] ) - System.Threading.Tasks
UsingDirective - (104:5,1 [39] ) - Microsoft.AspNetCore.Components
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
MethodDeclaration - - protected override - void - BuildRenderTree
Component - (0:0,0 [45] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent
ComponentAttribute - (22:0,22 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Message - AttributeStructure.DoubleQuotes
HtmlContent - (22:0,22 [4] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (22:0,22 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - test
ComponentAttribute - - mESSAGE - AttributeStructure.DoubleQuotes
HtmlContent - (37:0,37 [4] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (37:0,37 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - test

View File

@ -0,0 +1,50 @@
// <auto-generated/>
#pragma warning disable 1591
namespace Test
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 1998
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder)
{
builder.OpenComponent<Test.MyComponent>(0);
builder.AddAttribute(1, "Message", Microsoft.AspNetCore.Components.RuntimeHelpers.TypeCheck<System.String>(
#nullable restore
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml"
message
#line default
#line hidden
#nullable disable
));
builder.AddAttribute(2, "Message", Microsoft.AspNetCore.Components.RuntimeHelpers.TypeCheck<System.String>(Microsoft.AspNetCore.Components.BindMethods.GetValue(
#nullable restore
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml"
message
#line default
#line hidden
#nullable disable
)));
builder.AddAttribute(3, "MessageChanged", Microsoft.AspNetCore.Components.RuntimeHelpers.TypeCheck<Microsoft.AspNetCore.Components.EventCallback<System.String>>(Microsoft.AspNetCore.Components.EventCallback.Factory.Create<System.String>(this, Microsoft.AspNetCore.Components.EventCallback.Factory.CreateInferred(this, __value => message = __value, message))));
builder.AddAttribute(4, "MessageExpression", Microsoft.AspNetCore.Components.RuntimeHelpers.TypeCheck<System.Linq.Expressions.Expression<System.Action<System.String>>>(() => message));
builder.CloseComponent();
}
#pragma warning restore 1998
#nullable restore
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml"
string message = "hi";
#line default
#line hidden
#nullable disable
}
}
#pragma warning restore 1591

View File

@ -0,0 +1 @@
x:\dir\subdir\Test\TestComponent.cshtml(1,23): Error RZ10010: The component parameter 'Message' is used two or more times for this component. Parameters must be unique (case-insensitive). The component parameter 'Message' is generated by the 'bind-Message' directive attribute.

View File

@ -0,0 +1,26 @@
Document -
NamespaceDeclaration - - Test
UsingDirective - (3:1,1 [14] ) - System
UsingDirective - (18:2,1 [34] ) - System.Collections.Generic
UsingDirective - (53:3,1 [19] ) - System.Linq
UsingDirective - (73:4,1 [30] ) - System.Threading.Tasks
UsingDirective - (104:5,1 [39] ) - Microsoft.AspNetCore.Components
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
MethodDeclaration - - protected override - void - BuildRenderTree
Component - (0:0,0 [58] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent
ComponentAttribute - (22:0,22 [8] x:\dir\subdir\Test\TestComponent.cshtml) - Message - AttributeStructure.DoubleQuotes
CSharpExpression - (23:0,23 [7] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (23:0,23 [7] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - message
ComponentAttribute - (46:0,46 [8] x:\dir\subdir\Test\TestComponent.cshtml) - Message - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.BindMethods.GetValue(
IntermediateToken - (47:0,47 [7] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - message
IntermediateToken - - CSharp - )
ComponentAttribute - (46:0,46 [8] x:\dir\subdir\Test\TestComponent.cshtml) - MessageChanged - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.EventCallback.Factory.CreateInferred(this, __value => message = __value, message)
ComponentAttribute - (46:0,46 [8] x:\dir\subdir\Test\TestComponent.cshtml) - MessageExpression - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - () => message
CSharpCode - (72:1,12 [30] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (72:1,12 [30] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n string message = "hi";\n

View File

@ -0,0 +1,9 @@
Source Location: (72:1,12 [30] x:\dir\subdir\Test\TestComponent.cshtml)
|
string message = "hi";
|
Generated Location: (1962:41,12 [30] )
|
string message = "hi";
|

View File

@ -0,0 +1,50 @@
// <auto-generated/>
#pragma warning disable 1591
namespace Test
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 1998
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder)
{
builder.OpenComponent<Test.MyComponent>(0);
builder.AddAttribute(1, "MessageChanged", Microsoft.AspNetCore.Components.RuntimeHelpers.TypeCheck<Microsoft.AspNetCore.Components.EventCallback<System.String>>(Microsoft.AspNetCore.Components.EventCallback.Factory.Create<System.String>(this,
#nullable restore
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml"
(s) => {}
#line default
#line hidden
#nullable disable
)));
builder.AddAttribute(2, "Message", Microsoft.AspNetCore.Components.RuntimeHelpers.TypeCheck<System.String>(Microsoft.AspNetCore.Components.BindMethods.GetValue(
#nullable restore
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml"
message
#line default
#line hidden
#nullable disable
)));
builder.AddAttribute(3, "MessageChanged", Microsoft.AspNetCore.Components.RuntimeHelpers.TypeCheck<Microsoft.AspNetCore.Components.EventCallback<System.String>>(Microsoft.AspNetCore.Components.EventCallback.Factory.Create<System.String>(this, Microsoft.AspNetCore.Components.EventCallback.Factory.CreateInferred(this, __value => message = __value, message))));
builder.AddAttribute(4, "MessageExpression", Microsoft.AspNetCore.Components.RuntimeHelpers.TypeCheck<System.Linq.Expressions.Expression<System.Action<System.String>>>(() => message));
builder.CloseComponent();
}
#pragma warning restore 1998
#nullable restore
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml"
string message = "hi";
#line default
#line hidden
#nullable disable
}
}
#pragma warning restore 1591

View File

@ -0,0 +1 @@
x:\dir\subdir\Test\TestComponent.cshtml(1,30): Error RZ10010: The component parameter 'MessageChanged' is used two or more times for this component. Parameters must be unique (case-insensitive). The component parameter 'MessageChanged' is generated by the 'bind-Message' directive attribute.

View File

@ -0,0 +1,26 @@
Document -
NamespaceDeclaration - - Test
UsingDirective - (3:1,1 [14] ) - System
UsingDirective - (18:2,1 [34] ) - System.Collections.Generic
UsingDirective - (53:3,1 [19] ) - System.Linq
UsingDirective - (73:4,1 [30] ) - System.Threading.Tasks
UsingDirective - (104:5,1 [39] ) - Microsoft.AspNetCore.Components
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
MethodDeclaration - - protected override - void - BuildRenderTree
Component - (0:0,0 [69] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent
ComponentAttribute - (29:0,29 [12] x:\dir\subdir\Test\TestComponent.cshtml) - MessageChanged - AttributeStructure.DoubleQuotes
CSharpExpression - (30:0,30 [11] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (31:0,31 [9] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - (s) => {}
ComponentAttribute - (57:0,57 [8] x:\dir\subdir\Test\TestComponent.cshtml) - Message - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.BindMethods.GetValue(
IntermediateToken - (58:0,58 [7] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - message
IntermediateToken - - CSharp - )
ComponentAttribute - (57:0,57 [8] x:\dir\subdir\Test\TestComponent.cshtml) - MessageChanged - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.EventCallback.Factory.CreateInferred(this, __value => message = __value, message)
ComponentAttribute - (57:0,57 [8] x:\dir\subdir\Test\TestComponent.cshtml) - MessageExpression - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - () => message
CSharpCode - (83:1,12 [30] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (83:1,12 [30] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n string message = "hi";\n

View File

@ -0,0 +1,9 @@
Source Location: (83:1,12 [30] x:\dir\subdir\Test\TestComponent.cshtml)
|
string message = "hi";
|
Generated Location: (2120:41,12 [30] )
|
string message = "hi";
|

View File

@ -0,0 +1,50 @@
// <auto-generated/>
#pragma warning disable 1591
namespace Test
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 1998
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder)
{
builder.OpenComponent<Test.MyComponent>(0);
builder.AddAttribute(1, "MessageExpression", Microsoft.AspNetCore.Components.RuntimeHelpers.TypeCheck<System.Linq.Expressions.Expression<System.Action<System.String>>>(
#nullable restore
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml"
(s) => {}
#line default
#line hidden
#nullable disable
));
builder.AddAttribute(2, "Message", Microsoft.AspNetCore.Components.RuntimeHelpers.TypeCheck<System.String>(Microsoft.AspNetCore.Components.BindMethods.GetValue(
#nullable restore
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml"
message
#line default
#line hidden
#nullable disable
)));
builder.AddAttribute(3, "MessageChanged", Microsoft.AspNetCore.Components.RuntimeHelpers.TypeCheck<Microsoft.AspNetCore.Components.EventCallback<System.String>>(Microsoft.AspNetCore.Components.EventCallback.Factory.Create<System.String>(this, Microsoft.AspNetCore.Components.EventCallback.Factory.CreateInferred(this, __value => message = __value, message))));
builder.AddAttribute(4, "MessageExpression", Microsoft.AspNetCore.Components.RuntimeHelpers.TypeCheck<System.Linq.Expressions.Expression<System.Action<System.String>>>(() => message));
builder.CloseComponent();
}
#pragma warning restore 1998
#nullable restore
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml"
string message = "hi";
#line default
#line hidden
#nullable disable
}
}
#pragma warning restore 1591

View File

@ -0,0 +1 @@
x:\dir\subdir\Test\TestComponent.cshtml(1,57): Error RZ10010: The component parameter 'MessageExpression' is used two or more times for this component. Parameters must be unique (case-insensitive). The component parameter 'MessageExpression' is generated by the 'bind-Message' directive attribute.

View File

@ -0,0 +1,26 @@
Document -
NamespaceDeclaration - - Test
UsingDirective - (3:1,1 [14] ) - System
UsingDirective - (18:2,1 [34] ) - System.Collections.Generic
UsingDirective - (53:3,1 [19] ) - System.Linq
UsingDirective - (73:4,1 [30] ) - System.Threading.Tasks
UsingDirective - (104:5,1 [39] ) - Microsoft.AspNetCore.Components
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
MethodDeclaration - - protected override - void - BuildRenderTree
Component - (0:0,0 [72] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent
ComponentAttribute - (56:0,56 [12] x:\dir\subdir\Test\TestComponent.cshtml) - MessageExpression - AttributeStructure.DoubleQuotes
CSharpExpression - (57:0,57 [11] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (58:0,58 [9] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - (s) => {}
ComponentAttribute - (27:0,27 [8] x:\dir\subdir\Test\TestComponent.cshtml) - Message - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.BindMethods.GetValue(
IntermediateToken - (28:0,28 [7] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - message
IntermediateToken - - CSharp - )
ComponentAttribute - (27:0,27 [8] x:\dir\subdir\Test\TestComponent.cshtml) - MessageChanged - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.EventCallback.Factory.CreateInferred(this, __value => message = __value, message)
ComponentAttribute - (27:0,27 [8] x:\dir\subdir\Test\TestComponent.cshtml) - MessageExpression - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - () => message
CSharpCode - (86:1,12 [30] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (86:1,12 [30] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n string message = "hi";\n

View File

@ -0,0 +1,9 @@
Source Location: (86:1,12 [30] x:\dir\subdir\Test\TestComponent.cshtml)
|
string message = "hi";
|
Generated Location: (2041:41,12 [30] )
|
string message = "hi";
|

View File

@ -0,0 +1,25 @@
// <auto-generated/>
#pragma warning disable 1591
namespace Test
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 1998
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder)
{
builder.OpenComponent<Test.MyComponent>(0);
builder.AddAttribute(1, "Message", "test");
builder.AddAttribute(2, "mESSAGE", "test");
builder.AddAttribute(3, "Message", "anotherone");
builder.CloseComponent();
}
#pragma warning restore 1998
}
}
#pragma warning restore 1591

View File

@ -0,0 +1,2 @@
x:\dir\subdir\Test\TestComponent.cshtml(1,1): Error RZ10009: The component parameter 'mESSAGE' is used two or more times for this component. Parameters must be unique (case-insensitive).
x:\dir\subdir\Test\TestComponent.cshtml(1,23): Error RZ10009: The component parameter 'Message' is used two or more times for this component. Parameters must be unique (case-insensitive).

View File

@ -0,0 +1,19 @@
Document -
NamespaceDeclaration - - Test
UsingDirective - (3:1,1 [14] ) - System
UsingDirective - (18:2,1 [34] ) - System.Collections.Generic
UsingDirective - (53:3,1 [19] ) - System.Linq
UsingDirective - (73:4,1 [30] ) - System.Threading.Tasks
UsingDirective - (104:5,1 [39] ) - Microsoft.AspNetCore.Components
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
MethodDeclaration - - protected override - void - BuildRenderTree
Component - (0:0,0 [66] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent
ComponentAttribute - (22:0,22 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Message - AttributeStructure.DoubleQuotes
HtmlContent - (22:0,22 [4] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (22:0,22 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - test
ComponentAttribute - - mESSAGE - AttributeStructure.DoubleQuotes
HtmlContent - (37:0,37 [4] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (37:0,37 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - test
ComponentAttribute - - Message - AttributeStructure.DoubleQuotes
HtmlContent - (52:0,52 [10] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (52:0,52 [10] x:\dir\subdir\Test\TestComponent.cshtml) - Html - anotherone

View File

@ -0,0 +1,24 @@
// <auto-generated/>
#pragma warning disable 1591
namespace Test
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 1998
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder)
{
builder.OpenComponent<Test.MyComponent>(0);
builder.AddAttribute(1, "Foo", "test");
builder.AddAttribute(2, "foo", "test");
builder.CloseComponent();
}
#pragma warning restore 1998
}
}
#pragma warning restore 1591

View File

@ -0,0 +1 @@
x:\dir\subdir\Test\TestComponent.cshtml(1,1): Error RZ10009: The component parameter 'Foo' is used two or more times for this component. Parameters must be unique (case-insensitive).

View File

@ -0,0 +1,16 @@
Document -
NamespaceDeclaration - - Test
UsingDirective - (3:1,1 [14] ) - System
UsingDirective - (18:2,1 [34] ) - System.Collections.Generic
UsingDirective - (53:3,1 [19] ) - System.Linq
UsingDirective - (73:4,1 [30] ) - System.Threading.Tasks
UsingDirective - (104:5,1 [39] ) - Microsoft.AspNetCore.Components
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
MethodDeclaration - - protected override - void - BuildRenderTree
Component - (0:0,0 [37] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent
ComponentAttribute - - Foo - AttributeStructure.DoubleQuotes
HtmlContent - (18:0,18 [4] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (18:0,18 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - test
ComponentAttribute - - foo - AttributeStructure.DoubleQuotes
HtmlContent - (29:0,29 [4] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (29:0,29 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - test

View File

@ -0,0 +1,31 @@
// <auto-generated/>
#pragma warning disable 1591
namespace Test
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 1998
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder)
{
builder.OpenElement(0, "div");
builder.AddMarkupContent(1, "\r\n ");
builder.OpenElement(2, "a");
builder.AddAttribute(3, "href", "/cool-url");
builder.AddAttribute(4, "style", true);
builder.AddAttribute(5, "disabled", true);
builder.AddAttribute(6, "href", "/even-cooler-url");
builder.AddContent(7, "Learn the ten cool tricks your compiler author will hate!");
builder.CloseElement();
builder.AddMarkupContent(8, "\r\n");
builder.CloseElement();
}
#pragma warning restore 1998
}
}
#pragma warning restore 1591

View File

@ -0,0 +1 @@
x:\dir\subdir\Test\TestComponent.cshtml(2,5): Error RZ10007: The attribute 'href' is used two or more times for this element. Attributes must be unique (case-insensitive).

View File

@ -0,0 +1,25 @@
Document -
NamespaceDeclaration - - Test
UsingDirective - (3:1,1 [14] ) - System
UsingDirective - (18:2,1 [34] ) - System.Collections.Generic
UsingDirective - (53:3,1 [19] ) - System.Linq
UsingDirective - (73:4,1 [30] ) - System.Threading.Tasks
UsingDirective - (104:5,1 [39] ) - Microsoft.AspNetCore.Components
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
MethodDeclaration - - protected override - void - BuildRenderTree
MarkupElement - (0:0,0 [140] x:\dir\subdir\Test\TestComponent.cshtml) - div
HtmlContent - (5:0,5 [4] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (5:0,5 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
MarkupElement - (9:1,2 [123] x:\dir\subdir\Test\TestComponent.cshtml) - a
HtmlAttribute - (11:1,4 [17] x:\dir\subdir\Test\TestComponent.cshtml) - href=" - "
HtmlAttributeValue - (18:1,11 [9] x:\dir\subdir\Test\TestComponent.cshtml) -
IntermediateToken - (18:1,11 [9] x:\dir\subdir\Test\TestComponent.cshtml) - Html - /cool-url
HtmlAttribute - (28:1,21 [9] x:\dir\subdir\Test\TestComponent.cshtml) - style=" - "
HtmlAttribute - (37:1,30 [9] x:\dir\subdir\Test\TestComponent.cshtml) - disabled -
HtmlAttribute - (46:1,39 [24] x:\dir\subdir\Test\TestComponent.cshtml) - href=" - "
HtmlAttributeValue - (53:1,46 [16] x:\dir\subdir\Test\TestComponent.cshtml) -
IntermediateToken - (53:1,46 [16] x:\dir\subdir\Test\TestComponent.cshtml) - Html - /even-cooler-url
HtmlContent - (71:1,64 [57] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (71:1,64 [57] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Learn the ten cool tricks your compiler author will hate!
HtmlContent - (132:1,125 [2] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (132:1,125 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n

View File

@ -0,0 +1,54 @@
// <auto-generated/>
#pragma warning disable 1591
namespace Test
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 1998
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder)
{
builder.OpenElement(0, "div");
builder.AddMarkupContent(1, "\r\n ");
builder.OpenElement(2, "input");
builder.AddAttribute(3, "type", "text");
builder.AddAttribute(4, "oninput", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.UIChangeEventArgs>(this,
#nullable restore
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml"
() => {}
#line default
#line hidden
#nullable disable
));
builder.AddAttribute(5, "value", Microsoft.AspNetCore.Components.BindMethods.GetValue(
#nullable restore
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml"
text
#line default
#line hidden
#nullable disable
));
builder.AddAttribute(6, "oninput", Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => text = __value, text));
builder.CloseElement();
builder.AddMarkupContent(7, "\r\n");
builder.CloseElement();
}
#pragma warning restore 1998
#nullable restore
#line 4 "x:\dir\subdir\Test\TestComponent.cshtml"
private string text = "hi";
#line default
#line hidden
#nullable disable
}
}
#pragma warning restore 1591

View File

@ -0,0 +1 @@
x:\dir\subdir\Test\TestComponent.cshtml(2,77): Error RZ10008: The attribute 'oninput' is used two or more times for this element. Attributes must be unique (case-insensitive). The attribute 'oninput' is used by the 'bind-value' directive attribute.

View File

@ -0,0 +1,33 @@
Document -
NamespaceDeclaration - - Test
UsingDirective - (3:1,1 [14] ) - System
UsingDirective - (18:2,1 [34] ) - System.Collections.Generic
UsingDirective - (53:3,1 [19] ) - System.Linq
UsingDirective - (73:4,1 [30] ) - System.Threading.Tasks
UsingDirective - (104:5,1 [39] ) - Microsoft.AspNetCore.Components
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
MethodDeclaration - - protected override - void - BuildRenderTree
MarkupElement - (0:0,0 [112] x:\dir\subdir\Test\TestComponent.cshtml) - div
HtmlContent - (5:0,5 [4] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (5:0,5 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
MarkupElement - (9:1,2 [95] x:\dir\subdir\Test\TestComponent.cshtml) - input
HtmlAttribute - - type=" - "
HtmlAttributeValue - (22:1,15 [4] x:\dir\subdir\Test\TestComponent.cshtml) -
IntermediateToken - (22:1,15 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - text
HtmlAttribute - (83:1,76 [11] x:\dir\subdir\Test\TestComponent.cshtml) - oninput=" - "
CSharpExpressionAttributeValue - -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.UIChangeEventArgs>(this,
IntermediateToken - (85:1,78 [8] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - () => {}
IntermediateToken - - CSharp - )
HtmlAttribute - (40:1,33 [5] x:\dir\subdir\Test\TestComponent.cshtml) - value=" - "
CSharpExpressionAttributeValue - -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.BindMethods.GetValue(
IntermediateToken - (41:1,34 [4] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - text
IntermediateToken - - CSharp - )
HtmlAttribute - (40:1,33 [5] x:\dir\subdir\Test\TestComponent.cshtml) - oninput=" - "
CSharpExpressionAttributeValue - -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => text = __value, text)
HtmlContent - (104:1,97 [2] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (104:1,97 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
CSharpCode - (126:3,12 [35] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (126:3,12 [35] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n private string text = "hi";\n

View File

@ -0,0 +1,9 @@
Source Location: (126:3,12 [35] x:\dir\subdir\Test\TestComponent.cshtml)
|
private string text = "hi";
|
Generated Location: (1781:45,12 [35] )
|
private string text = "hi";
|

View File

@ -0,0 +1,46 @@
// <auto-generated/>
#pragma warning disable 1591
namespace Test
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 1998
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder)
{
builder.OpenElement(0, "div");
builder.AddMarkupContent(1, "\r\n ");
builder.OpenElement(2, "input");
builder.AddAttribute(3, "type", "text");
builder.AddAttribute(4, "value", "17");
builder.AddAttribute(5, "value", Microsoft.AspNetCore.Components.BindMethods.GetValue(
#nullable restore
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml"
text
#line default
#line hidden
#nullable disable
));
builder.AddAttribute(6, "onchange", Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => text = __value, text));
builder.CloseElement();
builder.AddMarkupContent(7, "\r\n");
builder.CloseElement();
}
#pragma warning restore 1998
#nullable restore
#line 4 "x:\dir\subdir\Test\TestComponent.cshtml"
private string text = "hi";
#line default
#line hidden
#nullable disable
}
}
#pragma warning restore 1591

View File

@ -0,0 +1 @@
x:\dir\subdir\Test\TestComponent.cshtml(2,3): Error RZ10008: The attribute 'value' is used two or more times for this element. Attributes must be unique (case-insensitive). The attribute 'value' is used by the 'bind' directive attribute.

View File

@ -0,0 +1,31 @@
Document -
NamespaceDeclaration - - Test
UsingDirective - (3:1,1 [14] ) - System
UsingDirective - (18:2,1 [34] ) - System.Collections.Generic
UsingDirective - (53:3,1 [19] ) - System.Linq
UsingDirective - (73:4,1 [30] ) - System.Threading.Tasks
UsingDirective - (104:5,1 [39] ) - Microsoft.AspNetCore.Components
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
MethodDeclaration - - protected override - void - BuildRenderTree
MarkupElement - (0:0,0 [68] x:\dir\subdir\Test\TestComponent.cshtml) - div
HtmlContent - (5:0,5 [4] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (5:0,5 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
MarkupElement - (9:1,2 [51] x:\dir\subdir\Test\TestComponent.cshtml) - input
HtmlAttribute - - type=" - "
HtmlAttributeValue - (22:1,15 [4] x:\dir\subdir\Test\TestComponent.cshtml) -
IntermediateToken - (22:1,15 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - text
HtmlAttribute - - value=" - "
HtmlAttributeValue - (35:1,28 [2] x:\dir\subdir\Test\TestComponent.cshtml) -
IntermediateToken - (35:1,28 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - 17
HtmlAttribute - (45:1,38 [5] x:\dir\subdir\Test\TestComponent.cshtml) - value=" - "
CSharpExpressionAttributeValue - -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.BindMethods.GetValue(
IntermediateToken - (46:1,39 [4] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - text
IntermediateToken - - CSharp - )
HtmlAttribute - (45:1,38 [5] x:\dir\subdir\Test\TestComponent.cshtml) - onchange=" - "
CSharpExpressionAttributeValue - -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => text = __value, text)
HtmlContent - (60:1,53 [2] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (60:1,53 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
CSharpCode - (82:3,12 [35] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (82:3,12 [35] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n private string text = "hi";\n

View File

@ -0,0 +1,9 @@
Source Location: (82:3,12 [35] x:\dir\subdir\Test\TestComponent.cshtml)
|
private string text = "hi";
|
Generated Location: (1448:37,12 [35] )
|
private string text = "hi";
|

View File

@ -0,0 +1,38 @@
// <auto-generated/>
#pragma warning disable 1591
namespace Test
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 1998
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder)
{
builder.OpenElement(0, "div");
builder.AddMarkupContent(1, "\r\n ");
builder.OpenElement(2, "a");
builder.AddAttribute(3, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.UIMouseEventArgs>(this, "test()"));
builder.AddContent(4,
#nullable restore
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml"
() => {}
#line default
#line hidden
#nullable disable
);
builder.AddAttribute(5, "onclick", true);
builder.AddContent(6, "Learn the ten cool tricks your compiler author will hate!");
builder.CloseElement();
builder.AddMarkupContent(7, "\r\n");
builder.CloseElement();
}
#pragma warning restore 1998
}
}
#pragma warning restore 1591

View File

@ -0,0 +1 @@
x:\dir\subdir\Test\TestComponent.cshtml(2,15): Error RZ10008: The attribute 'onclick' is used two or more times for this element. Attributes must be unique (case-insensitive). The attribute 'onclick' is used by the 'onclick' directive attribute.

View File

@ -0,0 +1,25 @@
Document -
NamespaceDeclaration - - Test
UsingDirective - (3:1,1 [14] ) - System
UsingDirective - (18:2,1 [34] ) - System.Collections.Generic
UsingDirective - (53:3,1 [19] ) - System.Linq
UsingDirective - (73:4,1 [30] ) - System.Threading.Tasks
UsingDirective - (104:5,1 [39] ) - Microsoft.AspNetCore.Components
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
MethodDeclaration - - protected override - void - BuildRenderTree
MarkupElement - (0:0,0 [120] x:\dir\subdir\Test\TestComponent.cshtml) - div
HtmlContent - (5:0,5 [4] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (5:0,5 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
MarkupElement - (9:1,2 [103] x:\dir\subdir\Test\TestComponent.cshtml) - a
HtmlContent - (51:1,44 [57] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (51:1,44 [57] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Learn the ten cool tricks your compiler author will hate!
HtmlAttribute - (21:1,14 [6] x:\dir\subdir\Test\TestComponent.cshtml) - onclick=" - "
CSharpExpressionAttributeValue - -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.UIMouseEventArgs>(this,
IntermediateToken - - CSharp - "test()"
IntermediateToken - - CSharp - )
HtmlAttribute - - onclick=" - "
CSharpExpression - (40:1,33 [8] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (40:1,33 [8] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - () => {}
HtmlContent - (112:1,105 [2] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (112:1,105 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n

View File

@ -0,0 +1,32 @@
// <auto-generated/>
#pragma warning disable 1591
namespace Test
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 1998
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder)
{
builder.OpenElement(0, "div");
builder.AddMarkupContent(1, "\r\n ");
builder.OpenElement(2, "a");
builder.AddAttribute(3, "href", "/cool-url");
builder.AddAttribute(4, "style", true);
builder.AddAttribute(5, "disabled", true);
builder.AddAttribute(6, "href", "/even-cooler-url");
builder.AddAttribute(7, "href", true);
builder.AddContent(8, "Learn the ten cool tricks your compiler author will hate!");
builder.CloseElement();
builder.AddMarkupContent(9, "\r\n");
builder.CloseElement();
}
#pragma warning restore 1998
}
}
#pragma warning restore 1591

View File

@ -0,0 +1,2 @@
x:\dir\subdir\Test\TestComponent.cshtml(2,5): Error RZ10007: The attribute 'href' is used two or more times for this element. Attributes must be unique (case-insensitive).
x:\dir\subdir\Test\TestComponent.cshtml(2,40): Error RZ10007: The attribute 'href' is used two or more times for this element. Attributes must be unique (case-insensitive).

View File

@ -0,0 +1,26 @@
Document -
NamespaceDeclaration - - Test
UsingDirective - (3:1,1 [14] ) - System
UsingDirective - (18:2,1 [34] ) - System.Collections.Generic
UsingDirective - (53:3,1 [19] ) - System.Linq
UsingDirective - (73:4,1 [30] ) - System.Threading.Tasks
UsingDirective - (104:5,1 [39] ) - Microsoft.AspNetCore.Components
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
MethodDeclaration - - protected override - void - BuildRenderTree
MarkupElement - (0:0,0 [145] x:\dir\subdir\Test\TestComponent.cshtml) - div
HtmlContent - (5:0,5 [4] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (5:0,5 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
MarkupElement - (9:1,2 [128] x:\dir\subdir\Test\TestComponent.cshtml) - a
HtmlAttribute - (11:1,4 [17] x:\dir\subdir\Test\TestComponent.cshtml) - href=" - "
HtmlAttributeValue - (18:1,11 [9] x:\dir\subdir\Test\TestComponent.cshtml) -
IntermediateToken - (18:1,11 [9] x:\dir\subdir\Test\TestComponent.cshtml) - Html - /cool-url
HtmlAttribute - (28:1,21 [9] x:\dir\subdir\Test\TestComponent.cshtml) - style=" - "
HtmlAttribute - (37:1,30 [9] x:\dir\subdir\Test\TestComponent.cshtml) - disabled -
HtmlAttribute - (46:1,39 [24] x:\dir\subdir\Test\TestComponent.cshtml) - href=" - "
HtmlAttributeValue - (53:1,46 [16] x:\dir\subdir\Test\TestComponent.cshtml) -
IntermediateToken - (53:1,46 [16] x:\dir\subdir\Test\TestComponent.cshtml) - Html - /even-cooler-url
HtmlAttribute - (70:1,63 [5] x:\dir\subdir\Test\TestComponent.cshtml) - href -
HtmlContent - (76:1,69 [57] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (76:1,69 [57] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Learn the ten cool tricks your compiler author will hate!
HtmlContent - (137:1,130 [2] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (137:1,130 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n