Changed IDE0059 codefix title in pattern matching#60822
Changed IDE0059 codefix title in pattern matching#60822CyrusNajmabadi merged 3 commits intodotnet:mainfrom DoctorKrolic:fix-codefix-title
Conversation
.../Core/CodeFixes/RemoveUnusedParametersAndValues/AbstractRemoveUnusedValuesCodeFixProvider.cs
Show resolved
Hide resolved
|
@DoctorKrolic Answered on Discord. Thanks! :) |
|
@CyrusNajmabadi please review |
Head branch was pushed to by a user without write access
|
@CyrusNajmabadi I checked failing integration tests and found out, that class Program
{
public static void Main()
{
var x = new Program();
}
}
class Program
{
public static void Main()
{
var _ = new Program();
}
}So the decision of whether should node be removed or changed to discard is fully implemented in codefixe's code. This method replaces all declaration patterns with type declarations: So in cases like var a = "str";
if (a is object obj)
{
}declaration pattern Considering this fact, I reverted logic of PR back to just checking for declaration pattern when deciding what codefix title to show |
|
@CyrusNajmabadi PTAL |
|
Thanks :) |
Fixes: #40002