Some suggestions

Hello,

Here is a couple of suggestions for further versions of Resharper. Some of
these features can be implemented quite easily; others cannot, so it would
be nice to hear some "official" opinion before adding these requests to the
Tracker.

1) "Use default access modifier" code style setting.

Some people like to have explicit "private" modifier on class members,
others do not. Having an option which controls this would be nice.

2) Re-arrange class members.

I prefer to have my class members to follow in some specific order (e.g.
ctor first, public methods next, public properties thirst and so on...).

Resharper could provide a function to sort members according to some rules.
Surely this isn't very easy for implementation.

3) Put automatically generated members in appropriate places.

Even having no support for members re-order, Resharper can try to preserve
existing one. The idea is simple -- if you need to insert some new member
(e.g. a method or a field generated by Quick Fix) choose an appropriate
position for it in the source code. It seems to me that inserting the newly
created member after the last existing one with the same access modifier
will work pretty well.

4) Live templates: macro for arguments extraction.

While implementing a bunch of OnXXX methods for invoking appropriate event
handlers I found the following LT useful:

void On$EVENT$($END$)

{

if ($EVENT$ != null)

{

$EVENT$();

}

}

Ideally, I'd like to have a field where I can type method arguments
declaration, but after that the corresponding arguments should appear in
event handler invocation statement. So I need a macro which transforms text
like

[] , ... into [] ]]>, ....

Regards.


5 comments
Comment actions Permalink

Hi Maxim,

Thank you for suggestions.
Below are my comments on some of them:

>1) "Use default access modifier" code style setting.

Will be implemented shortly. Possible values of this option will be
- Always add redundant access modifiers
- Always remove
- Do not change

2) Re-arrange class members.


We have the plans for this feature, but there are a lot of styling problems.
For example, we should deal with possible region intersection

--
---
Eugene Pasynkov
Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Maxim Babenko" <mab@shade.msu.ru> wrote in message
news:c94bfv$r0v$1@is.intellij.net...

Hello,

>

Here is a couple of suggestions for further versions of Resharper. Some of
these features can be implemented quite easily; others cannot, so it would
be nice to hear some "official" opinion before adding these requests to

the

Tracker.

>

1) "Use default access modifier" code style setting.

>

Some people like to have explicit "private" modifier on class members,
others do not. Having an option which controls this would be nice.

>

2) Re-arrange class members.

>

I prefer to have my class members to follow in some specific order (e.g.
ctor first, public methods next, public properties thirst and so on...).

>

Resharper could provide a function to sort members according to some

rules.

Surely this isn't very easy for implementation.

>

3) Put automatically generated members in appropriate places.

>

Even having no support for members re-order, Resharper can try to preserve
existing one. The idea is simple -- if you need to insert some new member
(e.g. a method or a field generated by Quick Fix) choose an appropriate
position for it in the source code. It seems to me that inserting the

newly

created member after the last existing one with the same access modifier
will work pretty well.

>

4) Live templates: macro for arguments extraction.

>

While implementing a bunch of OnXXX methods for invoking appropriate event
handlers I found the following LT useful:

>

void On$EVENT$($END$)

>

{

>

if ($EVENT$ != null)

>

{

>

$EVENT$();

>

}

>

}

>

Ideally, I'd like to have a field where I can type method arguments
declaration, but after that the corresponding arguments should appear in
event handler invocation statement. So I need a macro which transforms

text

like

>

[<modifiers>] <type> <name>, ...

>

into

>

[<modifiers>] <name>, ....

>

Regards.

>
>


0
Comment actions Permalink

Hello, Eugene!

Thank you for quick response.

EPJ> Will be implemented shortly. Possible values of this option will be
EPJ> - Always add redundant access modifiers
EPJ> - Always remove
EPJ> - Do not change
Great.

EPJ> We have the plans for this feature, but there are a lot of styling
EPJ> problems.
Well, I understand this pretty well. Good luck!

Best regards.


0
Comment actions Permalink

3) Put automatically generated members in appropriate places.

>

Even having no support for members re-order, Resharper can try to preserve
existing one. The idea is simple -- if you need to insert some new member
(e.g. a method or a field generated by Quick Fix) choose an appropriate
position for it in the source code. It seems to me that inserting the

newly

created member after the last existing one with the same access modifier
will work pretty well.


I personally would prefer the current way of members insertion used by
create method quickfix and by extract method. They insert the generated
method right after the original method. It works better for me because I
prefer to put auxilary methods near to the code which use them. Would do
others think?

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


"Maxim Babenko" <mab@shade.msu.ru> wrote in message
news:c94bfv$r0v$1@is.intellij.net...

Hello,

>

Here is a couple of suggestions for further versions of Resharper. Some of
these features can be implemented quite easily; others cannot, so it would
be nice to hear some "official" opinion before adding these requests to

the

Tracker.

>

1) "Use default access modifier" code style setting.

>

Some people like to have explicit "private" modifier on class members,
others do not. Having an option which controls this would be nice.

>

2) Re-arrange class members.

>

I prefer to have my class members to follow in some specific order (e.g.
ctor first, public methods next, public properties thirst and so on...).

>

Resharper could provide a function to sort members according to some

rules.

Surely this isn't very easy for implementation.

>

3) Put automatically generated members in appropriate places.

>

Even having no support for members re-order, Resharper can try to preserve
existing one. The idea is simple -- if you need to insert some new member
(e.g. a method or a field generated by Quick Fix) choose an appropriate
position for it in the source code. It seems to me that inserting the

newly

created member after the last existing one with the same access modifier
will work pretty well.

>

4) Live templates: macro for arguments extraction.

>

While implementing a bunch of OnXXX methods for invoking appropriate event
handlers I found the following LT useful:

>

void On$EVENT$($END$)

>

{

>

if ($EVENT$ != null)

>

{

>

$EVENT$();

>

}

>

}

>

Ideally, I'd like to have a field where I can type method arguments
declaration, but after that the corresponding arguments should appear in
event handler invocation statement. So I need a macro which transforms

text

like

>

[<modifiers>] <type> <name>, ...

>

into

>

[<modifiers>] <name>, ....

>

Regards.

>
>


0
Comment actions Permalink

Hello Valentin,

VK> I personally would prefer the current way of members insertion used
VK> by create method quickfix and by extract method. They insert the
VK> generated method right after the original method. It works better
VK> for me because I prefer to put auxilary methods near to the code
VK> which use them. Would do others think?

For methods, this is sometimes good, and sometimes (for example, when I create a method from a constructor or a property) not. I'd very much like to have a simple way to rearrange methods when the default location does not suit me. For example, a structure list where I could drag methods around would be great. Another option is to have keyboard shortcuts "move current method down" and "move current method up", which would swap the current method with the previous or next method.

Sorting methods according to some rules would not be useful for me - I prefer to sort methods logically and not according to some formal criteria.

However, the default location is almost never good for fields - all fields should be grouped together. I've already filed a request for this.

--
Dmitry Jemerov
OmniaMea Project Leader
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

4) Live templates: macro for arguments extraction.


It would be even better to featch parameters automatically from the event
type declaration.

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


"Maxim Babenko" <mab@shade.msu.ru> wrote in message
news:c94bfv$r0v$1@is.intellij.net...

Hello,

>

Here is a couple of suggestions for further versions of Resharper. Some of
these features can be implemented quite easily; others cannot, so it would
be nice to hear some "official" opinion before adding these requests to

the

Tracker.

>

1) "Use default access modifier" code style setting.

>

Some people like to have explicit "private" modifier on class members,
others do not. Having an option which controls this would be nice.

>

2) Re-arrange class members.

>

I prefer to have my class members to follow in some specific order (e.g.
ctor first, public methods next, public properties thirst and so on...).

>

Resharper could provide a function to sort members according to some

rules.

Surely this isn't very easy for implementation.

>

3) Put automatically generated members in appropriate places.

>

Even having no support for members re-order, Resharper can try to preserve
existing one. The idea is simple -- if you need to insert some new member
(e.g. a method or a field generated by Quick Fix) choose an appropriate
position for it in the source code. It seems to me that inserting the

newly

created member after the last existing one with the same access modifier
will work pretty well.

>

4) Live templates: macro for arguments extraction.

>

While implementing a bunch of OnXXX methods for invoking appropriate event
handlers I found the following LT useful:

>

void On$EVENT$($END$)

>

{

>

if ($EVENT$ != null)

>

{

>

$EVENT$();

>

}

>

}

>

Ideally, I'd like to have a field where I can type method arguments
declaration, but after that the corresponding arguments should appear in
event handler invocation statement. So I need a macro which transforms

text

like

>

[<modifiers>] <type> <name>, ...

>

into

>

[<modifiers>] <name>, ....

>

Regards.

>
>


0

Please sign in to leave a comment.