Add warning wave support and warn for unnecessary @ in component parameters#10346
Add warning wave support and warn for unnecessary @ in component parameters#10346jjonescz wants to merge 5 commits intodotnet:mainfrom
@ in component parameters#10346Conversation
|
I find this feature really bad for the Here is a quick try at removing the As you can see, the variable behind it is not recognized by the editor.
Please revise your plans for the warnings. And if you want to go forward, then at least fix the existing problem with the editor. |
|
@stsrki I think you misunderstood - this PR warns only about unnecessary Related docs: https://learn.microsoft.com/en-us/aspnet/core/blazor/components/?view=aspnetcore-8.0#component-parameters |
Can you give a few examples of such use cases that are going to be affected by this change? |
|
See this test for some examples: In short, if there's a component with attribute that's known to be of a non-string type, it's unnecessary to pass values with |

Resolves #9740.
Related (internal): https://github.com/dotnet/Razor-Language-Design/discussions/5
Commit-by-commit review might be useful.
The warning waves feature needs an SDK counterpart change to fully work (prototype here: dotnet/sdk#40720), but it shouldn't need any coordinated merging - without the SDK passing RazorWarningLevel through, the warnings simply stay disabled.