roslynator
roslynator copied to clipboard
Feature Request for Introduce local variable (RR0068): Make it easy to choose if you want to use the var keyword or explicit type when introducing variable.
When introducing a local variable, I often find it useful to explicitly declare the type, rather than using the var keyword.
This is especially true when I work with unfamiliar libraries, write complex LINQ queries, or write fluent code.
A gif demonstrating Reharper's "Introduce variable" feature can be found here: https://imgur.com/La7WZz6
This showcases how it starts by letting you edit the variable type (defaults to var, but easily lets you change to the concrete type), then lets you type the variable name. It is this workflow I really would love to see in Roslynator.
Alternatively, an option in the settings to have Roslynator always default to declare the concrete type rather than var would also be great.
+1