-
Notifications
You must be signed in to change notification settings - Fork 220
Create TagHelper specific C# code Generation. #134
Conversation
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.
I left this class in flux because I'm aware I suck at naming 😄 . Therefore it's partially completed so i can address code review comments quicker. Feel free to comment on the / suggest better names
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.
We could make an interface for this if we want and have this be the default implementation. As @pranavkm and I discussed though it would probably be overkill.
c431d3f to
6b646a0
Compare
df4136f to
7f3e80a
Compare
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.
excuse that rest of class is undocumented doesn't work for me here. when would instanceName be anything except this? why bother qualifying the method name with this.? if this method handles calls to methods on some other instance (not the current object), make that clear in the name and with comments.
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.
It's never called for this., just for other instances, what would be a better name? Will add comment.
|
Addressed comments in this PR. |
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.
suggest shortening to GeneratedTagHelperContext
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.
any chance of null anywhere in this dereference chain? guard if so
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.
Nope, when code is generated everything is initialized and the chunks automatically have a root 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.
Do [NotNull] instead
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.
Will put [NotNull] just on this overload. Since all other overloads call into it 1 [NotNull] functionally works. As for an engineering guidelines standpoint I brought it up with @davidfowl because we should probably be consistent.
e9e03fb to
dc3a520
Compare
a02e3a2 to
35855dd
Compare
|
Addressed code review comments. |
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.
Do you need contentBehavior here?
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.
Not anymore, good catch
|
Addressed code review comments. |
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 isn't this restoration inside the finally block?
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.
Because if something goes wrong recovering doesn't matter. As @pranavkm mentioned the Host is the only sensitive piece of information here that absolutely requires it to be set back. Will put it in the finally block anyways, doesn't hurt.
|
|
e67684e to
0dac4a0
Compare
Tag Helpers: Create code generators and code visitors that understand tags #72
I split up the test portion of this PR to reduce noise. PR: #135