-
Notifications
You must be signed in to change notification settings - Fork 1.8k
C#: Recognize more calls to IHtmlHelper.Raw
#3509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Thanks for adding these. There should probably be a test for the new sink. (If it's difficult and annoying to add trivial tests then we need to discuss how to make that easier.)
getNamespace() instanceof MicrosoftAspNetCoreMvcViewFeatures and | ||
hasName("HtmlHelper") | ||
/** The `Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper` interface. */ | ||
class MicrosoftAspNetCoreMvcRenderingHtmlHelperInterface extends Interface { |
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.
Should be called MicrosoftAspNetCoreMvcRenderingIHtmlHelperInterface
(extra I
)
c.getTarget() = target and | ||
target.hasName("Raw") and | ||
target.getDeclaringType().getABaseType*() instanceof | ||
MicrosoftAspNetCoreMvcRenderingHtmlHelperInterface and |
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'm happy with this -- however, do we want to model things in terms of a getRawMethod()
on MicrosoftAspNetCoreMvcRenderingHtmlHelperInterface
?
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.
Then we need to involve the overrides
relation as well, which just complicates things even more.
Generalize logic by recognizing not only calls to `Microsoft.AspNetCore.Mvc.ViewFeatures.HtmlHelper.Raw()`, but calls to all `Raw()` methods that implement `Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper.Raw()`.
As discussed offline, I have removed the test again, to avoid checking in DLLs. |
Generalize logic by recognizing not only calls to
Microsoft.AspNetCore.Mvc.ViewFeatures.HtmlHelper.Raw()
, but calls to allRaw()
methods that implementMicrosoft.AspNetCore.Mvc.Rendering.IHtmlHelper.Raw()
.