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

IDE / CommandLine tag helper discovery differ #11089

Open
chsienki opened this issue Oct 25, 2024 · 1 comment
Open

IDE / CommandLine tag helper discovery differ #11089

chsienki opened this issue Oct 25, 2024 · 1 comment

Comments

@chsienki
Copy link
Contributor

chsienki commented Oct 25, 2024

Today when discovering tag helpers the tooling code explicitly does not include tag helpers annotated with [EditorBrowsable(EditorBrowsableState.Never)]:

->

The command line compiler includes these tag helpers, which can lead to a difference in the generated code between IDE and runtime. A simple example is the <body> tag helper https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.razor.taghelpers.bodytaghelper?view=aspnetcore-8.0 which is hidden. In an MVC document with a <body> tag, it will be considered a tag helper at runtime, but not at design time. The current emit strategy does not emit any of the tag helper machinery if there are no referenced tag helpers, so you end up with a large difference in what code is eventually generated.

We should continue to read the EditorBrowseable state, but rather than excluding them completely, set a flag on the TagHelper indicating it is hidden. We can then update tooling to exclude it from things like Completion and Semantic Tokens, but still generate the same code as runtime.

@DustinCampbell
Copy link
Member

Excellent point!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants