Skip to content

Conversation

hvitved
Copy link
Contributor

@hvitved hvitved commented May 19, 2020

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().

@hvitved hvitved added the C# label May 19, 2020
@hvitved hvitved requested a review from calumgrant May 19, 2020 10:00
@hvitved hvitved requested a review from a team as a code owner May 19, 2020 10:00
Copy link
Contributor

@calumgrant calumgrant left a 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 {
Copy link
Contributor

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
Copy link
Contributor

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 ?

Copy link
Contributor Author

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.

hvitved added 2 commits June 11, 2020 11:26
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()`.
@hvitved
Copy link
Contributor Author

hvitved commented Jun 11, 2020

As discussed offline, I have removed the test again, to avoid checking in DLLs.

@calumgrant calumgrant merged commit 0d1fb0f into github:master Jun 15, 2020
@hvitved hvitved deleted the csharp/html-raw branch June 15, 2020 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants