This repository was archived by the owner on Dec 19, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Also added some infrastructure pieces for it such as the ITagHelperDescriptorResolver and the default implementation TagHelperDescriptorResolver which will be filled out in a later commit. - Reworked some extensibility points to allow accessibility of the descriptor resolvers per offline discussions. #111
- Loading branch information
1 parent
6ef8ec4
commit c2f31b2
Showing
19 changed files
with
381 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...Microsoft.AspNet.Razor/Generator/Compiler/CodeTree/Chunks/TagHelpers/AddTagHelperChunk.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
namespace Microsoft.AspNet.Razor.Generator.Compiler | ||
{ | ||
/// <summary> | ||
/// A <see cref="Chunk"/> used to look up <see cref="TagHelpers.TagHelperDescriptor"/>s. | ||
/// </summary> | ||
public class AddTagHelperChunk : Chunk | ||
{ | ||
/// <summary> | ||
/// Text used to look up <see cref="TagHelpers.TagHelperDescriptor"/>s. | ||
/// </summary> | ||
public string LookupText { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/Microsoft.AspNet.Razor/Generator/TagHelpers/AddTagHelperCodeGenerator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using Microsoft.AspNet.Razor.Parser.SyntaxTree; | ||
|
||
namespace Microsoft.AspNet.Razor.Generator | ||
{ | ||
/// <summary> | ||
/// A <see cref="SpanCodeGenerator"/> responsible for generating <see cref="Compiler.AddTagHelperChunk"/>s. | ||
/// </summary> | ||
public class AddTagHelperCodeGenerator : SpanCodeGenerator | ||
{ | ||
/// <summary> | ||
/// Instantiates a new <see cref="AddTagHelperCodeGenerator"/>. | ||
/// </summary> | ||
/// <param name="lookupText"> | ||
/// Text used to look up <see cref="TagHelpers.TagHelperDescriptor"/>s. | ||
/// </param> | ||
public AddTagHelperCodeGenerator(string lookupText) | ||
{ | ||
LookupText = lookupText; | ||
} | ||
|
||
/// <summary> | ||
/// Text used to look up <see cref="TagHelpers.TagHelperDescriptor"/>s. | ||
/// </summary> | ||
public string LookupText { get; private set; } | ||
|
||
/// <summary> | ||
/// Generates a <see cref="Compiler.AddTagHelperChunk"/>. | ||
/// </summary> | ||
/// <param name="target"> | ||
/// The <see cref="Span"/> responsible for this <see cref="AddTagHelperCodeGenerator"/>. | ||
/// </param> | ||
/// <param name="context">A <see cref="CodeGeneratorContext"/> instance that contains information about | ||
/// the current code generation process.</param> | ||
public override void GenerateCode(Span target, CodeGeneratorContext context) | ||
{ | ||
context.CodeTreeBuilder.AddAddTagHelperChunk(LookupText, target); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.