Merge branch 'release/3.1' into merge/release/3.0-to-release/3.1\n\nCommit migrated from 7e480a52e3

This commit is contained in:
William Godbe 2019-11-22 11:12:31 -08:00 committed by GitHub
commit 9328e4723e
1419 changed files with 5322 additions and 3194 deletions

View File

@ -36,4 +36,4 @@
<Copy SourceFiles="@(MvcShim)" DestinationFolder="$(OutputPath)" />
</Target>
</Project>
</Project>

View File

@ -4,7 +4,7 @@
<TargetFrameworks>$(StandardTestTfms)</TargetFrameworks>
<PreserveCompilationContext>true</PreserveCompilationContext>
<DefaultItemExcludes>$(DefaultItemExcludes);TestFiles\**</DefaultItemExcludes>
<!-- Work around https://github.com/microsoft/msbuild/issues/4740 -->
<EmbeddedResourceUseDependentUponConvention>false</EmbeddedResourceUseDependentUponConvention>
</PropertyGroup>

View File

@ -8,7 +8,7 @@ namespace __GeneratedComponent
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class AspNetCore_d3c3d6059615673cb46fc4974164d61eabadb890 : Microsoft.AspNetCore.Components.ComponentBase, IDisposable
public partial class AspNetCore_d3c3d6059615673cb46fc4974164d61eabadb890 : Microsoft.AspNetCore.Components.ComponentBase, IDisposable
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {

View File

@ -5,7 +5,7 @@ Document -
UsingDirective - (51:2,1 [17] ) - System.Linq
UsingDirective - (71:3,1 [28] ) - System.Threading.Tasks
UsingDirective - (102:4,1 [37] ) - Microsoft.AspNetCore.Components
ClassDeclaration - - public - AspNetCore_d3c3d6059615673cb46fc4974164d61eabadb890 - Microsoft.AspNetCore.Components.ComponentBase - IDisposable
ClassDeclaration - - public partial - AspNetCore_d3c3d6059615673cb46fc4974164d61eabadb890 - Microsoft.AspNetCore.Components.ComponentBase - IDisposable
DesignTimeDirective -
DirectiveToken - (12:0,12 [11] BasicComponent.cshtml) - IDisposable
CSharpCode -

View File

@ -1,23 +1,23 @@
Source Location: (12:0,12 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicComponent.cshtml)
|IDisposable|
Generated Location: (641:17,0 [11] )
Generated Location: (649:17,0 [11] )
|IDisposable|
Source Location: (38:1,13 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicComponent.cshtml)
|this.ToString()|
Generated Location: (1240:35,13 [15] )
Generated Location: (1248:35,13 [15] )
|this.ToString()|
Source Location: (79:3,5 [29] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicComponent.cshtml)
|string.Format("{0}", "Hello")|
Generated Location: (1437:43,6 [29] )
Generated Location: (1445:43,6 [29] )
|string.Format("{0}", "Hello")|
Source Location: (132:6,12 [37] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicComponent.cshtml)
|
void IDisposable.Dispose(){ }
|
Generated Location: (1689:52,12 [37] )
Generated Location: (1697:52,12 [37] )
|
void IDisposable.Dispose(){ }
|

View File

@ -9,7 +9,7 @@ namespace __GeneratedComponent
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class AspNetCore_d3c3d6059615673cb46fc4974164d61eabadb890 : Microsoft.AspNetCore.Components.ComponentBase, IDisposable
public partial class AspNetCore_d3c3d6059615673cb46fc4974164d61eabadb890 : Microsoft.AspNetCore.Components.ComponentBase, IDisposable
{
#pragma warning disable 1998
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)

View File

@ -5,7 +5,7 @@ Document -
UsingDirective - (51:2,1 [19] ) - System.Linq
UsingDirective - (71:3,1 [30] ) - System.Threading.Tasks
UsingDirective - (102:4,1 [37] ) - Microsoft.AspNetCore.Components
ClassDeclaration - - public - AspNetCore_d3c3d6059615673cb46fc4974164d61eabadb890 - Microsoft.AspNetCore.Components.ComponentBase - IDisposable
ClassDeclaration - - public partial - AspNetCore_d3c3d6059615673cb46fc4974164d61eabadb890 - Microsoft.AspNetCore.Components.ComponentBase - IDisposable
MethodDeclaration - - protected override - void - BuildRenderTree
MarkupElement - (25:1,0 [91] BasicComponent.cshtml) - div
HtmlAttribute - (29:1,4 [25] BasicComponent.cshtml) - class=" - "

View File

@ -162,6 +162,12 @@
<data name="EventHandlerTagHelper_Documentation" xml:space="preserve">
<value>Sets the '{0}' attribute to the provided string or delegate value. A delegate value should be of type '{1}'.</value>
</data>
<data name="EventHandlerTagHelper_PreventDefault_Documentation" xml:space="preserve">
<value>Specifies whether to cancel (if cancelable) the default action that belongs to the '{0}' event.</value>
</data>
<data name="EventHandlerTagHelper_StopPropagation_Documentation" xml:space="preserve">
<value>Specifies whether to prevent further propagation of the '{0}' event in the capturing and bubbling phases.</value>
</data>
<data name="ImplementsDirective_Description" xml:space="preserve">
<value>Declares an interface implementation for the current class.</value>
</data>

View File

@ -275,6 +275,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
out var valueAttributeName,
out var changeAttributeName,
out var expressionAttributeName,
out var changeAttributeNode,
out var valueAttribute,
out var changeAttribute,
out var expressionAttribute))
@ -393,12 +394,13 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
[ComponentMetadata.Common.OriginalAttributeName] = node.OriginalAttributeName,
},
AttributeName = changeAttributeName,
AttributeNameExpression = changeAttributeNode,
Source = node.Source,
Prefix = changeAttributeName + "=\"",
Suffix = "\"",
EventUpdatesAttributeName = valueNode.AttributeName,
EventUpdatesAttributeName = valueAttributeName,
};
changeNode.Children.Add(new CSharpExpressionAttributeValueIntermediateNode());
@ -510,6 +512,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
out string valueAttributeName,
out string changeAttributeName,
out string expressionAttributeName,
out CSharpExpressionIntermediateNode changeAttributeNode,
out BoundAttributeDescriptor valueAttribute,
out BoundAttributeDescriptor changeAttribute,
out BoundAttributeDescriptor expressionAttribute)
@ -517,10 +520,20 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
valueAttributeName = null;
changeAttributeName = null;
expressionAttributeName = null;
changeAttributeNode = null;
valueAttribute = null;
changeAttribute = null;
expressionAttribute = null;
// The tag helper specifies attribute names, they should win.
//
// This handles cases like <input type="text" bind="@Foo" /> where the tag helper is
// generated to match a specific tag and has metadata that identify the attributes.
//
// We expect 1 bind tag helper per-node.
var node = bindEntry.BindNode;
var attributeName = node.AttributeName;
// Even though some of our 'bind' tag helpers specify the attribute names, they
// should still satisfy one of the valid syntaxes.
if (!TryParseBindAttribute(bindEntry, out valueAttributeName))
@ -528,24 +541,25 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
return false;
}
if (bindEntry.BindEventNode != null)
{
changeAttributeName = GetAttributeContent(bindEntry.BindEventNode)?.Content?.Trim('"');
}
// The tag helper specifies attribute names, they should win.
//
// This handles cases like <input type="text" bind="@Foo" /> where the tag helper is
// generated to match a specific tag and has metadata that identify the attributes.
//
// We expect 1 bind tag helper per-node.
var node = bindEntry.BindNode;
var attributeName = node.AttributeName;
valueAttributeName = node.TagHelper.GetValueAttributeName() ?? valueAttributeName;
// If there an attribute that specifies the event like @bind:event="oninput",
// that should be preferred. Otherwise, use the one from the tag helper.
changeAttributeName ??= node.TagHelper.GetChangeAttributeName();
if (bindEntry.BindEventNode == null)
{
// @bind:event not specified
changeAttributeName ??= node.TagHelper.GetChangeAttributeName();
}
else if (TryExtractEventNodeStaticText(bindEntry.BindEventNode, out var text))
{
// @bind:event="oninput" - change attribute is static
changeAttributeName = text;
}
else
{
// @bind:event="@someExpr" - we can't know the name of the change attribute, it's dynamic
changeAttributeNode = ExtractEventNodeExpression(bindEntry.BindEventNode);
}
expressionAttributeName = node.TagHelper.GetExpressionAttributeName();
@ -554,7 +568,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
if (componentTagHelper == null)
{
// If it's not a component node then there isn't too much else to figure out.
return attributeName != null && changeAttributeName != null;
return attributeName != null && (changeAttributeName != null || changeAttributeNode != null);
}
// If this is a component, we need an attribute name for the value.
@ -597,6 +611,28 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
}
return true;
static bool TryExtractEventNodeStaticText(TagHelperDirectiveAttributeParameterIntermediateNode node, out string text)
{
if (node.Children[0] is HtmlContentIntermediateNode html)
{
text = GetAttributeContent(html).Content;
return true;
}
text = null;
return false;
}
static CSharpExpressionIntermediateNode ExtractEventNodeExpression(TagHelperDirectiveAttributeParameterIntermediateNode node)
{
if (node.Children[0] is CSharpExpressionIntermediateNode expression)
{
return expression;
}
return null;
}
}
private void RewriteNodesForComponentDelegateBind(

View File

@ -85,6 +85,11 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
throw new ArgumentNullException(nameof(node));
}
WriteCSharpExpressionInnards(context, node);
}
private void WriteCSharpExpressionInnards(CodeRenderingContext context, CSharpExpressionIntermediateNode node, string type = null)
{
if (node.Children.Count == 0)
{
return;
@ -95,9 +100,22 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
using (context.CodeWriter.BuildLinePragma(node.Source.Value, context))
{
var offset = DesignTimeVariable.Length + " = ".Length;
if (type != null)
{
offset += type.Length + 2; // two parenthesis
}
context.CodeWriter.WritePadding(offset, node.Source, context);
context.CodeWriter.WriteStartAssignment(DesignTimeVariable);
if (type != null)
{
context.CodeWriter.Write("(");
context.CodeWriter.Write(type);
context.CodeWriter.Write(")");
}
for (var i = 0; i < node.Children.Count; i++)
{
if (node.Children[i] is IntermediateToken token && token.IsCSharp)
@ -209,6 +227,13 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
throw new ArgumentNullException(nameof(node));
}
// This expression may contain code so we have to render it or else the design-time
// exprience is broken.
if (node.AttributeNameExpression is CSharpExpressionIntermediateNode expression)
{
WriteCSharpExpressionInnards(context, expression, "string");
}
context.RenderChildren(node);
}
@ -275,11 +300,11 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
// Do nothing
}
protected override void BeginWriteAttribute(CodeWriter codeWriter, string key)
protected override void BeginWriteAttribute(CodeRenderingContext context, string key)
{
if (codeWriter == null)
if (context == null)
{
throw new ArgumentNullException(nameof(codeWriter));
throw new ArgumentNullException(nameof(context));
}
if (key == null)
@ -287,7 +312,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
throw new ArgumentNullException(nameof(key));
}
codeWriter
context.CodeWriter
.WriteStartMethodInvocation($"{_scopeStack.BuilderVarName}.{nameof(ComponentsApi.RenderTreeBuilder.AddAttribute)}")
.Write("-1")
.WriteParameterSeparator()
@ -295,6 +320,31 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
.WriteParameterSeparator();
}
protected override void BeginWriteAttribute(CodeRenderingContext context, IntermediateNode expression)
{
if (context == null)
{
throw new ArgumentNullException(nameof(context));
}
if (expression == null)
{
throw new ArgumentNullException(nameof(expression));
}
context.CodeWriter.WriteStartMethodInvocation($"{_scopeStack.BuilderVarName}.{ComponentsApi.RenderTreeBuilder.AddAttribute}");
context.CodeWriter.Write("-1");
context.CodeWriter.WriteParameterSeparator();
var tokens = GetCSharpTokens(expression);
for (var i = 0; i < tokens.Count; i++)
{
context.CodeWriter.Write(tokens[i].Content);
}
context.CodeWriter.WriteParameterSeparator();
}
public override void WriteComponent(CodeRenderingContext context, ComponentIntermediateNode node)
{
if (context == null)
@ -650,10 +700,11 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
}
}
bool NeedsTypeCheck(ComponentAttributeIntermediateNode n)
static bool NeedsTypeCheck(ComponentAttributeIntermediateNode n)
{
return n.BoundAttribute != null && !n.BoundAttribute.IsWeaklyTyped();
}
// Weakly typed attributes will have their TypeName set to null.
return n.BoundAttribute != null && n.TypeName != null;
}
}
private IReadOnlyList<IntermediateToken> GetCSharpTokens(IntermediateNode node)
@ -679,7 +730,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
// __builder.AddAttribute(1, "ChildContent", (RenderFragment)((__builder73) => { ... }));
// OR
// __builder.AddAttribute(1, "ChildContent", (RenderFragment<Person>)((person) => (__builder73) => { ... }));
BeginWriteAttribute(context.CodeWriter, node.AttributeName);
BeginWriteAttribute(context, node.AttributeName);
context.CodeWriter.Write($"({node.TypeName})(");
WriteComponentChildContentInnards(context, node);

View File

@ -149,7 +149,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
public static readonly RazorDiagnosticDescriptor EventHandler_Duplicates =
new RazorDiagnosticDescriptor(
$"{DiagnosticPrefix}9990",
() => "The attribute '{0}' was matched by multiple event handlers attributes. Duplicates:{1}",
() => "The attribute '{0}' was matched by multiple event handler attributes. Duplicates:{1}",
RazorDiagnosticSeverity.Error);
public static RazorDiagnostic CreateEventHandler_Duplicates(SourceSpan? source, string attribute, TagHelperDirectiveAttributeIntermediateNode[] attributes)
@ -438,5 +438,21 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
startTagName,
endTagName);
}
public static readonly RazorDiagnosticDescriptor EventHandlerParameter_Duplicates =
new RazorDiagnosticDescriptor(
$"{DiagnosticPrefix}10014",
() => "The attribute '{0}' was matched by multiple event handlers parameter attributes. Duplicates:{1}",
RazorDiagnosticSeverity.Error);
public static RazorDiagnostic CreateEventHandlerParameter_Duplicates(SourceSpan? source, string attribute, TagHelperDirectiveAttributeParameterIntermediateNode[] attributes)
{
var diagnostic = RazorDiagnostic.Create(
EventHandlerParameter_Duplicates,
source ?? SourceSpan.Undefined,
attribute,
Environment.NewLine + string.Join(Environment.NewLine, attributes.Select(p => p.TagHelper.DisplayName)));
return diagnostic;
}
}
}

View File

@ -81,6 +81,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
@class.ClassName = computedClass;
@class.Modifiers.Clear();
@class.Modifiers.Add("public");
@class.Modifiers.Add("partial");
if (FileKinds.IsComponentImport(codeDocument.GetFileKind()))
{

View File

@ -1,6 +1,7 @@
// 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.Extensions;
@ -31,13 +32,19 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
// Each usage will be represented by a tag helper property that is a descendant of either
// a component or element.
var references = documentNode.FindDescendantReferences<TagHelperDirectiveAttributeIntermediateNode>();
var parents = new HashSet<IntermediateNode>();
for (var i = 0; i < references.Count; i++)
{
parents.Add(references[i].Parent);
}
// We need to do something similar for directive attribute parameters like @onclick:preventDefault.
var parameterReferences = documentNode.FindDescendantReferences<TagHelperDirectiveAttributeParameterIntermediateNode>();
for (var i = 0; i < parameterReferences.Count; i++)
{
parents.Add(parameterReferences[i].Parent);
}
foreach (var parent in parents)
{
ProcessDuplicates(parent);
@ -59,6 +66,23 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
reference.Replace(RewriteUsage(reference.Parent, node));
}
}
for (var i = 0; i < parameterReferences.Count; i++)
{
var reference = parameterReferences[i];
var node = (TagHelperDirectiveAttributeParameterIntermediateNode)reference.Node;
if (!reference.Parent.Children.Contains(node))
{
// This node was removed as a duplicate, skip it.
continue;
}
if (node.TagHelper.IsEventHandlerTagHelper())
{
reference.Replace(RewriteParameterUsage(reference.Parent, node));
}
}
}
private void ProcessDuplicates(IntermediateNode parent)
@ -109,6 +133,24 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
parent.Children.Remove(property);
}
}
var parameterDuplicates = parent.Children
.OfType<TagHelperDirectiveAttributeParameterIntermediateNode>()
.Where(p => p.TagHelper?.IsEventHandlerTagHelper() ?? false)
.GroupBy(p => p.AttributeName)
.Where(g => g.Count() > 1);
foreach (var duplicate in parameterDuplicates)
{
parent.Diagnostics.Add(ComponentDiagnosticFactory.CreateEventHandlerParameter_Duplicates(
parent.Source,
duplicate.Key,
duplicate.ToArray()));
foreach (var property in duplicate)
{
parent.Children.Remove(property);
}
}
}
private IntermediateNode RewriteUsage(IntermediateNode parent, TagHelperDirectiveAttributeIntermediateNode node)
@ -198,7 +240,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
}
}
private static IReadOnlyList<IntermediateToken> GetAttributeContent(TagHelperDirectiveAttributeIntermediateNode node)
private static IReadOnlyList<IntermediateToken> GetAttributeContent(IntermediateNode node)
{
var template = node.FindDescendantNodes<TemplateIntermediateNode>().FirstOrDefault();
if (template != null)
@ -222,5 +264,49 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
return node.FindDescendantNodes<IntermediateToken>();
}
}
private IntermediateNode RewriteParameterUsage(IntermediateNode parent, TagHelperDirectiveAttributeParameterIntermediateNode node)
{
// Now rewrite the node to look like:
//
// builder.AddEventPreventDefaultAttribute(2, "onclick", true); // If minimized.
// or
// builder.AddEventPreventDefaultAttribute(2, "onclick", someBoolExpression); // If a bool expression is provided in the value.
string eventHandlerMethod;
if (node.BoundAttributeParameter.Name == "preventDefault")
{
eventHandlerMethod = ComponentsApi.RenderTreeBuilder.AddEventPreventDefaultAttribute;
}
else if (node.BoundAttributeParameter.Name == "stopPropagation")
{
eventHandlerMethod = ComponentsApi.RenderTreeBuilder.AddEventStopPropagationAttribute;
}
else
{
// Unsupported event handler attribute parameter. This can only happen if bound attribute descriptor
// is configured to expect a parameter other than 'preventDefault' and 'stopPropagation'.
return node;
}
var result = new ComponentAttributeIntermediateNode(node)
{
Annotations =
{
[ComponentMetadata.Common.OriginalAttributeName] = node.OriginalAttributeName,
[ComponentMetadata.Common.AddAttributeMethodName] = eventHandlerMethod,
},
};
result.Children.Clear();
if (node.AttributeStructure != AttributeStructure.Minimized)
{
var tokens = GetAttributeContent(node);
result.Children.Add(new CSharpExpressionIntermediateNode());
result.Children[0].Children.AddRange(tokens);
}
return result;
}
}
}

View File

@ -34,7 +34,13 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
{
var reference = references[i];
var node = (TagHelperIntermediateNode)reference.Node;
if (node.TagHelpers.Any(t => t.IsChildContentTagHelper()))
{
// This is a child content tag helper. This will be rewritten when we visit its parent.
continue;
}
// The element didn't match any child content descriptors. Look for any matching component descriptors.
var count = 0;
for (var j = 0; j < node.TagHelpers.Count; j++)
{
@ -42,7 +48,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
{
// Only allow a single component tag helper per element. If there are multiple, we'll just consider
// the first one and ignore the others.
if (count++ > 1)
if (++count > 1)
{
node.Diagnostics.Add(ComponentDiagnosticFactory.Create_MultipleComponents(node.Source, node.TagName, node.TagHelpers));
break;
@ -54,10 +60,6 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
{
reference.Replace(RewriteAsComponent(node, node.TagHelpers.First(t => t.IsComponentTagHelper())));
}
else if (node.TagHelpers.Any(t => t.IsChildContentTagHelper()))
{
// Ignore, this will be handled when we rewrite the parent.
}
else
{
reference.Replace(RewriteAsElement(node));

View File

@ -42,6 +42,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
public static readonly string OriginalAttributeName = "Common.OriginalAttributeName";
public static readonly string DirectiveAttribute = "Common.DirectiveAttribute";
public static readonly string AddAttributeMethodName = "Common.AddAttributeMethodName";
}
public static class Bind

View File

@ -12,7 +12,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
{
internal abstract class ComponentNodeWriter : IntermediateNodeWriter, ITemplateTargetExtension
{
protected abstract void BeginWriteAttribute(CodeWriter codeWriter, string key);
protected abstract void BeginWriteAttribute(CodeRenderingContext context, string key);
protected abstract void BeginWriteAttribute(CodeRenderingContext context, IntermediateNode expression);
protected abstract void WriteReferenceCaptureInnards(CodeRenderingContext context, ReferenceCaptureIntermediateNode node, bool shouldTypeCheck);

View File

@ -191,6 +191,10 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
{
context.RenderNode(attribute);
}
else if (child is ComponentAttributeIntermediateNode componentAttribute)
{
context.RenderNode(componentAttribute);
}
else if (child is SplatIntermediateNode splat)
{
context.RenderNode(splat);
@ -233,7 +237,14 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
Debug.Assert(_currentAttributeValues.Count == 0);
context.RenderChildren(node);
WriteAttribute(context, node.AttributeName, _currentAttributeValues);
if (node.AttributeNameExpression == null)
{
WriteAttribute(context, node.AttributeName, _currentAttributeValues);
}
else
{
WriteAttribute(context, node.AttributeNameExpression, _currentAttributeValues);
}
_currentAttributeValues.Clear();
if (!string.IsNullOrEmpty(node.EventUpdatesAttributeName))
@ -502,10 +513,12 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
throw new ArgumentNullException(nameof(node));
}
var addAttributeMethod = node.Annotations[ComponentMetadata.Common.AddAttributeMethodName] as string ?? ComponentsApi.RenderTreeBuilder.AddAttribute;
// _builder.AddAttribute(1, "Foo", 42);
context.CodeWriter.Write(_scopeStack.BuilderVarName);
context.CodeWriter.Write(".");
context.CodeWriter.Write(ComponentsApi.RenderTreeBuilder.AddAttribute);
context.CodeWriter.Write(addAttributeMethod);
context.CodeWriter.Write("(");
context.CodeWriter.Write((_sourceSequence++).ToString());
context.CodeWriter.Write(", ");
@ -659,7 +672,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
// _builder.AddAttribute(1, "ChildContent", (RenderFragment)((__builder73) => { ... }));
// OR
// _builder.AddAttribute(1, "ChildContent", (RenderFragment<Person>)((person) => (__builder73) => { ... }));
BeginWriteAttribute(context.CodeWriter, node.AttributeName);
BeginWriteAttribute(context, node.AttributeName);
context.CodeWriter.Write($"({node.TypeName})(");
WriteComponentChildContentInnards(context, node);
@ -837,14 +850,21 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
private void WriteAttribute(CodeRenderingContext context, string key, IList<IntermediateToken> value)
{
BeginWriteAttribute(context.CodeWriter, key);
BeginWriteAttribute(context, key);
WriteAttributeValue(context, value);
context.CodeWriter.WriteEndMethodInvocation();
}
protected override void BeginWriteAttribute(CodeWriter codeWriter, string key)
private void WriteAttribute(CodeRenderingContext context, IntermediateNode nameExpression, IList<IntermediateToken> value)
{
codeWriter
BeginWriteAttribute(context, nameExpression);
WriteAttributeValue(context, value);
context.CodeWriter.WriteEndMethodInvocation();
}
protected override void BeginWriteAttribute(CodeRenderingContext context, string key)
{
context.CodeWriter
.WriteStartMethodInvocation($"{_scopeStack.BuilderVarName}.{ComponentsApi.RenderTreeBuilder.AddAttribute}")
.Write((_sourceSequence++).ToString())
.WriteParameterSeparator()
@ -852,6 +872,21 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
.WriteParameterSeparator();
}
protected override void BeginWriteAttribute(CodeRenderingContext context, IntermediateNode nameExpression)
{
context.CodeWriter.WriteStartMethodInvocation($"{_scopeStack.BuilderVarName}.{ComponentsApi.RenderTreeBuilder.AddAttribute}");
context.CodeWriter.Write((_sourceSequence++).ToString());
context.CodeWriter.WriteParameterSeparator();
var tokens = GetCSharpTokens(nameExpression);
for (var i = 0; i < tokens.Count; i++)
{
WriteCSharpToken(context, tokens[i]);
}
context.CodeWriter.WriteParameterSeparator();
}
private static string GetHtmlContent(HtmlContentIntermediateNode node)
{
var builder = new StringBuilder();

View File

@ -97,6 +97,10 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
public static readonly string SetKey = nameof(SetKey);
public static readonly string SetUpdatesAttributeName = nameof(SetUpdatesAttributeName);
public static readonly string AddEventPreventDefaultAttribute = nameof(AddEventPreventDefaultAttribute);
public static readonly string AddEventStopPropagationAttribute = nameof(AddEventStopPropagationAttribute);
}
public static class RuntimeHelpers

View File

@ -1099,8 +1099,6 @@ namespace Microsoft.AspNetCore.Razor.Language
if (node.Source != null)
{
Debug.Assert(node.Source.Value.FilePath != null);
node.Source = new SourceSpan(
node.Source.Value.FilePath,
node.Source.Value.AbsoluteIndex,

View File

@ -88,6 +88,32 @@ namespace Microsoft.AspNetCore.Razor.Language.Intermediate
}
}
public ComponentAttributeIntermediateNode(TagHelperDirectiveAttributeParameterIntermediateNode directiveAttributeParameterNode)
{
if (directiveAttributeParameterNode == null)
{
throw new ArgumentNullException(nameof(directiveAttributeParameterNode));
}
AttributeName = directiveAttributeParameterNode.AttributeNameWithoutParameter;
AttributeStructure = directiveAttributeParameterNode.AttributeStructure;
BoundAttribute = directiveAttributeParameterNode.BoundAttribute;
PropertyName = directiveAttributeParameterNode.BoundAttributeParameter.GetPropertyName();
Source = directiveAttributeParameterNode.Source;
TagHelper = directiveAttributeParameterNode.TagHelper;
TypeName = directiveAttributeParameterNode.BoundAttributeParameter.TypeName;
for (var i = 0; i < directiveAttributeParameterNode.Children.Count; i++)
{
Children.Add(directiveAttributeParameterNode.Children[i]);
}
for (var i = 0; i < directiveAttributeParameterNode.Diagnostics.Count; i++)
{
Diagnostics.Add(directiveAttributeParameterNode.Diagnostics[i]);
}
}
public override IntermediateNodeCollection Children { get; } = new IntermediateNodeCollection();
public string AttributeName { get; set; }

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;
using System.Linq;
namespace Microsoft.AspNetCore.Razor.Language.Intermediate
{
@ -9,6 +10,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Intermediate
{
public override IntermediateNodeCollection Children { get; } = new IntermediateNodeCollection();
public CSharpExpressionIntermediateNode AttributeNameExpression { get; set; }
public string AttributeName { get; set; }
public string Prefix { get; set; }
@ -32,6 +35,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Intermediate
formatter.WriteContent(AttributeName);
formatter.WriteProperty(nameof(AttributeName), AttributeName);
formatter.WriteProperty(nameof(AttributeNameExpression), string.Join(string.Empty, AttributeNameExpression?.FindDescendantNodes<IntermediateToken>().Select(n => n.Content) ?? Array.Empty<string>()));
formatter.WriteProperty(nameof(Prefix), Prefix);
formatter.WriteProperty(nameof(Suffix), Suffix);
formatter.WriteProperty(nameof(EventUpdatesAttributeName), EventUpdatesAttributeName);

View File

@ -19,6 +19,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Intermediate
public IEnumerable<IntermediateNode> Body => Children.Where(c =>
{
return
c as ComponentAttributeIntermediateNode == null &&
c as HtmlAttributeIntermediateNode == null &&
c as SplatIntermediateNode == null &&
c as SetKeyIntermediateNode == null &&

View File

@ -1149,8 +1149,6 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
var nameContent = string.Concat(name.LiteralTokens.Nodes.Select(s => s.Content));
if (IsConditionalAttributeName(nameContent))
{
SpanContext.ChunkGenerator = SpanChunkGenerator.Null; // The block chunk generator will render the prefix
// We now have the value prefix which is usually whitespace and/or a quote
valuePrefix = OutputAsMarkupLiteral();
@ -1178,8 +1176,6 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
if (quote != SyntaxKind.Marker && At(quote))
{
AcceptAndMoveNext();
// Again, block chunk generator will render the suffix
SpanContext.ChunkGenerator = SpanChunkGenerator.Null;
valueSuffix = OutputAsMarkupLiteral();
}
}

View File

@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Razor.Language.Components;
using Microsoft.AspNetCore.Razor.Language.Syntax;
namespace Microsoft.AspNetCore.Razor.Language.Legacy
@ -11,11 +12,11 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
internal static class TagHelperBlockRewriter
{
public static TagMode GetTagMode(
MarkupStartTagSyntax tagBlock,
TagHelperBinding bindingResult,
ErrorSink errorSink)
MarkupStartTagSyntax startTag,
MarkupEndTagSyntax endTag,
TagHelperBinding bindingResult)
{
var childSpan = tagBlock.GetLastToken()?.Parent;
var childSpan = startTag.GetLastToken()?.Parent;
// Self-closing tags are always valid despite descriptors[X].TagStructure.
if (childSpan?.GetContent().EndsWith("/>", StringComparison.Ordinal) ?? false)
@ -23,6 +24,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
return TagMode.SelfClosing;
}
var hasDirectiveAttribute = false;
foreach (var descriptor in bindingResult.Descriptors)
{
var boundRules = bindingResult.Mappings[descriptor];
@ -32,6 +34,21 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
{
return TagMode.StartTagOnly;
}
// Directive attribute will tolerate forms that don't work for tag helpers. For instance:
//
// <input @onclick="..."> vs <input onclick="..." />
//
// We don't want this to become an error just because you added a directive attribute.
if (descriptor.IsAnyComponentDocumentTagHelper() && !descriptor.IsComponentOrChildContentTagHelper())
{
hasDirectiveAttribute = true;
}
}
if (hasDirectiveAttribute && startTag.IsVoidElement() && endTag == null)
{
return TagMode.StartTagOnly;
}
return TagMode.StartTagAndEndTag;

View File

@ -104,7 +104,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
if (startTag != null)
{
var tagName = startTag.GetTagNameWithOptionalBang();
if (TryRewriteTagHelperStart(startTag, out tagHelperStart, out tagHelperInfo))
if (TryRewriteTagHelperStart(startTag, node.EndTag, out tagHelperStart, out tagHelperInfo))
{
// This is a tag helper.
if (tagHelperInfo.TagMode == TagMode.SelfClosing || tagHelperInfo.TagMode == TagMode.StartTagOnly)
@ -215,7 +215,11 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
return base.VisitMarkupTextLiteral(node);
}
private bool TryRewriteTagHelperStart(MarkupStartTagSyntax startTag, out MarkupTagHelperStartTagSyntax rewritten, out TagHelperInfo tagHelperInfo)
private bool TryRewriteTagHelperStart(
MarkupStartTagSyntax startTag,
MarkupEndTagSyntax endTag,
out MarkupTagHelperStartTagSyntax rewritten,
out TagHelperInfo tagHelperInfo)
{
rewritten = null;
tagHelperInfo = null;
@ -278,7 +282,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
_errorSink,
_source);
var tagMode = TagHelperBlockRewriter.GetTagMode(startTag, tagHelperBinding, _errorSink);
var tagMode = TagHelperBlockRewriter.GetTagMode(startTag, endTag, tagHelperBinding);
tagHelperInfo = new TagHelperInfo(tagName, tagMode, tagHelperBinding);
rewritten = rewrittenStartTag;

View File

@ -85,7 +85,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
// Assert
Assert.Equal($"{ComponentsApi.ComponentBase.FullTypeName}", visitor.Class.BaseType);
Assert.Equal(new[] { "public", }, visitor.Class.Modifiers);
Assert.Equal(new[] { "public", "partial" }, visitor.Class.Modifiers);
Assert.Equal("Test", visitor.Class.ClassName);
}

View File

@ -184,7 +184,7 @@ namespace Test
// Act
var generated = CompileToCSharp(@"
<MyComponent
<MyComponent
IntProperty=""123""
BoolProperty=""true""
StringProperty=""My string""
@ -317,7 +317,7 @@ namespace Test
// Act
var generated = CompileToCSharp(@"
@{
@{
var myValue = ""Expression value"";
}
<elem data-abc=""Literal value"" data-def=""@myValue"" />");
@ -335,7 +335,7 @@ namespace Test
// Act
var generated = CompileToCSharp(@"
@{
@{
var myValue = ""Expression value"";
}
<elem data-abc=""Literal value"" data-def=""@(myValue)"" />");
@ -353,7 +353,7 @@ namespace Test
// Act
var generated = CompileToCSharp(@"
@{
@{
var myValue = ""Expression value"";
}
<div>@myValue <!-- @myValue --> </div>");
@ -471,7 +471,7 @@ namespace Test
var generated = CompileToCSharp(@"
<InputText @bind-Value=""person.Name"" />
@functions
@functions
{
Person person = new Person();
}");
@ -896,6 +896,37 @@ namespace Test
CompileToAssembly(generated);
}
[Fact]
public void BindToElement_WithoutCloseTag()
{
// Arrange
AdditionalSyntaxTrees.Add(Parse(@"
using System;
using Microsoft.AspNetCore.Components;
namespace Test
{
[BindElement(""div"", null, ""myvalue"", ""myevent"")]
public static class BindAttributes
{
}
}"));
// Act
var generated = CompileToCSharp(@"
<div>
<input @bind=""@ParentValue"">
</div>
@code {
public string ParentValue { get; set; } = ""hi"";
}");
// Assert
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
CompileToAssembly(generated);
}
[Fact]
public void BindToElement_WithStringAttribute_WritesAttributes()
{
@ -980,6 +1011,64 @@ namespace Test
CompileToAssembly(generated);
}
[Fact]
public void BindToElement_WithEventAsExpression()
{
// Arrange
AdditionalSyntaxTrees.Add(Parse(@"
using System;
using Microsoft.AspNetCore.Components;
namespace Test
{
[BindElement(""div"", ""value"", ""myvalue"", ""myevent"")]
public static class BindAttributes
{
}
}"));
// Act
var generated = CompileToCSharp(@"
@{ var x = ""anotherevent""; }
<div @bind-value=""@ParentValue"" @bind-value:event=""@x"" />
@code {
public string ParentValue { get; set; } = ""hi"";
}");
// Assert
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
CompileToAssembly(generated);
}
[Fact]
public void BindToElement_WithEventAsExplicitExpression()
{
// Arrange
AdditionalSyntaxTrees.Add(Parse(@"
using System;
using Microsoft.AspNetCore.Components;
namespace Test
{
[BindElement(""div"", ""value"", ""myvalue"", ""myevent"")]
public static class BindAttributes
{
}
}"));
// Act
var generated = CompileToCSharp(@"
@{ var x = ""anotherevent""; }
<div @bind-value=""@ParentValue"" @bind-value:event=""@(x.ToString())"" />
@code {
public string ParentValue { get; set; } = ""hi"";
}");
// Assert
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
CompileToAssembly(generated);
}
[Fact]
public void BuiltIn_BindToInputWithoutType_WritesAttributes()
{
@ -1698,6 +1787,44 @@ namespace Test
CompileToAssembly(generated);
}
[Fact]
public void MultipleChildContentMatchingComponentName()
{
// Arrange
AdditionalSyntaxTrees.Add(Parse(@"
using Microsoft.AspNetCore.Components;
namespace Test
{
public class MyComponent : ComponentBase
{
[Parameter]
public RenderFragment Header { get; set; }
[Parameter]
public RenderFragment Footer { get; set; }
}
public class Header : ComponentBase
{
}
}
"));
// Act
var generated = CompileToCSharp(@"
<MyComponent>
<Header>Hi!</Header>
<Footer>Bye!</Footer>
</MyComponent>
<Header>Hello!</Header>");
// Assert
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
CompileToAssembly(generated);
}
#endregion
#region Directives
@ -1804,7 +1931,7 @@ namespace Test3
// Assert
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
var result = CompileToAssembly(generated, throwOnFailure: !DesignTime);
var result = CompileToAssembly(generated, throwOnFailure: false);
if (DesignTime)
{
@ -2570,6 +2697,28 @@ namespace Test
CompileToAssembly(generated);
}
[Fact]
public void EventHandler_OnElement_WithoutCloseTag()
{
// Arrange
// Act
var generated = CompileToCSharp(@"
@using Microsoft.AspNetCore.Components.Web
<div>
<input @onclick=""OnClick"">
</div>
@code {
void OnClick() {
}
}");
// Assert
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
CompileToAssembly(generated);
}
[Fact]
public void EventHandler_OnElement_WithEventArgsMethodGroup()
{
@ -2621,7 +2770,7 @@ namespace Test
@using Microsoft.AspNetCore.Components.Web
<input @onclick=""OnClick"" />
@code {
Task OnClick()
Task OnClick()
{
return Task.CompletedTask;
}
@ -2644,7 +2793,7 @@ namespace Test
@using Microsoft.AspNetCore.Components.Web
<input @onclick=""OnClick"" />
@code {
Task OnClick(MouseEventArgs e)
Task OnClick(MouseEventArgs e)
{
return Task.CompletedTask;
}
@ -2699,6 +2848,7 @@ namespace Test
// Act
var generated = CompileToCSharp(@"
@using Microsoft.AspNetCore.Components.Web
<input @onclick=""x => { }"" />");
// Assert
@ -2747,6 +2897,78 @@ namespace Test
CompileToAssembly(generated);
}
[Fact]
public void EventHandler_PreventDefault_StopPropagation_Minimized()
{
// Arrange
// Act
var generated = CompileToCSharp(@"
@using Microsoft.AspNetCore.Components.Web
<button @onclick:preventDefault @onclick:stopPropagation>Click Me</button>");
// Assert
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
CompileToAssembly(generated);
}
[Fact]
public void EventHandler_PreventDefault_StopPropagation()
{
// Arrange
// Act
var generated = CompileToCSharp(@"
@using Microsoft.AspNetCore.Components.Web
<button @onclick=""() => Foo = false"" @onfocus:preventDefault=""true"" @onclick:stopPropagation=""Foo"" @onfocus:stopPropagation=""false"">Click Me</button>
@code {
bool Foo { get; set; }
}");
// Assert
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
CompileToAssembly(generated);
}
[Fact]
public void EventHandler_WithDelegate_PreventDefault()
{
// Arrange
// Act
var generated = CompileToCSharp(@"
@using Microsoft.AspNetCore.Components.Web
<input @onfocus=""OnFocus"" @onfocus:preventDefault=""ShouldPreventDefault()"" />
@code {
void OnFocus(FocusEventArgs e) { }
bool ShouldPreventDefault() { return false; }
}");
// Assert
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
CompileToAssembly(generated);
}
[Fact]
public void EventHandler_PreventDefault_Duplicates()
{
// Arrange
// Act
var generated = CompileToCSharp(@"
@using Microsoft.AspNetCore.Components.Web
<input @onclick:preventDefault=""true"" @onclick:preventDefault />");
// Assert
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
CompileToAssembly(generated);
}
#endregion
#region Generics
@ -4262,7 +4484,7 @@ namespace Test
{
// Arrange/Act
var generated = CompileToCSharp(@"
@(""My value"")
<h1>Hello</h1>");

View File

@ -121,7 +121,7 @@ namespace Test
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 1998
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)

View File

@ -233,6 +233,57 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
EvaluateData(descriptors, "<input></input>");
}
[Fact]
public void AllowsCompatibleTagStructures_DirectiveAttribute_SelfClosing()
{
// Arrange
var descriptors = new TagHelperDescriptor[]
{
TagHelperDescriptorBuilder.Create("InputTagHelper1", "SomeAssembly")
.TagMatchingRuleDescriptor(rule =>
{
rule
.RequireTagName("*")
.RequireAttributeDescriptor(b =>
{
b.Name = "@onclick";
b.Metadata.Add(ComponentMetadata.Common.DirectiveAttribute, bool.TrueString);
});
})
.AddMetadata(ComponentMetadata.SpecialKindKey, ComponentMetadata.EventHandler.TagHelperKind)
.Build(),
};
// Act & Assert
EvaluateData(descriptors, "<input @onclick=\"@test\"/>");
}
[Fact]
public void AllowsCompatibleTagStructures_DirectiveAttribute_Void()
{
// Arrange
var descriptors = new TagHelperDescriptor[]
{
TagHelperDescriptorBuilder.Create("InputTagHelper1", "SomeAssembly")
.TagMatchingRuleDescriptor(rule =>
{
rule
.RequireTagName("*")
.RequireAttributeDescriptor(b =>
{
b.Name = "@onclick";
b.Metadata.Add(ComponentMetadata.Common.DirectiveAttribute, bool.TrueString);
});
})
.AddMetadata(ComponentMetadata.SpecialKindKey, ComponentMetadata.EventHandler.TagHelperKind)
.Build(),
};
// Act & Assert
EvaluateData(descriptors, "<input @onclick=\"@test\">");
}
[Fact]
public void CreatesErrorForMalformedTagHelpersWithAttributes1()
{

View File

@ -2,4 +2,8 @@
<script type="text/javascript" @{} ></script @foo >
}
<script type="text/html">
<%var x = window == null%>
</script>
<script></script @

View File

@ -1 +1 @@
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags.cshtml(5,11): Error RZ1024: End of file or an unexpected character was reached before the "script" tag could be parsed. Elements inside markup blocks must be complete. They must either be self-closing ("<br />") or have matching end tags ("<p>Hello</p>"). If you intended to display a "<" character, use the "&lt;" HTML entity.
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags.cshtml(9,11): Error RZ1024: End of file or an unexpected character was reached before the "script" tag could be parsed. Elements inside markup blocks must be complete. They must either be self-closing ("<br />") or have matching end tags ("<p>Hello</p>"). If you intended to display a "<" character, use the "&lt;" HTML entity.

View File

@ -23,8 +23,21 @@ Document -
IntermediateToken - (44:1,40 [15] Tags.cshtml) - Html - </script @foo >
CSharpCode - (59:1,55 [2] Tags.cshtml)
IntermediateToken - (59:1,55 [2] Tags.cshtml) - CSharp - \n
HtmlContent - (64:3,0 [20] Tags.cshtml)
HtmlContent - (64:3,0 [38] Tags.cshtml)
IntermediateToken - (64:3,0 [2] Tags.cshtml) - Html - \n
IntermediateToken - (66:4,0 [7] Tags.cshtml) - Html - <script
IntermediateToken - (73:4,7 [1] Tags.cshtml) - Html - >
IntermediateToken - (74:4,8 [10] Tags.cshtml) - Html - </script @
IntermediateToken - (73:4,7 [17] Tags.cshtml) - Html - type="text/html"
IntermediateToken - (90:4,24 [1] Tags.cshtml) - Html - >
IntermediateToken - (91:4,25 [6] Tags.cshtml) - Html - \n
IntermediateToken - (97:5,4 [5] Tags.cshtml) - Html - <%var
HtmlAttribute - (102:5,9 [4] Tags.cshtml) - x = -
HtmlAttribute - (106:5,13 [9] Tags.cshtml) - window = -
HtmlContent - (115:5,22 [41] Tags.cshtml)
IntermediateToken - (115:5,22 [7] Tags.cshtml) - Html - = null%
IntermediateToken - (122:5,29 [1] Tags.cshtml) - Html - >
IntermediateToken - (123:5,30 [2] Tags.cshtml) - Html - \n
IntermediateToken - (125:6,0 [9] Tags.cshtml) - Html - </script>
IntermediateToken - (134:6,9 [4] Tags.cshtml) - Html - \n\n
IntermediateToken - (138:8,0 [7] Tags.cshtml) - Html - <script
IntermediateToken - (145:8,7 [1] Tags.cshtml) - Html - >
IntermediateToken - (146:8,8 [10] Tags.cshtml) - Html - </script @

View File

@ -1,11 +1,11 @@
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "42fb758ed87c3709cfb3f3aeff7a9cf8d242b74c"
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "75edd5542ddb6f78ab6a4d309bb3525a99ecfa55"
// <auto-generated/>
#pragma warning disable 1591
[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Tags_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags.cshtml")]
namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles
{
#line hidden
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"42fb758ed87c3709cfb3f3aeff7a9cf8d242b74c", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"75edd5542ddb6f78ab6a4d309bb3525a99ecfa55", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags.cshtml")]
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Tags_Runtime
{
#pragma warning disable 1998
@ -13,7 +13,12 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles
{
WriteLiteral(" <script type=\"text/javascript\" ");
WriteLiteral(" ></script @foo >\r\n");
WriteLiteral("\r\n<script></script @");
WriteLiteral("\r\n<script type=\"text/html\">\r\n <%var");
BeginWriteAttribute("x", " x =", 102, "", 106, 0);
EndWriteAttribute();
BeginWriteAttribute("window", " window =", 106, "", 115, 0);
EndWriteAttribute();
WriteLiteral("= null%>\r\n</script>\r\n\r\n<script></script @");
}
#pragma warning restore 1998
}

View File

@ -1 +1 @@
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags.cshtml(5,11): Error RZ1024: End of file or an unexpected character was reached before the "script" tag could be parsed. Elements inside markup blocks must be complete. They must either be self-closing ("<br />") or have matching end tags ("<p>Hello</p>"). If you intended to display a "<" character, use the "&lt;" HTML entity.
TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags.cshtml(9,11): Error RZ1024: End of file or an unexpected character was reached before the "script" tag could be parsed. Elements inside markup blocks must be complete. They must either be self-closing ("<br />") or have matching end tags ("<p>Hello</p>"). If you intended to display a "<" character, use the "&lt;" HTML entity.

View File

@ -20,8 +20,21 @@ Document -
IntermediateToken - (59:1,55 [2] Tags.cshtml) - Html - \n
CSharpCode - (61:2,0 [0] Tags.cshtml)
IntermediateToken - (61:2,0 [0] Tags.cshtml) - CSharp -
HtmlContent - (64:3,0 [20] Tags.cshtml)
HtmlContent - (64:3,0 [38] Tags.cshtml)
IntermediateToken - (64:3,0 [2] Tags.cshtml) - Html - \n
IntermediateToken - (66:4,0 [7] Tags.cshtml) - Html - <script
IntermediateToken - (73:4,7 [1] Tags.cshtml) - Html - >
IntermediateToken - (74:4,8 [10] Tags.cshtml) - Html - </script @
IntermediateToken - (73:4,7 [17] Tags.cshtml) - Html - type="text/html"
IntermediateToken - (90:4,24 [1] Tags.cshtml) - Html - >
IntermediateToken - (91:4,25 [6] Tags.cshtml) - Html - \n
IntermediateToken - (97:5,4 [5] Tags.cshtml) - Html - <%var
HtmlAttribute - (102:5,9 [4] Tags.cshtml) - x = -
HtmlAttribute - (106:5,13 [9] Tags.cshtml) - window = -
HtmlContent - (115:5,22 [41] Tags.cshtml)
IntermediateToken - (115:5,22 [7] Tags.cshtml) - Html - = null%
IntermediateToken - (122:5,29 [1] Tags.cshtml) - Html - >
IntermediateToken - (123:5,30 [2] Tags.cshtml) - Html - \n
IntermediateToken - (125:6,0 [9] Tags.cshtml) - Html - </script>
IntermediateToken - (134:6,9 [4] Tags.cshtml) - Html - \n\n
IntermediateToken - (138:8,0 [7] Tags.cshtml) - Html - <script
IntermediateToken - (145:8,7 [1] Tags.cshtml) - Html - >
IntermediateToken - (146:8,8 [10] Tags.cshtml) - Html - </script @

View File

@ -21,7 +21,7 @@ using Microsoft.AspNetCore.Components.Web;
#line default
#line hidden
#nullable disable
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {

View File

@ -6,7 +6,7 @@ Document -
UsingDirective - (104:5,1 [37] ) - Microsoft.AspNetCore.Components
UsingDirective - (1:0,1 [28] x:\dir\subdir\Test\TestComponent.cshtml) - System.Threading.Tasks
UsingDirective - (32:1,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414

View File

@ -10,6 +10,6 @@ Generated Location: (436:18,0 [41] )
Source Location: (94:2,19 [33] x:\dir\subdir\Test\TestComponent.cshtml)
|async (e) => await Task.Delay(10)|
Generated Location: (1282:38,19 [33] )
Generated Location: (1290:38,19 [33] )
|async (e) => await Task.Delay(10)|

View File

@ -21,7 +21,7 @@ using Microsoft.AspNetCore.Components.Web;
#line default
#line hidden
#nullable disable
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {
@ -47,7 +47,7 @@ using Microsoft.AspNetCore.Components.Web;
#nullable restore
#line 4 "x:\dir\subdir\Test\TestComponent.cshtml"
Task OnClick(MouseEventArgs e)
Task OnClick(MouseEventArgs e)
{
return Task.CompletedTask;
}

View File

@ -6,7 +6,7 @@ Document -
UsingDirective - (104:5,1 [37] ) - Microsoft.AspNetCore.Components
UsingDirective - (1:0,1 [28] x:\dir\subdir\Test\TestComponent.cshtml) - System.Threading.Tasks
UsingDirective - (32:1,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
@ -27,5 +27,5 @@ Document -
IntermediateToken - - CSharp - )
HtmlContent - (103:2,28 [2] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (103:2,28 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
CSharpCode - (112:3,7 [89] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (112:3,7 [89] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n Task OnClick(MouseEventArgs e) \n {\n return Task.CompletedTask;\n }\n
CSharpCode - (112:3,7 [88] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (112:3,7 [88] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n Task OnClick(MouseEventArgs e)\n {\n return Task.CompletedTask;\n }\n

View File

@ -10,19 +10,19 @@ Generated Location: (436:18,0 [41] )
Source Location: (92:2,17 [7] x:\dir\subdir\Test\TestComponent.cshtml)
|OnClick|
Generated Location: (1280:38,17 [7] )
Generated Location: (1288:38,17 [7] )
|OnClick|
Source Location: (112:3,7 [89] x:\dir\subdir\Test\TestComponent.cshtml)
Source Location: (112:3,7 [88] x:\dir\subdir\Test\TestComponent.cshtml)
|
Task OnClick(MouseEventArgs e)
Task OnClick(MouseEventArgs e)
{
return Task.CompletedTask;
}
|
Generated Location: (1481:48,7 [89] )
Generated Location: (1489:48,7 [88] )
|
Task OnClick(MouseEventArgs e)
Task OnClick(MouseEventArgs e)
{
return Task.CompletedTask;
}

View File

@ -21,7 +21,7 @@ using Microsoft.AspNetCore.Components.Web;
#line default
#line hidden
#nullable disable
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {

View File

@ -6,7 +6,7 @@ Document -
UsingDirective - (104:5,1 [37] ) - Microsoft.AspNetCore.Components
UsingDirective - (1:0,1 [28] x:\dir\subdir\Test\TestComponent.cshtml) - System.Threading.Tasks
UsingDirective - (32:1,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414

View File

@ -10,6 +10,6 @@ Generated Location: (436:18,0 [41] )
Source Location: (94:2,19 [32] x:\dir\subdir\Test\TestComponent.cshtml)
|async () => await Task.Delay(10)|
Generated Location: (1282:38,19 [32] )
Generated Location: (1290:38,19 [32] )
|async () => await Task.Delay(10)|

View File

@ -21,7 +21,7 @@ using Microsoft.AspNetCore.Components.Web;
#line default
#line hidden
#nullable disable
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {
@ -47,7 +47,7 @@ using Microsoft.AspNetCore.Components.Web;
#nullable restore
#line 4 "x:\dir\subdir\Test\TestComponent.cshtml"
Task OnClick()
Task OnClick()
{
return Task.CompletedTask;
}

View File

@ -6,7 +6,7 @@ Document -
UsingDirective - (104:5,1 [37] ) - Microsoft.AspNetCore.Components
UsingDirective - (1:0,1 [28] x:\dir\subdir\Test\TestComponent.cshtml) - System.Threading.Tasks
UsingDirective - (32:1,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
@ -27,5 +27,5 @@ Document -
IntermediateToken - - CSharp - )
HtmlContent - (103:2,28 [2] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (103:2,28 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
CSharpCode - (112:3,7 [73] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (112:3,7 [73] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n Task OnClick() \n {\n return Task.CompletedTask;\n }\n
CSharpCode - (112:3,7 [72] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (112:3,7 [72] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n Task OnClick()\n {\n return Task.CompletedTask;\n }\n

View File

@ -10,19 +10,19 @@ Generated Location: (436:18,0 [41] )
Source Location: (92:2,17 [7] x:\dir\subdir\Test\TestComponent.cshtml)
|OnClick|
Generated Location: (1280:38,17 [7] )
Generated Location: (1288:38,17 [7] )
|OnClick|
Source Location: (112:3,7 [73] x:\dir\subdir\Test\TestComponent.cshtml)
Source Location: (112:3,7 [72] x:\dir\subdir\Test\TestComponent.cshtml)
|
Task OnClick()
Task OnClick()
{
return Task.CompletedTask;
}
|
Generated Location: (1481:48,7 [73] )
Generated Location: (1489:48,7 [72] )
|
Task OnClick()
Task OnClick()
{
return Task.CompletedTask;
}

View File

@ -8,7 +8,7 @@ namespace Test
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {

View File

@ -5,7 +5,7 @@ Document -
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 -
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
@ -15,13 +15,13 @@ Document -
IntermediateToken - - CSharp - #pragma warning restore 0414
MethodDeclaration - - protected override - void - BuildRenderTree
Component - (0:0,0 [41] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Value - AttributeStructure.DoubleQuotes
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Value - Value - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - ParentValue
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - ValueChanged - AttributeStructure.DoubleQuotes
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - ValueChanged - ValueChanged - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, __value => ParentValue = __value, ParentValue)
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - ValueExpression - AttributeStructure.DoubleQuotes
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - ValueExpression - ValueExpression - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - () => ParentValue
HtmlContent - (41:0,41 [2] x:\dir\subdir\Test\TestComponent.cshtml)

View File

@ -1,13 +1,13 @@
Source Location: (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (978:25,26 [11] )
Generated Location: (986:25,26 [11] )
|ParentValue|
Source Location: (50:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
public int ParentValue { get; set; } = 42;
|
Generated Location: (2059:48,7 [50] )
Generated Location: (2067:48,7 [50] )
|
public int ParentValue { get; set; } = 42;
|

View File

@ -8,7 +8,7 @@ namespace Test
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {

View File

@ -5,7 +5,7 @@ Document -
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 -
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
@ -15,13 +15,13 @@ Document -
IntermediateToken - - CSharp - #pragma warning restore 0414
MethodDeclaration - - protected override - void - BuildRenderTree
Component - (0:0,0 [45] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent
ComponentAttribute - (30:0,30 [11] x:\dir\subdir\Test\TestComponent.cshtml) - SomeParam - AttributeStructure.DoubleQuotes
ComponentAttribute - (30:0,30 [11] x:\dir\subdir\Test\TestComponent.cshtml) - SomeParam - SomeParam - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - (30:0,30 [11] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - ParentValue
ComponentAttribute - (30:0,30 [11] x:\dir\subdir\Test\TestComponent.cshtml) - SomeParamChanged - AttributeStructure.DoubleQuotes
ComponentAttribute - (30:0,30 [11] x:\dir\subdir\Test\TestComponent.cshtml) - SomeParamChanged - SomeParamChanged - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, __value => ParentValue = __value, ParentValue)
ComponentAttribute - (30:0,30 [11] x:\dir\subdir\Test\TestComponent.cshtml) - SomeParamExpression - AttributeStructure.DoubleQuotes
ComponentAttribute - (30:0,30 [11] x:\dir\subdir\Test\TestComponent.cshtml) - SomeParamExpression - SomeParamExpression - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - () => ParentValue
HtmlContent - (45:0,45 [2] x:\dir\subdir\Test\TestComponent.cshtml)

View File

@ -1,13 +1,13 @@
Source Location: (30:0,30 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (969:25,30 [11] )
Generated Location: (977:25,30 [11] )
|ParentValue|
Source Location: (54:1,7 [65] x:\dir\subdir\Test\TestComponent.cshtml)
|
public DateTime ParentValue { get; set; } = DateTime.Now;
|
Generated Location: (1579:43,7 [65] )
Generated Location: (1587:43,7 [65] )
|
public DateTime ParentValue { get; set; } = DateTime.Now;
|

View File

@ -8,7 +8,7 @@ namespace Test
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {

View File

@ -5,7 +5,7 @@ Document -
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 -
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
@ -15,10 +15,10 @@ Document -
IntermediateToken - - CSharp - #pragma warning restore 0414
MethodDeclaration - - protected override - void - BuildRenderTree
Component - (0:0,0 [41] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Value - AttributeStructure.DoubleQuotes
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Value - Value - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - ParentValue
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - ValueChanged - AttributeStructure.DoubleQuotes
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - ValueChanged - ValueChanged - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, __value => ParentValue = __value, ParentValue)
HtmlContent - (41:0,41 [2] x:\dir\subdir\Test\TestComponent.cshtml)

View File

@ -1,13 +1,13 @@
Source Location: (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (978:25,26 [11] )
Generated Location: (986:25,26 [11] )
|ParentValue|
Source Location: (50:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
public int ParentValue { get; set; } = 42;
|
Generated Location: (1883:47,7 [50] )
Generated Location: (1891:47,7 [50] )
|
public int ParentValue { get; set; } = 42;
|

View File

@ -8,7 +8,7 @@ namespace Test
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {

View File

@ -5,7 +5,7 @@ Document -
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 -
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
@ -15,10 +15,10 @@ Document -
IntermediateToken - - CSharp - #pragma warning restore 0414
MethodDeclaration - - protected override - void - BuildRenderTree
Component - (0:0,0 [41] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Value - AttributeStructure.DoubleQuotes
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Value - Value - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - ParentValue
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - ValueChanged - AttributeStructure.DoubleQuotes
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - ValueChanged - ValueChanged - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, __value => ParentValue = __value, ParentValue)
HtmlContent - (41:0,41 [2] x:\dir\subdir\Test\TestComponent.cshtml)

View File

@ -1,13 +1,13 @@
Source Location: (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (978:25,26 [11] )
Generated Location: (986:25,26 [11] )
|ParentValue|
Source Location: (50:1,7 [55] x:\dir\subdir\Test\TestComponent.cshtml)
|
public string ParentValue { get; set; } = "42";
|
Generated Location: (1883:47,7 [55] )
Generated Location: (1891:47,7 [55] )
|
public string ParentValue { get; set; } = "42";
|

View File

@ -8,7 +8,7 @@ namespace Test
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {

View File

@ -5,7 +5,7 @@ Document -
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 -
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
@ -15,10 +15,10 @@ Document -
IntermediateToken - - CSharp - #pragma warning restore 0414
MethodDeclaration - - protected override - void - BuildRenderTree
Component - (0:0,0 [71] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Value - AttributeStructure.DoubleQuotes
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Value - Value - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - ParentValue
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - OnChanged - AttributeStructure.DoubleQuotes
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - OnChanged - OnChanged - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - __value => ParentValue = __value
HtmlContent - (71:0,71 [2] x:\dir\subdir\Test\TestComponent.cshtml)

View File

@ -1,13 +1,13 @@
Source Location: (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (978:25,26 [11] )
Generated Location: (986:25,26 [11] )
|ParentValue|
Source Location: (80:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
public int ParentValue { get; set; } = 42;
|
Generated Location: (1586:47,7 [50] )
Generated Location: (1594:47,7 [50] )
|
public int ParentValue { get; set; } = 42;
|

View File

@ -8,7 +8,7 @@ namespace Test
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {

View File

@ -5,7 +5,7 @@ Document -
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 -
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
@ -15,10 +15,10 @@ Document -
IntermediateToken - - CSharp - #pragma warning restore 0414
MethodDeclaration - - protected override - void - BuildRenderTree
Component - (0:0,0 [71] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Value - AttributeStructure.DoubleQuotes
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Value - - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - ParentValue
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - OnChanged - AttributeStructure.DoubleQuotes
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - OnChanged - - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, __value => ParentValue = __value, ParentValue)
HtmlContent - (71:0,71 [2] x:\dir\subdir\Test\TestComponent.cshtml)

View File

@ -1,13 +1,13 @@
Source Location: (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (890:25,26 [11] )
Generated Location: (898:25,26 [11] )
|ParentValue|
Source Location: (80:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
public int ParentValue { get; set; } = 42;
|
Generated Location: (1562:46,7 [50] )
Generated Location: (1570:46,7 [50] )
|
public int ParentValue { get; set; } = 42;
|

View File

@ -8,7 +8,7 @@ namespace Test
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {

View File

@ -5,7 +5,7 @@ Document -
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 -
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
@ -15,13 +15,13 @@ Document -
IntermediateToken - - CSharp - #pragma warning restore 0414
MethodDeclaration - - protected override - void - BuildRenderTree
Component - (0:0,0 [41] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Value - AttributeStructure.DoubleQuotes
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Value - Value - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - ParentValue
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - ValueChanged - AttributeStructure.DoubleQuotes
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - ValueChanged - ValueChanged - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - __value => ParentValue = __value
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - ValueExpression - AttributeStructure.DoubleQuotes
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - ValueExpression - ValueExpression - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - () => ParentValue
HtmlContent - (41:0,41 [2] x:\dir\subdir\Test\TestComponent.cshtml)

View File

@ -1,13 +1,13 @@
Source Location: (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (978:25,26 [11] )
Generated Location: (986:25,26 [11] )
|ParentValue|
Source Location: (50:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
public int ParentValue { get; set; } = 42;
|
Generated Location: (1762:48,7 [50] )
Generated Location: (1770:48,7 [50] )
|
public int ParentValue { get; set; } = 42;
|

View File

@ -8,7 +8,7 @@ namespace Test
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {

View File

@ -5,7 +5,7 @@ Document -
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 -
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
@ -15,13 +15,13 @@ Document -
IntermediateToken - - CSharp - #pragma warning restore 0414
MethodDeclaration - - protected override - void - BuildRenderTree
Component - (0:0,0 [45] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent
ComponentAttribute - (30:0,30 [11] x:\dir\subdir\Test\TestComponent.cshtml) - SomeParam - AttributeStructure.DoubleQuotes
ComponentAttribute - (30:0,30 [11] x:\dir\subdir\Test\TestComponent.cshtml) - SomeParam - SomeParam - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - (30:0,30 [11] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - ParentValue
ComponentAttribute - (30:0,30 [11] x:\dir\subdir\Test\TestComponent.cshtml) - SomeParamChanged - AttributeStructure.DoubleQuotes
ComponentAttribute - (30:0,30 [11] x:\dir\subdir\Test\TestComponent.cshtml) - SomeParamChanged - SomeParamChanged - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - __value => ParentValue = __value
ComponentAttribute - (30:0,30 [11] x:\dir\subdir\Test\TestComponent.cshtml) - SomeParamExpression - AttributeStructure.DoubleQuotes
ComponentAttribute - (30:0,30 [11] x:\dir\subdir\Test\TestComponent.cshtml) - SomeParamExpression - SomeParamExpression - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - () => ParentValue
HtmlContent - (45:0,45 [2] x:\dir\subdir\Test\TestComponent.cshtml)

View File

@ -1,13 +1,13 @@
Source Location: (30:0,30 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (969:25,30 [11] )
Generated Location: (977:25,30 [11] )
|ParentValue|
Source Location: (54:1,7 [65] x:\dir\subdir\Test\TestComponent.cshtml)
|
public DateTime ParentValue { get; set; } = DateTime.Now;
|
Generated Location: (1399:43,7 [65] )
Generated Location: (1407:43,7 [65] )
|
public DateTime ParentValue { get; set; } = DateTime.Now;
|

View File

@ -8,7 +8,7 @@ namespace Test
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {

View File

@ -5,7 +5,7 @@ Document -
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 -
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
@ -15,10 +15,10 @@ Document -
IntermediateToken - - CSharp - #pragma warning restore 0414
MethodDeclaration - - protected override - void - BuildRenderTree
Component - (0:0,0 [41] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Value - AttributeStructure.DoubleQuotes
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Value - Value - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - ParentValue
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - ValueChanged - AttributeStructure.DoubleQuotes
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - ValueChanged - ValueChanged - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - __value => ParentValue = __value
HtmlContent - (41:0,41 [2] x:\dir\subdir\Test\TestComponent.cshtml)

View File

@ -1,13 +1,13 @@
Source Location: (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (978:25,26 [11] )
Generated Location: (986:25,26 [11] )
|ParentValue|
Source Location: (50:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
public int ParentValue { get; set; } = 42;
|
Generated Location: (1586:47,7 [50] )
Generated Location: (1594:47,7 [50] )
|
public int ParentValue { get; set; } = 42;
|

View File

@ -8,7 +8,7 @@ namespace Test
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {

View File

@ -5,7 +5,7 @@ Document -
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 -
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
@ -15,10 +15,10 @@ Document -
IntermediateToken - - CSharp - #pragma warning restore 0414
MethodDeclaration - - protected override - void - BuildRenderTree
Component - (0:0,0 [41] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Value - AttributeStructure.DoubleQuotes
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Value - - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - ParentValue
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - ValueChanged - AttributeStructure.DoubleQuotes
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - ValueChanged - - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, __value => ParentValue = __value, ParentValue)
HtmlContent - (41:0,41 [2] x:\dir\subdir\Test\TestComponent.cshtml)

View File

@ -1,13 +1,13 @@
Source Location: (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (890:25,26 [11] )
Generated Location: (898:25,26 [11] )
|ParentValue|
Source Location: (50:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
public int ParentValue { get; set; } = 42;
|
Generated Location: (1562:46,7 [50] )
Generated Location: (1570:46,7 [50] )
|
public int ParentValue { get; set; } = 42;
|

View File

@ -8,7 +8,7 @@ namespace Test
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {

View File

@ -5,7 +5,7 @@ Document -
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 -
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
@ -15,10 +15,10 @@ Document -
IntermediateToken - - CSharp - #pragma warning restore 0414
MethodDeclaration - - protected override - void - BuildRenderTree
Component - (0:0,0 [41] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Value - AttributeStructure.DoubleQuotes
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Value - Value - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - ParentValue
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - ValueChanged - AttributeStructure.DoubleQuotes
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - ValueChanged - ValueChanged - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - __value => ParentValue = __value
HtmlContent - (41:0,41 [2] x:\dir\subdir\Test\TestComponent.cshtml)

View File

@ -1,13 +1,13 @@
Source Location: (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (978:25,26 [11] )
Generated Location: (986:25,26 [11] )
|ParentValue|
Source Location: (50:1,7 [55] x:\dir\subdir\Test\TestComponent.cshtml)
|
public string ParentValue { get; set; } = "42";
|
Generated Location: (1586:47,7 [55] )
Generated Location: (1594:47,7 [55] )
|
public string ParentValue { get; set; } = "42";
|

View File

@ -8,7 +8,7 @@ namespace Test
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {

View File

@ -5,7 +5,7 @@ Document -
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 -
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414
@ -15,13 +15,13 @@ Document -
IntermediateToken - - CSharp - #pragma warning restore 0414
MethodDeclaration - - protected override - void - BuildRenderTree
Component - (0:0,0 [39] x:\dir\subdir\Test\TestComponent.cshtml) - InputText
ComponentAttribute - (24:0,24 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Value - AttributeStructure.DoubleQuotes
ComponentAttribute - (24:0,24 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Value - Value - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - (24:0,24 [11] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - person.Name
ComponentAttribute - (24:0,24 [11] x:\dir\subdir\Test\TestComponent.cshtml) - ValueChanged - AttributeStructure.DoubleQuotes
ComponentAttribute - (24:0,24 [11] x:\dir\subdir\Test\TestComponent.cshtml) - ValueChanged - ValueChanged - AttributeStructure.DoubleQuotes
CSharpExpression -
IntermediateToken - - CSharp - __value => person.Name = __value
HtmlContent - (39:0,39 [4] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (39:0,39 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n
CSharpCode - (57:3,1 [37] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (57:3,1 [37] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n Person person = new Person();\n
CSharpCode - (56:3,1 [37] x:\dir\subdir\Test\TestComponent.cshtml)
IntermediateToken - (56:3,1 [37] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n Person person = new Person();\n

View File

@ -1,13 +1,13 @@
Source Location: (24:0,24 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|person.Name|
Generated Location: (977:25,24 [11] )
Generated Location: (985:25,24 [11] )
|person.Name|
Source Location: (57:3,1 [37] x:\dir\subdir\Test\TestComponent.cshtml)
Source Location: (56:3,1 [37] x:\dir\subdir\Test\TestComponent.cshtml)
|
Person person = new Person();
|
Generated Location: (1578:47,1 [37] )
Generated Location: (1586:47,1 [37] )
|
Person person = new Person();
|

View File

@ -15,7 +15,7 @@ using System.Globalization;
#line default
#line hidden
#nullable disable
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {

View File

@ -6,7 +6,7 @@ Document -
UsingDirective - (73:4,1 [28] ) - System.Threading.Tasks
UsingDirective - (104:5,1 [37] ) - Microsoft.AspNetCore.Components
UsingDirective - (1:0,1 [26] x:\dir\subdir\Test\TestComponent.cshtml) - System.Globalization
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414

View File

@ -5,19 +5,19 @@ Generated Location: (320:12,0 [26] )
Source Location: (48:1,19 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (1090:32,19 [11] )
Generated Location: (1098:32,19 [11] )
|ParentValue|
Source Location: (111:1,82 [28] x:\dir\subdir\Test\TestComponent.cshtml)
|CultureInfo.InvariantCulture|
Generated Location: (1330:40,82 [28] )
Generated Location: (1338:40,82 [28] )
|CultureInfo.InvariantCulture|
Source Location: (152:2,7 [55] x:\dir\subdir\Test\TestComponent.cshtml)
|
public string ParentValue { get; set; } = "hi";
|
Generated Location: (1731:51,7 [55] )
Generated Location: (1739:51,7 [55] )
|
public string ParentValue { get; set; } = "hi";
|

View File

@ -8,7 +8,7 @@ namespace Test
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {

View File

@ -5,7 +5,7 @@ Document -
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 -
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414

View File

@ -1,13 +1,13 @@
Source Location: (33:0,33 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|CurrentDate|
Generated Location: (955:25,33 [11] )
Generated Location: (963:25,33 [11] )
|CurrentDate|
Source Location: (113:1,7 [77] x:\dir\subdir\Test\TestComponent.cshtml)
|
public DateTime CurrentDate { get; set; } = new DateTime(2018, 1, 1);
|
Generated Location: (1334:36,7 [77] )
Generated Location: (1342:36,7 [77] )
|
public DateTime CurrentDate { get; set; } = new DateTime(2018, 1, 1);
|

View File

@ -8,7 +8,7 @@ namespace Test
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {

View File

@ -5,7 +5,7 @@ Document -
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 -
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414

View File

@ -1,13 +1,13 @@
Source Location: (33:0,33 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (955:25,33 [11] )
Generated Location: (963:25,33 [11] )
|ParentValue|
Source Location: (86:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
public int ParentValue { get; set; } = 42;
|
Generated Location: (1300:36,7 [50] )
Generated Location: (1308:36,7 [50] )
|
public int ParentValue { get; set; } = 42;
|

View File

@ -15,7 +15,7 @@ using System.Globalization;
#line default
#line hidden
#nullable disable
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {

View File

@ -6,7 +6,7 @@ Document -
UsingDirective - (73:4,1 [28] ) - System.Threading.Tasks
UsingDirective - (104:5,1 [37] ) - Microsoft.AspNetCore.Components
UsingDirective - (1:0,1 [26] x:\dir\subdir\Test\TestComponent.cshtml) - System.Globalization
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414

View File

@ -5,19 +5,19 @@ Generated Location: (320:12,0 [26] )
Source Location: (48:1,19 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (1090:32,19 [11] )
Generated Location: (1098:32,19 [11] )
|ParentValue|
Source Location: (115:1,86 [28] x:\dir\subdir\Test\TestComponent.cshtml)
|CultureInfo.InvariantCulture|
Generated Location: (1334:40,86 [28] )
Generated Location: (1342:40,86 [28] )
|CultureInfo.InvariantCulture|
Source Location: (156:2,7 [55] x:\dir\subdir\Test\TestComponent.cshtml)
|
public string ParentValue { get; set; } = "hi";
|
Generated Location: (1735:51,7 [55] )
Generated Location: (1743:51,7 [55] )
|
public string ParentValue { get; set; } = "hi";
|

View File

@ -8,7 +8,7 @@ namespace Test
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {

View File

@ -5,7 +5,7 @@ Document -
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 -
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414

View File

@ -1,13 +1,13 @@
Source Location: (19:0,19 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (941:25,19 [11] )
Generated Location: (949:25,19 [11] )
|ParentValue|
Source Location: (76:1,7 [55] x:\dir\subdir\Test\TestComponent.cshtml)
|
public string ParentValue { get; set; } = "hi";
|
Generated Location: (1286:36,7 [55] )
Generated Location: (1294:36,7 [55] )
|
public string ParentValue { get; set; } = "hi";
|

View File

@ -8,7 +8,7 @@ namespace Test
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 219
private void __RazorDirectiveTokenHelpers__() {

View File

@ -5,7 +5,7 @@ Document -
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 -
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
DesignTimeDirective -
CSharpCode -
IntermediateToken - - CSharp - #pragma warning disable 0414

Some files were not shown because too many files have changed in this diff Show More