On Wed, 17 Jan 2007 10:11:23 +0200
"Graeme Geldenhuys" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Using Code Completion (pressing Ctrl-Space) in the interface section
> of a class, so I can override a method, formats the code incorrectly.
> I have Lazarus's "CodeTools Options -> Space tab" setup to not include
> any spaces in front of elements. No checkboxes are checked in the
> "Insert space in front of" groupbox.
What about Insert Space after?
> Problem #1:
> This is how the original class has it's method defined. Notice that
> there is no spaces in front of the colons and semi-colons.
>
> public
> function IsValid(const AErrors: TtiObjectErrors): boolean;
> overload; virtual;
>
>
> And this is how code completion inserts that method into a new class
> where I am trying to override the method. Notice the formatting is
> different, it has spaces in front of the identifiers, colons and
> semi-colons.
>
> public
> function IsValid ( const AErrors : TtiObjectErrors ) : boolean ;
> overload ; virtual ;
Does the 'preview' in the options dialog show these spaces?
(Environment -> CodeTools options -> Spaces -> Preview)
> Problem #2:
> Another problems, is that it doesn't put the 'override' keyword at
> the end!
This is not yet implemented.
> Problem #3:
> This is more a nice-to-have feature. When I use the code completion
> in the new class as show above, it inserts the code at the cursor
> location, even if I am in the "private" or "protected" section of the
> class. I think it could be more intelligent and know that the
> overridden method must go into the same section as it was originally
> defined, in this case the "public" section.
Yes. At the moment 'class completion' does not search/read the ancestor
class, so it can't know.
Mattias
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives