Resharper wishlist

Hyperlinks from ]]> tags in the XML comments.

The ability to select a number of classes as top level code (i.e. callable from outside of your solution) and have Resharper report on all unused code elements, even if those code elements are marked as public.

Similar to the above, but with the ability to "lock down" the code by analysing and giving every class, method, property and event the least privileged access (i.e. public, protected+internal, protected, internal, private.

Auto-complete for classes that are not in the currently scoped namespaces. (Currently I have to type the entire class name and then Resharper prompts to add the using directive - sigh).

Promote local to field.

Alt+Enter light-bulb to "Create overload".

Move method/property to another class (leaving delegating stub)

http://extraview.co.uk/cs/blogs/james_hebbens_blog/archive/2005/04/14/4.aspx

11 comments
Comment actions Permalink

Hello James,

JH> Hyperlinks from tags in the XML comments. Use "goto definition" feature. JH> Auto-complete for classes that are not in the currently scoped JH> namespaces. (Currently I have to type the entire class name and then JH>]]> Resharper prompts to add the using directive - sigh).
Use Ctrl-Alt-Space to select type with auto-import namespace.

Sincerely,
Ilya Ryzhenkov


0
Comment actions Permalink

Ctrl-Alt-Space. Ooh. That's sweet

0
Comment actions Permalink

Promote local to field.


Invoke "Introduce Field" (Ctrl-Alt-D) when on declaration of the local. Is
it what you want?


Move method/property to another class (leaving delegating stub)


How should it work? Where should it take the instance of the new class (for
delegating stub) and of the old class (in the body of the method)?

Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Hyperlinks from <see> tags in the XML comments.

The ability to select a number of classes as top level code (i.e.
callable from outside of your solution) and have Resharper report on
all unused code elements, even if those code elements are marked as
public.

Similar to the above, but with the ability to "lock down" the code by
analysing and giving every class, method, property and event the least
privileged access (i.e. public, protected+internal, protected,
internal, private.

Auto-complete for classes that are not in the currently scoped
namespaces. (Currently I have to type the entire class name and then
Resharper prompts to add the using directive - sigh).

Promote local to field.

Alt+Enter light-bulb to "Create overload".

Move method/property to another class (leaving delegating stub)

http://extraview.co.uk/cs/blogs/james_hebbens_blog/archive/2005/04/14/
4.aspx




0
Comment actions Permalink

First, Promote local to Field. I knew it did that. Not sure why I had forgotten. Thanks for the prompt.

Second, Move to class.

The initial (contrived) code contains a class Bar that uses data from Foo to calculate values


The refactored code contains a class Bar that uses an operation in Foo to calculate values. The only difference is in the new Foo.Diff property and the refactored Bar.Diff property, shown here.


The steps, as I see it, are:
1. Select a method, or selected block of code in a method.
2. Select Resharper | Refactor | Move to class.
3. Give class choice based on classes referenced in current method/code block selection.
4. Create new method/property in target class (Foo). Default name is the name of the source (Bar) method/property (user can override).
5. If the source method uses fields or locals, these must be passed as parameters to the new method (parameter could be an instance of the source class).
6. Move the body of the code from source to the new target method.
7. Remove the instance from all instance references to the target instance in the new target method (e.g. foo.Min => Min).

That's it ;))))). I am sure there are plenty of subtleties to this.

After this refactoring, it would be useful to have the following extra refactoring:
- Inline Method/Property, such that all code calling Bar.Diff now calls Foo.Diff directly.

0
Comment actions Permalink

IMHO your end game should be to support all of the refactorings in Martin Fowler's Refactoring book: http://www.amazon.co.uk/exec/obidos/ASIN/0201485672/202-2936304-4099851

0
Comment actions Permalink

Hello James,

Ctrl-Alt-Space. Ooh. That's sweet


James, check out:

http://www.jetbrains.com/resharper/documentation/1.5_ReferenceCard.pdf

Print this bad-boy out, put it on your desk, and abuse it ... you'll be a
ReSharper master in no time ... :-P

Best,

David Stennett
JetBrains, Inc.


0
Comment actions Permalink

Hello James,

JH>> Hyperlinks from tags in the XML comments. JH>>]]>

Use "goto definition" feature.


A faster method is to use ReSharper Ctrl+B shortcut (VB Goto Definition is
rather slow).

JH>> Auto-complete for classes that are not in the currently scoped
JH>> namespaces. (Currently I have to type the entire class name and
JH>> then Resharper prompts to add the using directive - sigh).
JH>>

Use Ctrl-Alt-Space to select type with auto-import namespace.

Sincerely,
Ilya Ryzhenkov

Thanks,
Andrey Simanovsky


0
Comment actions Permalink

Been using Ctrl+B for ever. It keeps working when VS Goto Definition fails miserably.

0
Comment actions Permalink

Hello Andrey,

JH>>> Hyperlinks from tags in the XML comments. JH>>> >> Use "goto definition" feature. AS> A faster method is to use ReSharper Ctrl+B shortcut (VB Goto AS>]]> Definition is rather slow).

I surely meant Resharper's feature :)

/Ilya


0
Comment actions Permalink

Thanks for your example. We'll consider adding this refactoring.

Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

First, Promote local to Field. I knew it did that. Not sure why I had
forgotten. Thanks for the prompt.

Second, Move to class.

The initial (contrived) code contains a class Bar that uses data from
Foo to calculate values

 namespace PreRefactor
> {
> internal class Foo
> {
> readonly double min;
> readonly double max;
> internal Foo(double min, double max)
> {
> this.min = min;
> this.max = max;
> }
> internal double Min
> {
> get { return min; }
> }
> internal double Max
> {
> get { return max; }
> }
> }
> internal class Bar
> {
> readonly Foo foo;
> internal Bar(Foo foo)
> {
> this.foo = foo;
> }
> internal double Diff()
> { return foo.Max - foo.Min; }
> }
> }
> ]]>


The refactored code contains a class Bar that uses an operation in Foo
to calculate values. The only difference is in the new Foo.Diff
property and the refactored Bar.Diff property, shown here.

 namespace PostRefactor
> {
> internal class Foo
> {
> ..
> ..
> internal double Diff()
> { return Max - Min; }
> }
> internal class Bar
> {
> ..
> ..
> internal double Diff()
> { return foo.Diff(); }
> }
> }
> ]]>


The steps, as I see it, are:

1. Select a method, or selected block of code in a method.

2. Select Resharper | Refactor | Move to class.

3. Give class choice based on classes referenced in current
method/code block selection.

4. Create new method/property in target class (Foo). Default name is
the name of the source (Bar) method/property (user can override).

5. If the source method uses fields or locals, these must be passed as
parameters to the new method (parameter could be an instance of the
source class).

6. Move the body of the code from source to the new target method.

7. Remove the instance from all instance references to the target
instance in the new target method (e.g. foo.Min => Min).

That's it ;))))). I am sure there are plenty of subtleties to this.

After this refactoring, it would be useful to have the following extra
refactoring: - Inline Method/Property, such that all code calling
Bar.Diff now calls Foo.Diff directly.




0
Comment actions Permalink

Here's another request - a simple HTML editor (with wysiwyg table editing).
The problem with all the other editors is that they deposit tons of junk in
the resulting HTML. Some of them don't even work - like the one in the VS.

The motivation is FIT - a testing framework driven through HTML tables.


0

Please sign in to leave a comment.