Skip to content

IDE / CommandLine tag helper discovery differ #11089

Open
@chsienki

Description

@chsienki

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.

Activity

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions