auto generate defaults

When I use R# 4.0's auto generate feature, to, for example, "implement missing members", it always defaults to implementing with "throw NotImplementedException();"

In R# 3.1, the default was "property with backing field"

I know this sounds nitpicky, but I probably auto generate implementations 20 times a day, and it would be great if I could set the default to generate "property with backing field". Is there any way to do this?

Thanks

6 comments
Comment actions Permalink

flannelboy wrote:

When I use R# 4.0's auto generate feature, to, for example,
"implement missing members", it always defaults to implementing with
"throw NotImplementedException();"

In R# 3.1, the default was "property with backing field"

I know this sounds nitpicky, but I probably auto generate
implementations 20 times a day, and it would be great if I could set
the default to generate "property with backing field". Is there any
way to do this?

Thanks


+1 for that!

--
by Peter Sulek at 30. 6. 2008 14:09:10
XanaNews 1.18.1.6

0
Comment actions Permalink

I ran into this as well. Spent some time trying to figure out how to fix it and gave up.

Glad I'm not the only one who thinks its a step backwards, and I really do hope this gets fixed soon.

0
Comment actions Permalink

-1 to changing the default. Having gone fully TDD in recent months, NotImplementedExceptions are exactly what I want by default.

+1 to making the default configurable so that all parties can be made happy. ;)

0
Comment actions Permalink

I saw that this post was made middle 2008 which got my hopes up, but as far as I can see the ability to set the default hasn't been added in R# 5. I for one would definately appreciate it!

0
Comment actions Permalink

Hello Christo,

After creating a property, ReSharper should show a pop-up menu with various
implementation possibilities (auto-property, property with backing field).
Could you please provide the scenario when ReSharper doesn't just inserts
the default implementation? Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

I saw that this post was made middle 2008 which got my hopes up, but
as far as I can see the ability to set the default hasn't been added
in R# 5. I for one would definately appreciate it!

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



0
Comment actions Permalink

Hi Andrey

Here’s an example of what I’d like to do.  Suppose I’ve just added a property “Name” to my interface. In the class  implementing this interface I press “Alt-INS” and select “Implement  missing members”.

img1.png

Now I get the Generate dialog. Most of the time (99%) I want to set “Properties as:” to “property with backing field”, but it always comes up with “throwing NotImplementedException” selected.

img2.png

Is there some way for me to change the default so that it comes up with “property with backing field” selected?

On a side note, I’d love it if there was an option to add the property as readonly and initialized it in the constructor, but this isn’t as important to me as setting the default once for the “Generate” dialog.

Thanks

Christo

0

Please sign in to leave a comment.