Use Virtual Formatter

Last modified: 30 July 2024

Although properly formatted code is easier to work with, there are several scenarios where code formatting might not correspond to your preferences, but reformatting the code is not an option:

  • You are reading third-party sources that have unusual formatting.

  • Your personal formatting preferences contradict formatting rules of a team-shared project that you are working on.

  • You want to avoid unnecessary changes to the source code because each change requires a review.

In such scenarios, Virtual Formatter comes in handy — it displays the source code in the editor according to your formatting preferences without actually changing its formatting.

When Virtual Formatter is enabled, you can configure its preferences using the following options on the Environment | Inlay Hints | Virtual Indenting page of ReSharper options :

This feature is supported in the following languages and technologies: