17

How to force resharper 6.0 to use tab instead of spaces during code clearup ?

Cœur
  • 37,241
  • 25
  • 195
  • 267
user656822
  • 1,167
  • 2
  • 12
  • 30

3 Answers3

12

ReSharper uses VS settings, it doesn't have own settings for this task. Go to Tools->Options->Text Editor->Necessary lang or All Languages->Tabs and select "Insert spaces" or "Keep tabs".

derigel
  • 3,218
  • 2
  • 19
  • 31
10

This is a bug in ReSharper. It typically uses the VS settings, but when aligning it always uses spaces and ignores the VS settings (particularly the Smart Tabs).

A request for a fix to this has been around since version 4, but is still not fixed in verstion 6 (the most recent release).

The bug is noted here: RSRP-150306 and here: RSRP-200204

Update: One thing you can do to work around this issue, after doing the ReSharper cleanup, you can use the VS formatting call to have it fix the tabs/spaces. The default shortcut for this is

  • Ctrl-K,Ctrl-D for the entire document
  • Ctrl-K,Ctrl-F for just the selected text.
Edyn
  • 2,409
  • 2
  • 26
  • 25
0

Another option is to install the Productivity Power Tools package (through NuGet or here) and then enable the 'Fix Mixed Tabs' option which offers you an option to Tabify or Spaceify files when it senses a mixture.

Unsliced
  • 10,404
  • 8
  • 51
  • 81