Some suggestions: reformat code / declaring local variables / code snippets

I use resharper 2.5 daily (except for ASP.NET projects - too many bugs there :( ) and am generally very pleased with it. I thought I want to write down some suggestions I collected in the past few weeks:

- In "reformat code", provide an option to reorder code blocks (e.g. 1 fields, 2 events, 3 methods, 4 inner classes. There should be options to order after visiblility, alphabetic etc.)

- I love the great Feature Ctrl+N, where you can search for Types using camel-cased letters only. Sadly I can only JUMP to the found types. What I actually want to do is just USE them in my code, so there should be an option to paste the found type into the current editor window. Of course the using statements should be inserted as well if appropriate.

- There could be some help when declaring a local variable: Suggestion: When I type a Type name such as "WorkflowRuntime" (or choose it from the intellisense list) and hit some shortcut, R# should insert "wr = new WorkflowRuntime();". Thus it should a) derive the local variable name out of the camelcased letters and b) insert a default constructor

- I prefer using the built-in Visual Studio 2005 Code Snippets and don't use the R# live templates, since some of my team members don't use R# and we still want to have a shared code snippet library. R# should be improved to better work together with the VS Code Snippets. The following problems arise:
a) The code snippets don't show up in the R# intellisense, this means I cannot use R# intellisense at all
b) When R# provides Alt+Enter help during inserting a code snippet (e.g. to insert an using directive) and I accept that help, the code snippet edit mode is "gone" after that

perhaps some of these suggestions will make it into a future version? I'm sure I'm not the only one who would benefit of these.

Best regards
Urs

1 comment
Comment actions Permalink

Some comments... have you played around with the ClassName completion in
Resharper? The Ctrl-Shift-Space and Ctrl-Alt-Space variants of Ctrl-Space
completion?

Also, have you investigated the Extract-Variable (Alt-V) refactoring? I
frequently just type an expression, hit Alt-V, and let Resharper provide the
local variable declaration and naming. It works very well.

Also, why do you prefer the Visual Studio code snippets? The Resharper ones
are vastly superior in every way (especially noticable when using 'foreach'
expansion).


"Urs Eichmann" <urs.eichmann@hsr.ch> wrote in message
news:2434802.1167980210330.JavaMail.itn@is.intellij.net...
>I use resharper 2.5 daily (except for ASP.NET projects - too many bugs
>there :( ) and am generally very pleased with it. I thought I want to
>write down some suggestions I collected in the past few weeks:
>

- In "reformat code", provide an option to reorder code blocks (e.g. 1
fields, 2 events, 3 methods, 4 inner classes. There should be options to
order after visiblility, alphabetic etc.)

>

- I love the great Feature Ctrl+N, where you can search for Types using
camel-cased letters only. Sadly I can only JUMP to the found types. What I
actually want to do is just USE them in my code, so there should be an
option to paste the found type into the current editor window. Of course
the using statements should be inserted as well if appropriate.

>

- There could be some help when declaring a local variable: Suggestion:
When I type a Type name such as "WorkflowRuntime" (or choose it from the
intellisense list) and hit some shortcut, R# should insert "wr = new
WorkflowRuntime();". Thus it should a) derive the local variable name out
of the camelcased letters and b) insert a default constructor

>

- I prefer using the built-in Visual Studio 2005 Code Snippets and don't
use the R# live templates, since some of my team members don't use R# and
we still want to have a shared code snippet library. R# should be improved
to better work together with the VS Code Snippets. The following problems
arise:
a) The code snippets don't show up in the R# intellisense, this means I
cannot use R# intellisense at all
b) When R# provides Alt+Enter help during inserting a code snippet (e.g.
to insert an using directive) and I accept that help, the code snippet
edit mode is "gone" after that

>

perhaps some of these suggestions will make it into a future version? I'm
sure I'm not the only one who would benefit of these.

>

Best regards
Urs



0

Please sign in to leave a comment.