Generate delegating methods into region
Any chance the 'generate delegating methods' code generator could prompt
for an optional region name to put the stuff into? This often
generates a lot of broilerplate code that has to be generated over and
over again. More useful even would be a way to embed some metadata
inside the region name or comments within the region that would allow a
quick right-click->regenerate or something to regenerate all the
delegating methods for the types selected in the original code gen.
We're using this for implementing the decorator pattern (which is a real
pain to do with out this type of code generation) but when we change our
interfaces we then have to go through all the files and regen the right
stuff. The first major pain is having to delete all the stuff correctly
(which would be made easy by the region) and the second major pain is
having to pick the field to gen for and the interfaces to gen on again
(when they are almost always the same.)
Please sign in to leave a comment.
That gets my vote. I'd love to see some features in RS that allow me to
rearrange the order of the code, especially if that let me define regions
too. We use standard regions for constructors, members, methods, properties
etc...and their static equivalents. That would be a real nice 'cherry on
the cake'.
Or, is that what Jetbrains mean when in the features page:
"File structure view with regions, drag&drop etc "
However, on the RS 2 paln page (http://www.jetbrains.net/confluence/display/ReSharper/ReSharper2.0Plan)
they say it's implemented....maybe so in 210?
I think the file structure popup would be a great place from which to organise
the code ordering.
Sean
>> Any chance the 'generate delegating methods' code generator could
>> prompt
>> for an optional region name to put the stuff into? This often
>> generates a lot of broilerplate code that has to be generated over
>> and
>> over again. More useful even would be a way to embed some metadata
>> inside the region name or comments within the region that would allow
>> a quick right-click->regenerate or something to regenerate all the
>> delegating methods for the types selected in the original code gen.
>> We're using this for implementing the decorator pattern (which is a
>> real pain to do with out this type of code generation) but when we
>> change our interfaces we then have to go through all the files and
>> regen the right stuff. The first major pain is having to delete all
>> the stuff correctly (which would be made easy by the region) and the
>> second major pain is having to pick the field to gen for and the
>> interfaces to gen on again (when they are almost always the same.)
>>
The implemented feature is called "File Structure View". You can drag-drop
members there to reorder them, enclose into region, etc. But currently there
is no any automatic member reordering according to any pattern. This
auto-reordering will be implemented once, but I doubt it will be in 2.0
--
Eugene Pasynkov
Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Sean K" <no@response.com> wrote in message
news:adc66bd2a048c7b7811cded9b8@news.jetbrains.com...
>
>
>
>
>> That gets my vote. I'd love to see some features in RS that allow me
>> to rearrange the order of the code, especially if that let me define
>> regions too. We use standard regions for constructors, members,
>> methods, properties etc...and their static equivalents. That would be
>> a real nice 'cherry on the cake'.
>>
>>> Any chance the 'generate delegating methods' code generator could
>>> prompt
>>> for an optional region name to put the stuff into? This often
>>> generates a lot of broilerplate code that has to be generated over
>>> and
>>> over again. More useful even would be a way to embed some metadata
>>> inside the region name or comments within the region that would allow
>>> a quick right-click->regenerate or something to regenerate all the
>>> delegating methods for the types selected in the original code gen.
>>> We're using this for implementing the decorator pattern (which is a
>>> real pain to do with out this type of code generation) but when we
>>> change our interfaces we then have to go through all the files and
>>> regen the right stuff. The first major pain is having to delete all
>>> the stuff correctly (which would be made easy by the region) and the
>>> second major pain is having to pick the field to gen for and the
>>> interfaces to gen on again (when they are almost always the same.)
>>>
>
Eugene
Thanks very much for pointing that out - love it, a fantastic feature and
just what I needed! I'll resist the temptation to rave on about how much
I can't live without RS :)
Thanks again for your that!
Regards
Sean
I realize the first reply was in regards to this, but can you answer my
questions at the root of the thread?
Eugene Pasynkov (JetBrains) wrote:
I see.
Automatic generation of methods into specific region will not be implemented
in 2.0.
We are considering to do this in 2.x
--
Eugene Pasynkov
Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Greg Fodor" <greg@parature.com> wrote in message
news:dledr7$bac$1@is.intellij.net...
>I realize the first reply was in regards to this, but can you answer my
>questions at the root of the thread?
>
>> The implemented feature is called "File Structure View". You can
>> drag-drop members there to reorder them, enclose into region, etc. But
>> currently there is no any automatic member reordering according to any
>> pattern. This auto-reordering will be implemented once, but I doubt it
>> will be in 2.0
>>