Showing posts with label ReSharper. Show all posts
Showing posts with label ReSharper. Show all posts

Saturday, 9 August 2014

ReSharper keyboard shortcuts stopped working

This post applies to ReSharper 8.2 running in Visual Studio Professional 2013 (12.0.30501.00 Update 2).

I’ve been installing a few Visual Studio extensions and ReSharper plugins recently and when I started Visual Studio this morning I found that the ReSharper keyboard shortcuts had stopped working. No problem though, it turned out to be an easy fix.

If you get this problem simply follow these steps:

  1. Go to ReSharper > Options.
  2. Locate Keyboard and Menus under the Environment section.
  3. I choose the Visual Studio keyboard scheme but you choose what’s appropriate to you.
  4. Click the Apply Scheme button.

That should be it. You may be prompted by ReSharper the first time you use certain ReSharper shortcuts to confirm what you want to do but this process has reset the ReSharper keyboard scheme.

 

image

Thursday, 17 April 2014

Modifying layout and formatting rules in ReSharper

We use StyleCop to implement some of our coding standards. Although in the main we use StyleCop defaults there are a few exceptions for which we have created custom rules. I found that some of ReSharper’s formatting and layout rules clash with our StyleCop rules.

What follows is a description of how I set about changing a couple of those ReSharper formatting and layout rules.

Using directives before namespaces


There may be arguments for putting using directives inside the namespace but our standards – and my preference - require they appear at the top of the file. I’m not alone in this.

By default when ReSharper helps out by adding using directives for you it adds them inside the namespace. To make ReSharper follow this convention I did this:
  1. In Visual Studio go to ReSharper > Options.
  2. Navigate to Code Editing > C# > Namespace Imports.
  3. Deselect “Add using directives to the deepest scope”.
  4. Save the changes.



Private instance fields prefixed with an underscore


To add an underscore to private instance fields do the following:
  1. In Visual Studio go to ReSharper > Options.
  2. Navigate to Code Editing > C# > Naming Style.
  3. Double-click on “Instance Fields (private).
  4. Add a Name Prefix and click Set.
  5. Save the changes.

   


Don't use 'this' qualifier for instance members

 

To prevent ReSharper from including "this." for instance members:

  1. In Visual Studio go to ReSharper > Options.
  2. Navigate to Code Editing > C# > Formatting Style > Other.
  3. Scroll down to "Force "this." qualifier for instance member" and select "Do not use" from the dropdown list.
  4. Save the changes.




Saturday, 12 January 2013

ReSharper plugins folder on Windows 7

Here’s a quick reminder that applies to ReSharper 5.1 in Visual Studio 2010 on Windows 7.

ReSharper plugins on Windows 7 live in the following location:

C:\Users\<User Name Here>\AppData\Roaming\JetBrains\ReSharper\v5.1\vs10.0\Plugins\