Feature ideas for ReSharper

Hi,

A few ideas that I've come up with for useful features in Resharper are:

1. Automatic Property generation - I suspect that this will be
achieveable with the Code Creation Template facility, but if not I
wanted to get a vote in for this. Creating a [public | internal |
protected] property with a related private member would be nice, as
would a "Create property for member" option which allows me to
right-click on some private class variable and automatically generate a
public (or whatever) property for it.

2. Observe the following code example, with | as the position of the caret:

int foo = this.CalculateIntFromVariable(someVariable|)

Now, at this point, there is no ; at the end of the line. However, if I
were to press ; I would suggest that ReSharper should add the ; to the
end of the line, i.e.:

int foo = this.CalculateIntFromVariable(someVariable);|

As that's most likely what I wanted as a coder. The only time I can
think of that a ; would stay inside brackets is during a 'for' loop, and
every other time I actually want the ; at the end of the line.

3. An example that I recall seeing in a Java IDE (I want to say Eclipse,
but I really don't know, might've been IntelliJ IDEA ;) ) was the option
to 'Extract strings'. This would pull all strings out of the class and
convert them into private static members, making internationalization
easier.

4. One thing I miss from Eclipse is "Organize imports". This would
remove all unnecessary imports, alphabetically sort and group into
sections the imports at the top of the Java class, and add imports for
classes which were not yet imported but which were referenced (e.g. if I
referenced a Hashtable but had not yet included System.Collections,
"Organize Imports" would add a reference to System.Collections for me).
As well, in the case of an ambiguous reference, it would show me a list
of imports that I could select from so that I could choose the correct one.

Thanks,

-=Straxus=-

4 comments
Comment actions Permalink

Hello David,

1. Automatic Property generation - I suspect that this will be
achieveable with the Code Creation Template facility, but if not I
wanted to get a vote in for this. Creating a [public | internal |
protected] property with a related private member would be nice, as
would a "Create property for member" option which allows me to
right-click on some private class variable and automatically generate
a public (or whatever) property for it.


Your "Create property for member" option is in the latest build. Hit ALT-INSERT to generate a constructor, read property, writer property or read-write property for member variables that you select.

Hopefully, I havent misunderstood your request.

I do agree with your request for creating a property with a related private member, and would anticipate that this will be coming soon.

--
Matt Berther

0
Comment actions Permalink

4. One thing I miss from Eclipse is "Organize imports". This would
remove all unnecessary imports, alphabetically sort and group into
sections the imports at the top of the Java class, and add imports for
classes which were not yet imported but which were referenced (e.g. if I
referenced a Hashtable but had not yet included System.Collections,
"Organize Imports" would add a reference to System.Collections for me).
As well, in the case of an ambiguous reference, it would show me a list
of imports that I could select from so that I could choose the correct

one.

Something like that is planned. Although I could not understand the
usefulness of usings insertion for unresolved references, did you see it?

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


"David Spade" <mines@home.com> wrote in message
news:c20qcr$bf3$1@is.intellij.net...

Hi,

>

A few ideas that I've come up with for useful features in Resharper are:

>

1. Automatic Property generation - I suspect that this will be
achieveable with the Code Creation Template facility, but if not I
wanted to get a vote in for this. Creating a [public | internal |
protected] property with a related private member would be nice, as
would a "Create property for member" option which allows me to
right-click on some private class variable and automatically generate a
public (or whatever) property for it.

>

2. Observe the following code example, with | as the position of the

caret:
>

int foo = this.CalculateIntFromVariable(someVariable|)

>

Now, at this point, there is no ; at the end of the line. However, if I
were to press ; I would suggest that ReSharper should add the ; to the
end of the line, i.e.:

>

int foo = this.CalculateIntFromVariable(someVariable);|

>

As that's most likely what I wanted as a coder. The only time I can
think of that a ; would stay inside brackets is during a 'for' loop, and
every other time I actually want the ; at the end of the line.

>

3. An example that I recall seeing in a Java IDE (I want to say Eclipse,
but I really don't know, might've been IntelliJ IDEA ;) ) was the option
to 'Extract strings'. This would pull all strings out of the class and
convert them into private static members, making internationalization
easier.

>

4. One thing I miss from Eclipse is "Organize imports". This would
remove all unnecessary imports, alphabetically sort and group into
sections the imports at the top of the Java class, and add imports for
classes which were not yet imported but which were referenced (e.g. if I
referenced a Hashtable but had not yet included System.Collections,
"Organize Imports" would add a reference to System.Collections for me).
As well, in the case of an ambiguous reference, it would show me a list
of imports that I could select from so that I could choose the correct

one.
>

Thanks,

>

-=Straxus=-



0
Comment actions Permalink

On Tue, 2 Mar 2004 13:02:24 +0300, "Valentin Kipiatkov \(JetBrains\)"
<valentin@intellij.com> wrote:

>Something like that is planned. Although I could not understand the
>usefulness of usings insertion for unresolved references, did you see it?

I find it quite useful. I often type in class names for things that I
want to use (for example XmlConvert) and then I have to go to the top
of the source file and add using System.Xml;. It saves time if there
is a feature that just sorts it all out for me - it was one of my
favourite features in JBuilder.

Simon.

0
Comment actions Permalink

I find it quite useful. I often type in class names for things that I
want to use (for example XmlConvert) and then I have to go to the top
of the source file and add using System.Xml;. It saves time if there
is a feature that just sorts it all out for me - it was one of my
favourite features in JBuilder.


There will be a separate feature for that. It will bring a small popup
suggesting to import the class (the same is in IDEA). It will be available
in the next build.

P.S. Right now you can use Ctrl-Alt-Space completion after class name to
insert usings. It also works for incomplete class names and completes all
class names independently of using directives.

"Simon Steele" <ssnews@softel.co.uk> wrote in message
news:f7r840554v8rnh7e0gnctqhmba1rcrpi04@4ax.com...

On Tue, 2 Mar 2004 13:02:24 +0300, "Valentin Kipiatkov \(JetBrains\)"
<valentin@intellij.com> wrote:

>

>Something like that is planned. Although I could not understand the
>usefulness of usings insertion for unresolved references, did you see it?

>

I find it quite useful. I often type in class names for things that I
want to use (for example XmlConvert) and then I have to go to the top
of the source file and add using System.Xml;. It saves time if there
is a feature that just sorts it all out for me - it was one of my
favourite features in JBuilder.

>

Simon.



0

Please sign in to leave a comment.