[fpc-pascal] Code tools search paths

Mattias Gaertner nc-gaertnma at netcologne.de
Mon May 11 13:41:51 CEST 2020


On Mon, 11 May 2020 16:58:54 +0700
Ryan Joseph via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:

>[...]
> If I just want to add unit search paths do I do this? The user is
> just going to supply absolute paths to the language server (just like
> they would from the command line).

FPC is happy with ppu files. Codetools need sources. So it needs the
settings where the ppu files are coming from. Therefore codetools
allows to have different settings for each directory.


> // add all the unit paths
> for Path in Paths do
> begin
> 	DirectoryTemplate :=
> TDefineTemplate.Create('Directory','','',ExpandFileName(Path),da_Directory);

This creates a node for directory Path. Path should be your program
directory.

 
>           UnitPathTemplate := TDefineTemplate.Create('???','???',
>             UnitPathMacroName,
>             UnitPathMacro+';'+ExpandFileName(Path),
>             da_Define
>             );
>           DirectoryTemplate.AddChild(UnitPathTemplate);

This expands the UnitPath of directory Path with Path. 
Maybe you meant
UnitPathMacro+';'+ExpandFileName(SomeUnitPath),
?
 
>           CodeToolBoss.DefineTree.Add(DirectoryTemplate);
> end;


Mattias


More information about the fpc-pascal mailing list