REQUEST: Product Feature - Ability to create a new class by rt-clicking on existing class as a base

Please add a menu item that allows one to right-click on an existing .cs file (or class type) and generate a new class that is derived off the class in that file (or selected). The new class will be named using the base class name and can be modified before the action is complete. The new class will be derived from the base selected.

If the .cs file has more than 1 class/struct defined, ask the user to select which one.

*This is a feature in Eclipse, if you want an example

5 comments
Comment actions Permalink

Hello Jeff
     Right now you can invoke the context actions menu on a type (Alt+Enter) and click 'Create derived type' which should do exactly what you need. Let me know if this helps. Thank you!

Andrey Serebryansky

Senior Support Engineer

JetBrains, Inc

http://www.jetbrains.com

"Develop with pleasure!"

0
Comment actions Permalink

Well, it doesn't do EXACTLY what I want, but it is close....

It does functionally create a new type but that type is in the same file AND I have to be editing the file to select the type in order to create it.

Part of ReSharper's value to me is the convenience of its functions.

Please add this functionality to the selection of a file and of a type in Class View.
Then, it will be exactly what I want.
Check out Eclipse for an example of how this is implemented.

I'm sure these small additions are easy for your devs to do.

Thanks!
Jeff

0
Comment actions Permalink

To create a derived class in a separate file:
1. Cursor on base class
2. Alt+Enter
-> Shows context menu with "Create derived type"
3. Enter
-> Derived type is created in same file. Cursor is on derived type.
4. Alt+Enter
-> Shows context menu with "Move to another file to match type name"
5. Enter
-> Derived type is moved to a new file with same name as the derived type.

Ok not so comfortable as in Eclipse, but acceptable.



P.S.: I like that ReSharper places the cursor _always_ on the right position.

0
Comment actions Permalink

Thanks. It is a creative way to do it.

Still doesn't solve the problem of not wanting to open the file to create a derived type...
...and it's not so convenient.

I'm hoping the JetBrains people can make ReSharper make VS.NET as good as Eclipse for such things.
(Then we VS.NET people can get some bragging rights)

-J.

0
Comment actions Permalink

From anywhere, just hit Ctrl-T and type the name of the type you want to
derive from.  No searching for it or manually having to navigate to it and
open it.  The cursor is placed, so you can then do the refactorings to
create the derived type and move it to its own file.  "Go to type" is highly
useful.


"Jeff Mounce"  wrote in message
news:13841202.114321327659587199.JavaMail.devnet@confluence.jetbrains.net...

Thanks. It is a creative way to do it.

Still doesn't solve the problem of not wanting to open the file to create a
derived type...
..and it's not so convenient.

I'm hoping the JetBrains people can make ReSharper make VS.NET as good as
Eclipse for such things.
(Then we VS.NET people can get some bragging rights)

-J.

---
Original message URL: http://devnet.jetbrains.net/message/5450308#5450308

0

Please sign in to leave a comment.