Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-04

Interesting TextMate and RedCar feature

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

ik

Hello,

RedCar and TextMate have interesting feature:

Lets say I change the name of a function, class, variable etc... So every place that reference to that symbol that I have changed, changed while I type the new name according to my changes.

It's better then choosing only to rename something using a refactoring option.

(you can see it here
http://redcareditor.com/wp-content/uploads/2008/05/a1.gif)

Just to show this option, nothing more :)

Ido

http://ik.homelinux.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20090413/b290d38d/attachment.html

Reply by email

Marco van de Voort
to ik
ik wrote 8 lines
RedCar and TextMate have interesting feature: Lets say I change the name of a function, class, variable etc... So every place that reference to that symbol that I have changed, changed while I type the new name according to my changes. It's better then choosing only to rename something using a refactoring option.

Why? I do not understand the difference, except if you want to make such animations?

Reply by email

ik
to Marco van de Voort

Lets say uo have a method inside a big class. You renamed it from RetriveData to GetData, now every place that uses RetriveData that belongs to that class is changed to GetData, and it does so while keyup, so you do not need to start looking for all of the changes or to discover that on line 100,004 it was not changed, i don't know why.

It also changes strings that uses the name, so if you have 100 debugging line of writeln (I sometimes have), it also changes the string. but if you change the string on your own for something else, it will not be applied in feature changes.

I hope it is more clear.

Ido

Marco van de Voort wrote 18 lines
On Mon, Apr 13, 2009 at 03:02:28PM +0300, ik wrote: > RedCar and TextMate have interesting feature: > > Lets say I change the name of a function, class, variable etc... > So every place that reference to that symbol that I have changed, changed > while I type the new name according to my changes. > > It's better then choosing only to rename something using a refactoring > option. Why? I do not understand the difference, except if you want to make such animations? _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20090415/ab0e16b1/attachment.html

Reply by email

Alexander Klenin
to Mattias Gärtner

2009/4/15 Mattias G?rtner :

in place renaming can be done for simple things like an identifier in a script or with a *lot* of effort in bigger scopes. IMO it can be done for live templates but not for real 'renames'.

I think auto-renaming makes sence for only local variables, generally for the cases where all instances fit into the screen. Otherwise it may come as a nasty surprise to a user.

Anyway, the linked demo seems to be about a very particular case of auto-renaming,
Notice that identifiers are different, though with the common structure. An actual analogue for FPC/Lazarus would be an option to rename 'TMyClass' to 'TMyNewClass', while simulatneously updating variable names lile 'FMyClass', 'AMyClass', 'myClass'.

Alexander S. Klenin

Reply by email