[Lazarus] copy declaration, with implementation [Re: Tweaking 'code completion' for event handlers]
Michael Van Canneyt
michael at freepascal.org
Fri May 13 14:59:18 CEST 2011
On Fri, 13 May 2011, Martin wrote:
> On 13/05/2011 13:31, Mattias Gaertner wrote:
>
>
>
>
>
> Michael Van Canneyt <michael at freepascal.org> hat am 13. Mai 2011 um 12:55 geschrieben:
>
> >
> >
> > On Fri, 13 May 2011, Martin wrote:
> >
> > > On 13/05/2011 10:03, Mattias Gaertner wrote:
> > > Graeme Geldenhuys <graemeg.lists at gmail.com> hat am 13. Mai 2011 um 09:48 geschrieben:
> > >
> > > > http://bugs.freepascal.org/view.php?id=13994
> > > >
> > > > No solution has been implemented in Lazarus yet. As a work-around, is
> > > > there any way to tell Code Completion (Ctrl+Shift+C) for event handlers,
> > > > to only generate the code in the interface of the unit, and not the
> > > > implementation section?
> > >
> > >
> > >
> > > Not yet.
> > >
> > > I will add the checkbox for the implementation to my todo list.
> > >
> > >
> > > That reminds me of an idea, a feature I would like. And that would solve this too.
> > >
> > > It would be cool if one could with a single copy (or cut; as in copy/paste) copy a method (or procedure/function) declaration, including
> the
> > > implementation.
> > > Or even several methods, if one selects several lines in the interface.
> > >
> > > This would/should allow to:
> > > - copy/cut paste a method from one place in a class to another place in the same class (adjusting order of implementation too)
> > > - copy/cut paste a method from one class to any other class (adjusting the classname in the "procedure FOOCLASS.metho" line)
> > > This one would hugely add to the ability of refactoring, moving things up/down in the class hierachy, or even to rlated classes
> > > - copy/cut paste a plain procedure into a class, making it a method
> > > - copy/cut paste a method to become a plain procedure. So this one still requires some clean up, for any reference to self
> >
> > I'm all for this one. A 'Remove method/procedure' and 'Insert method/procedure'.
>
>
>
> Good idea.
>
>
>
>
> > As long as it doesn't interfere with regular copy&paste.
>
> I agree, it should not use the Cut/Copy shortcuts.
> But I see no problem with Paste. Do you see one?
>
>
> Not at all.
> IMHO it should copy (or cut) to clipboard => but as indicated via different shortcut/command.
>
> It does therefore need a different clipboard format (a mixed one plain text / codetool-format). The plain text would allow to paste into other apps
> (SynEdit does the same for copy with fold info / or copy column-mode selection)
>
> If required, synEdit could get a callbackon paste => so codetool can check for the special format, and intercept it.
> At some future point, I can provide insight, how this could even include foldstate info.
I think this is the way to go.
Michael.
More information about the Lazarus
mailing list