
agentjohnsonplugin
Agent Johnson Plugin
Plugin for JetBrains Resharper.
Named after the excellent Agent Smith plugin by Sergey Zyuzin.
Agent Johnson 2.0.5 for Resharper 7.1
Upgraded Agent Johnson to the latest version of Resharper.
Agent Johnson 2.0.0 Configuration Changes in Resharper 6.1
The options page has been reintroduced in version 2.0.2.
Agent Johnson uses custom attributes on the assembly to configure Code Annotations, much the same way Value Analysis attributes are used.
Include a class like this (the namespace does not matter as it only looks for the class name): ``` [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true, Inherited = true)] public sealed class ReSharperSettingAttribute : Attribute { public ReSharperSettingAttribute(string name, object value) { this.Name = name; this.Value = value; }
public string Name { get; set; } public object Value { get; set; } } ```
and add these lines to the AssemblyInfo.cs file (or any other file for that matter):
[assembly: ReSharperSetting("IntroduceStringConstant.GenerateXmlComments", true)]
[assembly: ReSharperSetting("IntroduceStringConstant.ReplaceMode", 1)]
[assembly: ReSharperSetting("IntroduceStringConstant.TargetClass", "Product.Texts")]
[assembly: ReSharperSetting("CodeAnnotations.PublicAssertion", "Assert.ArgumentNotNull({0}, \"{0}\");")]
[assembly: ReSharperSetting("CodeAnnotations.NonPublicAssertion", "Debug.ArgumentNotNull({0}, \"{0}\");")]
This makes it possible to have different settings per project and removes the configuration hell.
Agent Johnson 2.0.1
Agent Johnson 2.0.1 for Resharper 6.1 is now available.
Change Log:
Version 2.0.2 * Reintroduced the Options page * Bug fixing
Version 2.0.1 * Bug fixing * Configuration using ResharperSetting attributes
Beta 4: * Various bug fixes.
Beta 3: * Found and worked around a race condition in Resharper that causes Visual Studio to freeze. * Added "Use 'as' operator" and "Use cast operator" context actions.
Beta 2: * Fixed a critical issue with Value Analysis and return values.
Known issue:
- Options for Value Analysis and Introduce String Constant are not persisted.
Features
- Introduce string constant
- Duplicate method
- Reverse for-loop
- Catch exceptions
- Use string.Compare
- Use StringBuilder
- Add uncaught exceptions to Xml-doc comments
- Add Xml-doc comments for thrown exception
- Negate 'if' condition
- Make virtual method abstract
- Make abstract class virtual
- Annotate with Value Analysis attributes
- Pull method parameters
- Smart Generate
- Use 'as' operator
- Use cast operator
Resharper 6
Agent Johnson will be split in two parts - a Resharper Abstraction Layer and the actual refactoring code (Agent Johnson).
The Abstraction Layer will not be a general abstract layer of all the Open API - it will solely support Agent Johnson (BTW I think Jetbrains should do an easy to work with layer).
I do not intent to implement all the functionality of Agent Johnson 1 in Agent Johnson 2. Some of the stuff is too obscure and just makes upgrading difficult.
Agent Johnson 1 features that will not be implemented- Invert Return Value
- Implement ISerializable.
- Implement ICloneable.
- Implement IDisposable.
- Implement proxy class.
- Assert assignment
- Assert return value
- Check if the result of an assignment is null
- Check if the result of an string assignment is null or empty
- Replace "" with string.Empty
- Generate Switch statement
- Sort switch cases
- Favorite Files
Current Version
Version 2.0.2, May 14. 2012.
Resharper version 6.1.1000.82
Project Information
- License: GNU GPL v2
- 79 stars
- svn-based source control
Labels:
Resharper
JetBrains
CSharp
VisualStudio
Plugin
IDE
Refactoring