Code Syntax Style: Named/Positional Arguments

Last modified: 25 September 2024

If you prefer to use named arguments for specific types of parameters, ReSharper can help you enforce this practice.

Consider the following method call:

When you read this code, you have to stop and study the method signature to understand what happens here (you can do it either with the parameter information tooltip or by navigating to method declaration). With named arguments, the same call becomes much clearer:

If you prefer to have named arguments for specific types, you can enforce this preference with the help of ReSharper.

ReSharper helps you arrange arguments in the existing code and takes your preferences into account when it produces new code with code completion and code generation features, applies code templates and performs refactorings.

This feature is supported in the following languages and technologies: