You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Today when discovering tag helpers the tooling code explicitly does not include tag helpers annotated with
[EditorBrowsable(EditorBrowsableState.Never)]
:razor/src/Razor/src/Microsoft.AspNetCore.Razor.ProjectEngineHost/ProjectExtensions.cs
Line 52 in 49c8ee8
razor/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/CSharp/DefaultTagHelperDescriptorFactory.cs
Line 417 in 49c8ee8
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.The text was updated successfully, but these errors were encountered: