Implement members without throw new

Hello

Is it possible to implement member without having Resharper generating default "throw new notimplemented".
When implementing multiple members to an existing class, it would be easier to locate the new members, if the code wouldn't compile.

4 comments
Comment actions Permalink

I think this is an interesting idea, but should probably be driven by a configuration option. For example, in addition to the current insertion of "throw new NotImplemented" and the suggested "leave it so it won't compile", it also would be reasonable to insert a "TODO" comment.

I personally prefer the "throw new ..." approach (even though it does sometimes generate warnings and/or FxCop violations) as it allows me to incrementally add the code as it becomes necessary (depth-first TDD). However, I would like to see "TODO" comments added so I can easily find remaining locations without having to wait until they are encountered during development/testing.

On the other hand, the "code does not compile" approach is more inline with a breadth-first TDD.

Another approach may be to allow the customer to tailor the message in the generated exception: it could be something like "ReSharper generated placeholder" (or something like the inserted TODO message) to allow for easy searching, but allow the customer to override (or maybe append) some info to the generated text.

0
Comment actions Permalink

Hello Karsten,

Yes, this is planned.

Sincerely,
Ilya Ryzhenkov

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


IR> Hello
IR>
IR> Is it possible to implement member without having Resharper
IR> generating default "throw new notimplemented".
IR>
IR> When implementing multiple members to an existing class, it would be
IR> easier to locate the new members, if the code wouldn't compile.
IR>


0
Comment actions Permalink

Hello Karsten,

Sorry, I didn't notice it was Community newsgroup. What version of ReSharper
do you use?

Sincerely,
Ilya Ryzhenkov

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


IR> Hello
IR>
IR> Is it possible to implement member without having Resharper
IR> generating default "throw new notimplemented".
IR>
IR> When implementing multiple members to an existing class, it would be
IR> easier to locate the new members, if the code wouldn't compile.
IR>


0
Comment actions Permalink

Hello,

In R#3 and below, you can supply a freehand piece of code to be used as the
placeholder, see Live Templates in Options. This works nicely for all TODOs,
custom messages, and non-compilable code.

"Generate" in R#4 will have its own ways for configuring the thing, coming
soon.


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


0

Please sign in to leave a comment.