Make ~/ resolution show up at design time.
- This change results in proper errors for tags that utilize `~/`inside of local functions at design time. - Updated TagHelper in code blocks analyzer error to mention `~/` since it will typically be a cause of confusion. #10734
This commit is contained in:
parent
c56fb8046c
commit
4623ce7f94
|
|
@ -59,7 +59,7 @@ namespace Microsoft.AspNetCore.Mvc.Analyzers
|
||||||
new DiagnosticDescriptor(
|
new DiagnosticDescriptor(
|
||||||
"MVC1006",
|
"MVC1006",
|
||||||
"Methods containing TagHelpers must be async and return Task.",
|
"Methods containing TagHelpers must be async and return Task.",
|
||||||
"The method contains a TagHelper and therefore must be async and return a Task.",
|
"The method contains a TagHelper and therefore must be async and return a Task. For instance, usage of ~/ typically results in a TagHelper and requires an async Task returning parent method.",
|
||||||
"Usage",
|
"Usage",
|
||||||
DiagnosticSeverity.Error,
|
DiagnosticSeverity.Error,
|
||||||
isEnabledByDefault: true);
|
isEnabledByDefault: true);
|
||||||
|
|
|
||||||
|
|
@ -356,7 +356,6 @@ namespace Microsoft.AspNetCore.Mvc.Razor.TagHelpers
|
||||||
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElementAttribute("track", Attributes="[src^='~/']", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)]
|
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElementAttribute("track", Attributes="[src^='~/']", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)]
|
||||||
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElementAttribute("video", Attributes="[poster^='~/']")]
|
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElementAttribute("video", Attributes="[poster^='~/']")]
|
||||||
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElementAttribute("video", Attributes="[src^='~/']")]
|
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElementAttribute("video", Attributes="[src^='~/']")]
|
||||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
|
|
||||||
public partial class UrlResolutionTagHelper : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper
|
public partial class UrlResolutionTagHelper : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper
|
||||||
{
|
{
|
||||||
public UrlResolutionTagHelper(Microsoft.AspNetCore.Mvc.Routing.IUrlHelperFactory urlHelperFactory, System.Text.Encodings.Web.HtmlEncoder htmlEncoder) { }
|
public UrlResolutionTagHelper(Microsoft.AspNetCore.Mvc.Routing.IUrlHelperFactory urlHelperFactory, System.Text.Encodings.Web.HtmlEncoder htmlEncoder) { }
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,6 @@ namespace Microsoft.AspNetCore.Mvc.Razor.TagHelpers
|
||||||
[HtmlTargetElement("track", Attributes = "[src^='~/']", TagStructure = TagStructure.WithoutEndTag)]
|
[HtmlTargetElement("track", Attributes = "[src^='~/']", TagStructure = TagStructure.WithoutEndTag)]
|
||||||
[HtmlTargetElement("video", Attributes = "[src^='~/']")]
|
[HtmlTargetElement("video", Attributes = "[src^='~/']")]
|
||||||
[HtmlTargetElement("video", Attributes = "[poster^='~/']")]
|
[HtmlTargetElement("video", Attributes = "[poster^='~/']")]
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
||||||
public class UrlResolutionTagHelper : TagHelper
|
public class UrlResolutionTagHelper : TagHelper
|
||||||
{
|
{
|
||||||
// Valid whitespace characters defined by the HTML5 spec.
|
// Valid whitespace characters defined by the HTML5 spec.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue