New version of previously released Netix Resharper Plugin is available. I'd
even say it is new plugin, so much has changed, so I gave it codename "NERPA".
General direction of the plugin would be "Suggest code improvemens", using
MS design guidelines, FxCop rules, common sense and your ideas. Another rationale
is to provide other plugin developers with some real examples.
It works for me under VS2003, but it has been told it will not work under
VS2005 due to API differences between .NET 1.1 and 2.0 versions. Since I
don't have VS2005, I can't make version for it. Also, plugin does not target
FW2.0 specific features yet. Finally, I'm too lazy to establish versioning
while so much changes every day, so I will use dates to number builds for
a while :)
different color ("Resharper Suggestion" in font/color options, name subject
to change), but otherwise behave like warnings. I hope it can be fixed soon,
see "Controlling custom highlightes" topic in this newsgroup.
--- Suggestions to rename fields, parameters and variables to conform to
coding style. Quick fix included.
--- Suggestion to rename parameters that are not named the same as parameter
from base class/interface. Quick fix included. Planned to include the opposite
quick fix (rename base parameter)
--- Avoid empty interfaces
--- Do not use general catch clause, do not catch general type 'Exception'.
Currently it doesn't check for rethrowing exception (using "throw;") which
is not a problem.
--- Types that own disposable fields should be disposable. Planned quick
fix to add IDisposable on the class and implement it.
--- Constructor of abstract type should be protected. Planned quick fix to
change constructor access.
--- Types with no externally visible constructors should not be abstract.
Planned quick fix to remove abstract and add sealed.
--- Types with no externally visible constructors should be sealed. Planned
quick fix to add sealed.
--- Static holder types should be sealed. Planned quick fix to add sealed.
--- Static holder types should not have externally visible constructors.
Planned quick fix to change constructor access.
window context menu).
Note, that guessing correct names is a kind of magic, so it may not work
for you code style settings. If it doesn't, please drop me a note along with
your prefix/suffix list.
Also note, that it doesn't yet check for correct casing on types and members.
Planned for future.
it has incorrect label "Verify naming style". It actually controls all suggestions.
Later I will separate them much like Resharper's own warnings configuration.
are given - create in same file and create as new file. Quickfix is available
in declarations and typeof expressions.
(i.e. left and right). Works on assignment '=' sign. Checks for left side
to be readable (e.g. not a property with setter only) and right side to be
writable (e.g. not readonly field outside of constructor). However, this
feature was not yet tested extensively.
Zip file contains dll and source code, size is 64kb.
1. Close all instances of VS
2. Copy Netix.Resharper.Plugin.dll so it is located in the folder "C:\Program
Files\JetBrains\ReSharper\VS2003\Plugins\Netix Resharper Plugin\"
3. Import highlighter.reg into registry
4. Start VS
5. Verify plugin listed using menu Resharper/Plugins...
Check Netix.Resharper.Test solution for some examples. Ensure you turned
"Verify naming style" on.
Source code is included, but I admit that I lost my way with IDeclaredElement
and IDeclaration hierarchies, so NetixCodeAnalyzer is complete mess of both.
I will try to clean this up in the next version.
Comments are welcome.