Implement Interface Resharper Annoyances

If I add property to an interface, say I add string Name { get; } to IPerson, and then I navigate to an inheritor such as EnglishPerson, and I see the little red line now showing (since I havent created the property on the concrete class), so I hit the magical Alt+Enter and I get "Implement Members" and run that... Problem/Gripe it always give the "throw new NotImplementedException... and there are no refactoring to explicitly change such to a backing store property.. thus productivity killer! What would be nice (and consistent) is if I it prompted me to choose between notimplemented, auto property, or backing store property... This behaviour/functionality already exists in Resharper since I do working with an instance of EnglishPerson in some application code and do an assignment to a property which doesn't it gives me the 3 options to choose how to implement it!

Also what would be nice... If I'm working in a concrete class such as EnglishPerson which implements IPerson and add a property or method I would like to hit the refactor key and say "Declare in Interface"... similar to extract interface, but works with existing interfaces (if more than one let me choose) and works using the method/property currently in focus.


And off topic, if I fire up a popup window such as Todo Explorer or Unit Test Explorer, and focus goes back to the code editor (i.e. press Esc) whilst the window remains on top, how do I give focus back to the currently showing popup window(s) without remember the specific shortkey, essentially I want an alt+tab between code editor and popup windows? does such exist?

5 comments
Comment actions Permalink

Hello Xopolp,

1. Quick Fix (Alt-Enter) has some default behavior, and ability to configure
it is something we plan for some future version. You can hit Alt-Ins (Generate)
instead, choose Implement missing members and configure how to generate properties.

2. "Move to existing interface" is a refactoring called "Pull Members Up",
try it with Ctrl-Shift-R ("Refactor This" key).

3. It is Visual Studio shortcut, Windows.NextToolWindowNav, on my box it
is Alt-F7

Sincerely,
Ilya Ryzhenkov

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


IR> If I add property to an interface, say I add string Name { get; } to
IR> IPerson, and then I navigate to an inheritor such as EnglishPerson,
IR> and I see the little red line now showing (since I havent created
IR> the property on the concrete class), so I hit the magical Alt+Enter
IR> and I get "Implement Members" and run that... Problem/Gripe it
IR> always give the "throw new NotImplementedException... and there are
IR> no refactoring to explicitly change such to a backing store
IR> property.. thus productivity killer! What would be nice (and
IR> consistent) is if I it prompted me to choose between notimplemented,
IR> auto property, or backing store property... This
IR> behaviour/functionality already exists in Resharper since I do
IR> working with an instance of EnglishPerson in some application code
IR> and do an assignment to a property which doesn't it gives me the 3
IR> options to choose how to implement it!
IR>
IR> Also what would be nice... If I'm working in a concrete class such
IR> as EnglishPerson which implements IPerson and add a property or
IR> method I would like to hit the refactor key and say "Declare in
IR> Interface"... similar to extract interface, but works with existing
IR> interfaces (if more than one let me choose) and works using the
IR> method/property currently in focus.
IR>
IR> And off topic, if I fire up a popup window such as Todo Explorer or
IR> Unit Test Explorer, and focus goes back to the code editor (i.e.
IR> press Esc) whilst the window remains on top, how do I give focus
IR> back to the currently showing popup window(s) without remember the
IR> specific shortkey, essentially I want an alt+tab between code editor
IR> and popup windows? does such exist?
IR>


0
Comment actions Permalink

"Move to existing interface" is a refactoring called "Pull Members Up",


I think "pull members up" is a very unclear name for this refactoring. I keep myself asking all the time what this means. Perhaps you should consider renaming this to a more meaningful term?

0
Comment actions Permalink

Hello Urs,

Well, this is how it is called in Refactoring Catalog (http://www.refactoring.com/catalog/index.html)
and books. I agree it is not very clear, but it is adopted by community.

Sincerely,
Ilya Ryzhenkov

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


>> "Move to existing interface" is a refactoring called "Pull Members
>> Up",
>>
UE> I think "pull members up" is a very unclear name for this
UE> refactoring. I keep myself asking all the time what this means.
UE> Perhaps you should consider renaming this to a more meaningful term?
UE>


0
Comment actions Permalink

You are Pulling the members "Up" the inheritance hierarchy, from the class,
into the interface. If you think in terms of the object hierarchy, it makes
a bit more sense.

"Urs Eichmann" <no_reply@jetbrains.com> wrote in message
news:31092741.162141217238350599.JavaMail.jive@app4.labs.intellij.net...
>> "Move to existing interface" is a refactoring called "Pull Members Up",
>

I think "pull members up" is a very unclear name for this refactoring. I
keep myself asking all the time what this means. Perhaps you should
consider renaming this to a more meaningful term?


0

Please sign in to leave a comment.