[fpc-pascal] CodeTools complete code

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Oct 4 10:44:02 CEST 2022


On Tue, 4 Oct 2022 14:47:29 +0700
Hairy Pixels via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:

> > On Oct 4, 2022, at 2:40 PM, Mattias Gaertner via fpc-pascal
> > <fpc-pascal at lists.freepascal.org> wrote:
> > 
> > If you don't want the comment above the class, use
> > 
> > with CodeToolBoss.SourceChangeCache.BeautifyCodeOptions do 
> > begin
> >  ClassHeaderComments:=false;
> >  ClassImplementationComments:=false;
> > end;
> >   
> Great thanks.
> 
> > New procedure bodies are added behind global variables, so they can
> > access them.  
> 
> Ok so this must apply to program files only.

You can define private classes in unit implementations as well.

> I can live with that I guess. It’s maybe best to make it an option. What do you think?

A separate option where to start new classes is a good idea.

> Just
> because it’s an assumption the global variable will be used at all.

Codetools can't know that, so it needs manual help here.
In a unit implementation usually all global variables are at the
beginning and the classes follow. 


> There can also be many global variable sections so that confuses the
> concept some also.

That is a confusing concept anyway. Aka bad coding style?

 
Mattias


More information about the fpc-pascal mailing list