Noticed this today, trialing the new Remove unnecessary directives code action.
Today we have 3 distinct types of code actions - Html, C# and Razor. Remove unnecessary is a Razor code action, because @addTagHelper is a Razor construct, which makes sense. Unfortunately, the line of code @addTagHelper *, Foo also contains a C# string, the *, Foo bit, which means if the cursor is in that part of the directive, the code action doesn't even get asked whether it should run.
Possibly the fix here is to just always run Razor code actions, or maybe always run all of the code actions in our repo (as opposed to delegated ones from Roslyn and Html), or maybe we need something more tailored.
Noticed this today, trialing the new Remove unnecessary directives code action.
Today we have 3 distinct types of code actions - Html, C# and Razor. Remove unnecessary is a Razor code action, because
@addTagHelperis a Razor construct, which makes sense. Unfortunately, the line of code@addTagHelper *, Fooalso contains a C# string, the*, Foobit, which means if the cursor is in that part of the directive, the code action doesn't even get asked whether it should run.Possibly the fix here is to just always run Razor code actions, or maybe always run all of the code actions in our repo (as opposed to delegated ones from Roslyn and Html), or maybe we need something more tailored.