Sign in Join

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

Mailing lists / lazarus / 2009-10

Class completion in reverse - remove method implementation

11 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

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

Graeme Geldenhuys

Hi,

Is there a function in the IDE to delete the implementation of a method when the Interface signature is removed? Almost like class completion, but in reverse?

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email

Hans-Peter Diettrich
to Graeme Geldenhuys
Is there a function in the IDE to delete the implementation of a method when the Interface signature is removed? Almost like class completion, but in reverse?

A very dangerous feature. When the tool cannot match properly declaration and implementation header/signature, much code can be destroyed.

I'd agree with a refactoring feature, to delete both interface and implementation of a selected method. That feature could safely do nothing in case of a mismatch.

DoDi

Reply by email

Michael Van Canneyt
to Hans-Peter Diettrich
Hans-Peter Diettrich wrote 12 lines
Graeme Geldenhuys schrieb: > Is there a function in the IDE to delete the implementation of a > method when the Interface signature is removed? Almost like class > completion, but in reverse? A very dangerous feature. When the tool cannot match properly declaration and implementation header/signature, much code can be destroyed. I'd agree with a refactoring feature, to delete both interface and implementation of a selected method. That feature could safely do nothing in case of a mismatch.

Simply removing a method with empty implementation if the header is in the published section would also be nice. A misclick in the OI causes an empty method to be generated. Deleting these automatically on compilation/save would be a nice thing. (as Delphi does, incidentally)

Michael.

Reply by email

Graeme Geldenhuys
to Hans-Peter Diettrich: A very dangerous feature. When the tool cannot match properly declaration and…

2009/10/9 Hans-Peter Diettrich :

A very dangerous feature. When the tool cannot match properly declaration and implementation header/signature, much code can be destroyed.

Nothing your source code management system cannot retrieve. Or a simple Ctrl+Z key sequence undo the delete.

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email

Graeme Geldenhuys
to Michael Van Canneyt: Simply removing a method with empty implementation if the header is in the published…

2009/10/9 Michael Van Canneyt :

Show quoted text 5 lines
Simply removing a method with empty implementation if the header is in the published section would also be nice. A misclick in the OI causes an empty method to be generated. Deleting these automatically on compilation/save would be a nice thing. (as Delphi does, incidentally)

Somehow I thought that was already added....?

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email

Henry Vermaak
to Graeme Geldenhuys

2009/10/9 Graeme Geldenhuys :

Show quoted text 8 lines
2009/10/9 Michael Van Canneyt : > > Simply removing a method with empty implementation if the header is in the > published section would also be nice. A misclick in the OI causes an empty > method to be generated. Deleting these automatically on compilation/save > would be a nice thing. (as Delphi does, incidentally) Somehow I thought that was already added....?

Yes, you can do this via right click -> refactoring -> show empty methods. Would be nice to have this happen automatically, though.

Henry

Reply by email

Alexander Klenin
to Henry Vermaak
Henry Vermaak wrote 12 lines
2009/10/9 Graeme Geldenhuys : > 2009/10/9 Michael Van Canneyt : >> >> Simply removing a method with empty implementation if the header is in the >> published section would also be nice. A misclick in the OI causes an empty >> method to be generated. Deleting these automatically on compilation/save >> would be a nice thing. (as Delphi does, incidentally) > > Somehow I thought that was already added....? Yes, you can do this via right click -> refactoring -> show empty methods. ?Would be nice to have this happen automatically, though.

Options->Editor->Automatic features->Auto remove empty methods

Alexander S. Klenin

Reply by email

Michael Van Canneyt
to Alexander Klenin: Options->Editor->Automatic features->Auto remove empty methods Alexander S. Klenin
Alexander Klenin wrote 15 lines
On Sat, Oct 10, 2009 at 00:49, Henry Vermaak wrote: > 2009/10/9 Graeme Geldenhuys : >> 2009/10/9 Michael Van Canneyt : >>> >>> Simply removing a method with empty implementation if the header is in the >>> published section would also be nice. A misclick in the OI causes an empty >>> method to be generated. Deleting these automatically on compilation/save >>> would be a nice thing. (as Delphi does, incidentally) >> >> Somehow I thought that was already added....? > > Yes, you can do this via right click -> refactoring -> show empty > methods. ?Would be nice to have this happen automatically, though. Options->Editor->Automatic features->Auto remove empty methods

Duh !

I should open this dialog from time to time to see if something new appeared :)

Thanks for the tip...

Michael.

Reply by email

Graeme Geldenhuys
to Michael Van Canneyt

2009/10/9 Michael Van Canneyt :

Show quoted text 8 lines
>> Yes, you can do this via right click -> refactoring -> show empty >> methods. ?Would be nice to have this happen automatically, though. > > Options->Editor->Automatic features->Auto remove empty methods Duh ! I should open this dialog from time to time to see if something new appeared

Options -> Windows -> Show New Features -> Once every 7 days.

;-)

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email