-
Notifications
You must be signed in to change notification settings - Fork 223
Add @addtaghelper directive. #142
Add @addtaghelper directive. #142
Conversation
I can break this into two PR's if people feel that it helps with the code review process. |
@@ -38,6 +38,14 @@ public void AddChunk(Chunk chunk, SyntaxTreeNode association, bool topLevel = fa | |||
} | |||
} | |||
|
|||
public void AddAddTagHelperChunk(string lookupText, SyntaxTreeNode association) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kinda rough naming but still felt like it made sense. Feel free to object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
naming here derives from @addtaghelper
naming so it makes sense. could of course change the keyword to something like @usetaghelper
(and later @removetaghelper
might be @ignoretaghelper
).
/cc @DamianEdwards
b918f8b
to
e8673f8
Compare
3f2fa4a
to
6a99ea3
Compare
e8673f8
to
4cd59eb
Compare
6a99ea3
to
c80b01f
Compare
4cd59eb
to
68fd42a
Compare
c80b01f
to
af6249b
Compare
68fd42a
to
8ba1682
Compare
af6249b
to
f0d0d67
Compare
8ba1682
to
2f775d4
Compare
f0d0d67
to
7eb0f98
Compare
2f775d4
to
369a300
Compare
7eb0f98
to
4f5e86d
Compare
369a300
to
e9df146
Compare
internal const string InheritsHelper = "__inheritsHelper"; | ||
internal const string DesignTimeHelperMethodName = "__RazorDesignTimeHelpers__"; | ||
private static readonly string ObjectTypeString = typeof(object).ToString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just generate the string "object"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or string
or (if you do initialization) var
on PR description "Validated directive syntax tree creation, errors and code generation." bullet, looks as if you are only newly validating the |
tabTest: TabTest.NoTabs, | ||
expectedDesignTimePragmas: new List<LineMapping>() | ||
{ | ||
BuildLineMapping(14, 0, 440, 14, 14, 11) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
icky magic numbers. please at least name the parameters
040a3a1
to
7399531
Compare
145b3c4
to
f3d2585
Compare
Addressed code review comments. |
|
||
Writer.WriteStartAssignment(TagHelperDirectiveSyntaxHelper); | ||
|
||
_csharpCodeVisitor.CreateExpressionCodeMapping( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(let's help the children 😺) add comments referring reader to code in CSharpCodeParser.TagHelperDirective()
that ensures LookupText
is not surrounded by the quotes. Might also be worth mentioning this restores quotes that code requires then removes.
⌚ very close; will mainly look at comments and |
Addressed code review comments. |
private const int DisableVariableNamingWarnings = 219; | ||
|
||
public CSharpDesignTimeHelpersVisitor(CSharpCodeWriter writer, CodeBuilderContext context) | ||
: base(writer, context) { } | ||
private CSharpCodeVisitor _csharpCodeVisitor; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add readonly
|
- 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
- Fixed existing tests to work with new RazorParser. - Validated directive syntax tree creation, errors and code generation. #111
84f0011
to
da3051a
Compare
Tag Helpers: Add @addtaghelper directive and link to registration system #111