Search code examples
visual-studioeditorconfig

What's the difference between "Suggestion" and "Refactoring Only" in VisualStudio?


I am building my .editorconfig for my project. I see both "Suggestion" and "Refactoring Only" for several of the options. What is the difference between these?


Solution

  • From the documentation

    Violations of a Suggestion appear as build messages and as suggestions in the Visual Studio IDE; see the Messages section in the Error list.

    enter image description here


    The description for Silent applies to Refactoring only, as it will be saved as such in .editorconfig, e.g.:

    dotnet_naming_rule.interface_should_be_begins_with_i.severity = silent
    

    Violations of a Refactoring Only/silent rule aren't visible to the user, but the Quick Actions and Refactorings... menu shows an entry to resolve the violation (similarly as for Suggestion violations).

    A closed issue on the Microsoft Visual Studio documentation on GitHub says:

    Do not show anything to the user when this rule is violated. Code generation features generate code in this style, however. Rules with silent severity participate in cleanup and appear in the Quick Actions and Refactorings menu.