Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable formatting in ReSharper/Visual Studio

Is there a simple way to disable automatic formatting for a specific file in Visual Studio 2008 using ReSharper?

like image 525
Egor Pavlikhin Avatar asked Apr 10 '10 16:04

Egor Pavlikhin


People also ask

How do I turn off formatting in Visual Studio?

On the navigation options at the top select "Tools" and then select "Manage Extensions". I had CodeMaid, Visual Assist, and Rosalyn installed. Seems like an update start to cause these auto formatting issues. I disabled them and do this fixed it.

How do I stop Vscode formatting?

How do I turn off auto format in VS Code? Open VS Code editor and click the “Settings” icon. Search “Formatter” and select the formatter for which you want to disable auto format. Find the “Editor: Format On Save” option and uncheck the box next to it.

How do I enable formatting in Visual Studio?

To access this options page, choose Tools > Options from the menu bar. In the Options dialog box, choose Text Editor > C# > Code Style > Formatting.

How do I set rules in ReSharper?

Configure code formatting rules in optionsSelect ReSharper | Options from the main menu or press Alt+R O . Use the Code Editing | General Formatting Style page to check and to configure the options that apply in all languages.


2 Answers

AFAIK, there is no option to conditionally disable the Auto-Format by file type or specific file with ReSharper 4.5. The only option is to enable/disable for all files:

ReSharper > Options > Editor: Auto-format on semicolon/closing brace

like image 159
Metro Smurf Avatar answered Oct 01 '22 01:10

Metro Smurf


In ReSharper 7 (and few prior versions) you can specify generated files masks, those will not be formatted.

ReSharper->Options->Code Inspection->Generated Code->Generated file masks

For example if I have a file that contains reference data (as an array, for example), I call file for example States.data.cs and add *.data.cs to generated files masks list.

like image 30
THX-1138 Avatar answered Oct 01 '22 01:10

THX-1138