Expose TagHelperDescriptors on TagHelperBlock.
- This will enable tooling to determine which descriptors are relevant to which TagHelperBlocks in the syntax tree.
This commit is contained in:
parent
c680833350
commit
170b7a76fd
|
|
@ -6,6 +6,7 @@ using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||||
|
using Microsoft.AspNet.Razor.TagHelpers;
|
||||||
using Microsoft.AspNet.Razor.Text;
|
using Microsoft.AspNet.Razor.Text;
|
||||||
using Microsoft.Internal.Web.Utils;
|
using Microsoft.Internal.Web.Utils;
|
||||||
|
|
||||||
|
|
@ -27,6 +28,7 @@ namespace Microsoft.AspNet.Razor.Parser.TagHelpers
|
||||||
: base(source.Type, source.Children, source.CodeGenerator)
|
: base(source.Type, source.Children, source.CodeGenerator)
|
||||||
{
|
{
|
||||||
TagName = source.TagName;
|
TagName = source.TagName;
|
||||||
|
Descriptors = source.Descriptors;
|
||||||
Attributes = new Dictionary<string, SyntaxTreeNode>(source.Attributes);
|
Attributes = new Dictionary<string, SyntaxTreeNode>(source.Attributes);
|
||||||
_start = source.Start;
|
_start = source.Start;
|
||||||
|
|
||||||
|
|
@ -38,6 +40,11 @@ namespace Microsoft.AspNet.Razor.Parser.TagHelpers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <see cref="TagHelperDescriptor"/>s for the HTML element.
|
||||||
|
/// </summary>
|
||||||
|
public IEnumerable<TagHelperDescriptor> Descriptors { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The HTML attributes.
|
/// The HTML attributes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ namespace Microsoft.AspNet.Razor.Parser.TagHelpers
|
||||||
: base(original)
|
: base(original)
|
||||||
{
|
{
|
||||||
TagName = original.TagName;
|
TagName = original.TagName;
|
||||||
|
Descriptors = original.Descriptors;
|
||||||
Attributes = new Dictionary<string, SyntaxTreeNode>(original.Attributes);
|
Attributes = new Dictionary<string, SyntaxTreeNode>(original.Attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -42,6 +43,7 @@ namespace Microsoft.AspNet.Razor.Parser.TagHelpers
|
||||||
public TagHelperBlockBuilder(string tagName, IEnumerable<TagHelperDescriptor> descriptors, Block startTag)
|
public TagHelperBlockBuilder(string tagName, IEnumerable<TagHelperDescriptor> descriptors, Block startTag)
|
||||||
{
|
{
|
||||||
TagName = tagName;
|
TagName = tagName;
|
||||||
|
Descriptors = descriptors;
|
||||||
CodeGenerator = new TagHelperCodeGenerator(descriptors);
|
CodeGenerator = new TagHelperCodeGenerator(descriptors);
|
||||||
Type = startTag.Type;
|
Type = startTag.Type;
|
||||||
Attributes = GetTagAttributes(startTag, descriptors);
|
Attributes = GetTagAttributes(startTag, descriptors);
|
||||||
|
|
@ -67,6 +69,11 @@ namespace Microsoft.AspNet.Razor.Parser.TagHelpers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <see cref="TagHelperDescriptor"/>s for the HTML element.
|
||||||
|
/// </summary>
|
||||||
|
public IEnumerable<TagHelperDescriptor> Descriptors { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The HTML attributes.
|
/// The HTML attributes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue