-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Area-IDEConcept-Continuous ImprovementIDE-CodeStyleBuilt-in analyzers, fixes, and refactoringsBuilt-in analyzers, fixes, and refactoringshelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on itThe issue is "up for grabs" - add a comment if you are interested in working on it
Milestone
Description
Version Used: VS 16.9.3
This is the most frequent ReSharper command that I use. Roslyn's code fix requires tedious cleanup because it generates five lines per parameter. The chances are not high that I'm going to start being okay with five lines per parameter. The contrast in friction is significant for me; with ReSharper, I'm not always cleaning up after I click.
using System;
public class C
{
public void M(object first, object second, object third)
{
if (first is null)
{
throw new ArgumentNullException(nameof(first));
}
if (second is null)
{
throw new ArgumentNullException(nameof(second));
}
if (third is null)
{
throw new ArgumentNullException(nameof(third));
}
Console.WriteLine($"{first}: {second} ({third})");
}
}I want exactly what ReSharper does with a single command (except I have to insert the blank line myself, so Roslyn could even beat ReSharper here):
using System;
public class C
{
public void M(object first, object second, object third)
{
if (first is null) throw new ArgumentNullException(nameof(first));
if (second is null) throw new ArgumentNullException(nameof(second));
if (third is null) throw new ArgumentNullException(nameof(third));
Console.WriteLine($"{first}: {second} ({third})");
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area-IDEConcept-Continuous ImprovementIDE-CodeStyleBuilt-in analyzers, fixes, and refactoringsBuilt-in analyzers, fixes, and refactoringshelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on itThe issue is "up for grabs" - add a comment if you are interested in working on it
Type
Projects
Status
Complete