Prevent method code formatting after refactoring

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Prevent method code formatting after refactoring

Vladimir Pogorelenko
When I do refactoring like Extract method, my current method is being  
reformatted in bad way.

Is there any way to prevent code formatting after refactoring? Or may  
be I can reformat code with another formating style?

What parcels or store bundles I can load for that?

Reply | Threaded
Open this post in threaded view
|

Re: Prevent method code formatting after refactoring

Karsten Kusche
Hi Vladimir,

i think you can't prevent it, but you may want to try the settings tool
for the code formatter. iirc you can find it by searching for "format"
in the refactoring browser...it'll list a lot of classes and the code
formatter setting thing is one of these classes.

Good luck
Karsten




Vladimir Pogorelenko wrote:
> When I do refactoring like Extract method, my current method is being
> reformatted in bad way.
>
> Is there any way to prevent code formatting after refactoring? Or may
> be I can reformat code with another formating style?
>
> What parcels or store bundles I can load for that?
>
>

--
Karsten Kusche - Dipl.Inf. - [hidden email]
Georg Heeg eK - Köthen
Handelsregister: Amtsgericht Dortmund A 12812

Reply | Threaded
Open this post in threaded view
|

Re: Prevent method code formatting after refactoring

Andre Schnoor
> Hi Vladimir,
>
> i think you can't prevent it, but you may want to try the settings
> tool for the code formatter. iirc you can find it by searching for
> "format" in the refactoring browser...it'll list a lot of classes and
> the code formatter setting thing is one of these classes.
>
> Good luck
> Karsten

Theoretically it should be possible to (at least) replace individual
selectors in existing source code /without/ losing the original format.
I guess this would be a simple cut/move/paste operation. Any volunteers?

I frequently change a method's parameter signature andf need to do this
manually, losing all of the "productivity advantage" of VW, which is a
shame. Because once the formatter touched my code, I can not read it
anymore (i.e. not instantly recognize it in my long term memory).

Andre

Reply | Threaded
Open this post in threaded view
|

Re: Prevent method code formatting after refactoring

Alan Knight-2
At 04:21 AM 2/11/2008, Andre Schnoor wrote:
Hi Vladimir,

i think you can't prevent it, but you may want to try the settings tool for the code formatter. iirc you can find it by searching for "format" in the refactoring browser...it'll list a lot of classes and the code formatter setting thing is one of these classes.

Good luck
Karsten

Theoretically it should be possible to (at least) replace individual selectors in existing source code /without/ losing the original format. I guess this would be a simple cut/move/paste operation. Any volunteers?

I frequently change a method's parameter signature andf need to do this manually, losing all of the "productivity advantage" of VW, which is a shame. Because once the formatter touched my code, I can not read it anymore (i.e. not instantly recognize it in my long term memory).

Andre

The refactoring browser does attempt to do small refactorings without disturbing the format of the source code. But once the operation gets beyond a certain complexity it does try to reformat. As of 7.6, the formatter uniformly used is the RBConfigurableFormatter, which does provide a number of options. Not enough to make me like the way it formats code, but some.


--
Alan Knight [|], Cincom Smalltalk Development
Reply | Threaded
Open this post in threaded view
|

Re: Prevent method code formatting after refactoring

Niall Ross
Dear Vladimir,
    if you post a specific example of what you would like versus what
you get (i.e. in some case where you feel it is quite obvious the RB
should not _need_ to reformat some part of the code it does reformat),
that might inspire the custom refactoring project to see what we can do.

Andre suggests that AddParameter and RenameMethod (with permuting of
parameters) should not reformat.  We are working on those at the moment
and will bear reformatting in mind.

As Alan remarks, later RB versions manage to limit the amount of
reformatting they do relative to earlier ones but it could become more
minimal still.

          Yours faithfully
             Niall Ross

Alan Knight wrote:

> At 04:21 AM 2/11/2008, Andre Schnoor wrote:
>
>>> Hi Vladimir,
>>>
>>> i think you can't prevent it, but you may want to try the settings
>>> tool for the code formatter. iirc you can find it by searching for
>>> "format" in the refactoring browser...it'll list a lot of classes
>>> and the code formatter setting thing is one of these classes.
>>>
>>> Good luck
>>> Karsten
>>
>>
>> Theoretically it should be possible to (at least) replace individual
>> selectors in existing source code /without/ losing the original
>> format. I guess this would be a simple cut/move/paste operation. Any
>> volunteers?
>>
>> I frequently change a method's parameter signature andf need to do
>> this manually, losing all of the "productivity advantage" of VW,
>> which is a shame. Because once the formatter touched my code, I can
>> not read it anymore (i.e. not instantly recognize it in my long term
>> memory).
>>
>> Andre
>
>
> The refactoring browser does attempt to do small refactorings without
> disturbing the format of the source code. But once the operation gets
> beyond a certain complexity it does try to reformat. As of 7.6, the
> formatter uniformly used is the RBConfigurableFormatter, which does
> provide a number of options. Not enough to make me like the way it
> formats code, but some.
>
>
> --
> Alan Knight [|], Cincom Smalltalk Development
> [hidden email]
> [hidden email]
> http://www.cincom.com/smalltalk