2

Recently I have started using ReSharper 6.1, which neatly complements StyleCop which I have already used extensively.

One of the best features of R# to me are:

  • the on-line hightlighting of violations and
  • decompiling framework or third party assemblies directly in Visual Studio

Unfortunately the violation highlighting in decompiled code (LINQ extension methods, etc) is nothing but clutter, as the decompiled files are read-only (which is good).

I know that a work-around is to use Ctrl+Alt+Shift+8 to temporarily disable the highlighting per-file, but I am looking for a more permanent solution..

The Question: Is there an official way or a workaround to disable highlighting for read-only/locked files or alike? Also a link to the bug report/feature request would be much appreciated if this is a bug/missing feature as I am not sure whether this belongs to "Stylecop for Resharper" or Resharper. (Neither project's bugtracker seems to have anything on this.)

M.Stramm
  • 1,289
  • 15
  • 29
  • 1
    When I get R# to decompile `Console.WriteLine`, R# itself offers no analysis of the decompiled code, so I would guess this is StyleCop. – AakashM Feb 24 '12 at 13:29
  • This similar question may help you: http://stackoverflow.com/q/612651/275751 – Piers Myers Feb 24 '12 at 15:30
  • 1
    Great question. I suggest that you contact stylecop developers with this. ReSharper itself doesn't show any code inspections in decompiled code. – Jura Gorohovsky Feb 24 '12 at 17:45

2 Answers2

1

You can exclude files or even whole directories by adding them to the Resharper->Options->Code Inspection->Settings->Edit Items to Skip. (This is for Resharper 5.1 but I am sure it's the same for 6.1 too)

enter image description here

Piers Myers
  • 10,611
  • 6
  • 46
  • 61
  • 1
    "Edit items to skip" won't help in this case because it allows filtering out specific files and folders that are part of a project structure, or filtering out files by mask - none of which covers the scenario with decompiled code files that (1) are stored in a folder called "JbDecompilerCache" within a project-specific cache folder, (2) don't have a common pattern in their names that you could use to filter them out. – Jura Gorohovsky Feb 24 '12 at 17:41
  • Aye, this does not help with decompiled code. And neither with the more general case of read-only/locked files :\ – M.Stramm Feb 28 '12 at 00:26
1

I have filed a ticket on StyleCop's Issue Tracker. The feature might actually get was added :)

link to the issue

There now is an option to analyse decompiled files, which is off by default.

M.Stramm
  • 1,289
  • 15
  • 29