[fpc-pascal] Using include files in code tools

Ryan Joseph genericptr at gmail.com
Thu May 7 15:21:35 CEST 2020



> On May 7, 2020, at 5:26 PM, Mattias Gaertner via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
> 
> Nodes are always associated with a Tool. Tool.MainFilename gives the
> file, where parsing started.
> 

Just curious, can you explain the reasoning of "tools"? I haven't exactly figured out the delegation of tasks in your system.

> 
>> I need this information so I can get navigate to the include file AND
>> relative text offset into the include file text. 
> 
> There are plenty of functions for include files. Can you give an
> example what you need?

I start with CodeToolBoss.Explore after loading the unit and get the current tool from that. I need to start with an actual unit right? I don't think it will parse plain include files on its own, and that won't often work anyways because there are  macros in the unit which includes the include file.

I'm collecting the symbols so that I can return them to the client and it can navigate to a particular file at a line/column number. The file which I navigate to must be the include file but I only have those location relative to the unit, not the include. 

Regards,
	Ryan Joseph



More information about the fpc-pascal mailing list