1

Is there a way to disable auto-formatting (I assume that ReSharper is responsible for this) when working with json files (but not .cs files!) in VS? Typically when working with appsettings.json. Every time I press Enter (new line), all the white spaces basically disappear. However, when I do the clean-up, the whole file is formatted exactly as I want. This is driving me crazy as I have to do the code clean-up after every change in a json file, so it is readable.

EDIT: Here are the screenshots:

Before ENTER

After Enter:

After ENTER

After clean-up:

After Clean-up

  • I'm afraid I don't completely understand "all the white spaces" disappear. Could you please attach a screenshot with Edit>Advanced>View White Space turned on? Also an image after clean-up would be useful. Thanks! – Dmitry Osinovskiy Nov 22 '19 at 18:58
  • @DmitryOsinovskiy I added the screenshots to the question. Thanks! :) – MichalDurista Nov 23 '19 at 18:57
  • Unfortunately, I cannot reproduce the problem. Which versions of VS and R# do you use? Do you have other extensions installed? Could you try to suspend R# (Tools>Options>ReSharper ...>Suspend Now) and see if you can still reproduce it. If no, R# is really to blame. Resume R# and be sure that you use R#'s code cleanup, not VS's one (try Extensions>ReSharper>Edit>Cleanup Code>Built-in: Full Cleanup). Do you have the same "After clean-up" results? Also try: go to Extensions>ReSharper>Options>Environment>Editor>Behavior, disable Smart indent on enter and set Auto-insert closing brace to none. – Dmitry Osinovskiy Nov 24 '19 at 00:22

0 Answers0