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 not working with tag helpers using ParentTag #9136

Closed
jamezamm opened this issue Aug 18, 2023 · 4 comments · Fixed by #9267
Closed

Razor intellisense not working with tag helpers using ParentTag #9136

jamezamm opened this issue Aug 18, 2023 · 4 comments · Fixed by #9267
Assignees
Milestone

Comments

@jamezamm
Copy link

Hi,

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

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
{
	public override void Process(TagHelperContext context, TagHelperOutput output)
	{
	}
}

The razor page syntax:

<container>
	<header></header>
</container>

For the container tag, intellisense works as expected. Meanwhile for the header tag, intellisense does not popup when hovering the mouse over the tag.

Removing the ParentTag solves the issue.

@davidwengier
Copy link
Contributor

Surprisingly, completion actually worked fine :)

@jamezamm
Copy link
Author

The above issue has been fixed. But another small issue remain.

Continuing on the above example:

Tag Helper Class:

/// <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)
	{
	}
}

Razor Page Syntax:

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

Summary for property Attribute does not show when hovering the mouse over the attribute in razor syntax.

@davidwengier
Copy link
Contributor

@jamezamm woukd you mind logging that as a new issue, so it doesn't get lost here

@jamezamm
Copy link
Author

New issue #9397 created.

@ghost ghost locked as resolved and limited conversation to collaborators Nov 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants