Skip to content
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

Razor intellisense of properties not working with tag helpers using ParentTag #9397

Closed
jamezamm opened this issue Oct 11, 2023 · 0 comments · Fixed by #9402
Closed

Razor intellisense of properties not working with tag helpers using ParentTag #9397

jamezamm opened this issue Oct 11, 2023 · 0 comments · Fixed by #9402
Assignees
Labels
bug Something isn't working
Milestone

Comments

@jamezamm
Copy link

Hi,

I am using Visual Studio Enterprise 2022 (x64) Version 17.7.5.

I have the below tag helper classes:

/// <summary>
/// This is a container
/// </summary>
[HtmlTargetElement("container")]
public class ContainerTagHelper : TagHelper
{
	public override void Process(TagHelperContext context, TagHelperOutput output)
	{
	}
}

/// <summary>
/// This is a header
/// </summary>
[HtmlTargetElement("header", ParentTag = "container")]
public class ContainerHeaderTagHelper : TagHelper
{
        /// <summary>
        /// This is a test property
        /// </summary>
        public string Attribute { get; set; }

	public override void Process(TagHelperContext context, TagHelperOutput output)
	{
	}
}

The razor page syntax:

<container>
	<header attribute='test'></header>
</container>

Summary for Attribute property does not show when hovering the mouse over the attribute='test' in razor syntax.
Removing the ParentTag solves the issue.

@ghost ghost added the untriaged label Oct 11, 2023
@davidwengier davidwengier added this to the 17.9 P1 milestone Oct 12, 2023
@ghost ghost removed the untriaged label Oct 12, 2023
@davidwengier davidwengier self-assigned this Oct 12, 2023
@davidwengier davidwengier added the bug Something isn't working label Oct 12, 2023
davidwengier added a commit that referenced this issue Oct 12, 2023
Fixes #9397

The parent calculation for attributes was wrong, but without tag helper
rules, the calculation had no effect, so the bug didn't show up
anywhere.
@ghost ghost locked as resolved and limited conversation to collaborators Nov 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants