Suggestion - make rename file to match class name number one

Routinely when I'm developing classes I copy previous ones and start altering them so the class isn't in use any where yet. When I use the alt+enter easy button on the class name I think it'd be much more beneficial for it to rank rename file to match class name as the number one result instead of removed unused class.

Also on that line I think the features of remove unuused class or class is never instantiated is becoming a nearly useless concept since inversion of control frameworks should be in charge of instantiated objects so IMO those options should be some of the last choices on the alt+enter easy button.

3 comments
Comment actions Permalink

Why not use Copy Type refactoring?

Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


IR> Routinely when I'm developing classes I copy previous ones and start
IR> altering them so the class isn't in use any where yet. When I use
IR> the alt+enter easy button on the class name I think it'd be much
IR> more beneficial for it to rank rename file to match class name as
IR> the number one result instead of removed unused class.
IR>
IR> Also on that line I think the features of remove unuused class or
IR> class is never instantiated is becoming a nearly useless concept
IR> since inversion of control frameworks should be in charge of
IR> instantiated objects so IMO those options should be some of the last
IR> choices on the alt+enter easy button.
IR>
IR> ---
IR> Original message URL:
IR> http://www.jetbrains.net/devnet/message/5257292#5257292


0
Comment actions Permalink

Chalk up another feature of R# I didn't know to use before now, but my point of renaming the file should take priority in general and that comment/remove methods should be low priority in the list since that's probably one of the last operations you would ever want to do. Especially generating lots of new classes, they won't be used anywhere yet so it's fairly disingenuous to recommend removing the class as the number option.

0
Comment actions Permalink

Hello,

This is a matter of personal practices and coding style, to a large amount.
For example, I rarely bother to rename files immediately (who cares about
file names when doing Goto Type / Goto Symbol), but eventually I'd run the
refactoring on a folder in Solution Explorer to sort the classes into corresponding
files automatically, in a bunch. On the other hand, many IOCing frameworks
have attributes to be used on classes, which in turn should have
on them -- thus, the IOC-instantiated classes are not mistaken to be unused
by ReSharper. Taking the two above things into account, we get a usage pattern
in which deleting the unused class is really the right thing to do. So, it
depends...


Serge Baltic
JetBrains, Inc — http://www.jetbrains.com
“Develop with pleasure!”


0

Please sign in to leave a comment.