Overview

The Plugin is a custom hosting environment for StyleCop which is invoked by ReSharper's IDaemonStage, IDaemonStageProcess interfaces. The StyleCop engine can, at this time, only process files rather than file contents, this leads to a particular problem when trying to achieve realtime syntax highlighting - that is, unless you constantly save the file, the contents of the code file within the IDE will become out of sync with the version on the File System that the StyleCop engine will process.

In the current version of the plugin, a shadow copy of the current source file is created in the current users temporary files area. This shadow copy is over-written with changes as they are made. The StyleCop engine analyses this shadow copy and any resulting violations are displayed in the IDE.

The Plugin also implements a scavenging algorithm to clean up the shadow copies to ensure that no space is wasted.

This version of the Plugin also tries to find and use the Settings.STYLECOP file of the project currently being analysed, this allows the plugin to display violations only of the rules you have enabled. This search algorithm is quite rudimentary and can easily be updated to be made a little more robust.



The latest release of StyleCop for ReSharper also includes the fundamentals of a Quick Fix framework to allow users to easily and automatically resolve StyleCop violations:



And also the ability to set different Inspection Severity settings for each StyleCop violation:



You can also change these settings via a Quick Fix:



Which spawns the following dialog:



You can also adjust the rate at which analysis on your code files are performed - this should help users with less powerful machines:



For more information about the origins of this plugin - see this blog post and this blog post

Read about StyleCop for ReSharper's Features

Last edited Jan 3, 2011 at 4:00 PM by HowardvanRooijen, version 4

Comments

No comments yet.