Anyone used DelphiAST's TProjectIndexer?

Sort of using DelphiAST in anger and came across TProjectIndexer and just wondering if people have some hints to how to use it (as it seems to be ideal for what I want to do), otherwise I will bash my way through it…


Did you have any luck with that? I haven’t got anything to add… but I am interested in DelphiAST.

Still working my way through it and have gotten somewhere. I have found that TProjectIndexer the following:

  • set the defines, not sure how they are used though. They are semi-colon delimited, just like what is in Project Options → Delphi Compiler → Conditional Defines.

  • set search directories. Again, semi-colon delimited, just like Project Options → Delphi Compiler → Search Path

  • procedure Index(const fileName: string); is used to start the indexing off. This can be either a DPR file, or a single unit (note: all relative search paths are relative to this file)

  • handle include files, automatically!

  • the OnUnitParsed event tells you when a unit is done (but you can’t see any of the include files that are used - you can only see them once all units have been indexed.

  • haven’t figured out what the OnGetUnitSyntax event is for (as yet).

  • the following properties are populated upon completion of all indexing, IncludeFiles, Problems, and NotFoundUnits. It would have been nice to have IncludeFiles be part of the OnUnitParsed event (for what I am doing).

Hope this overview documentation helps someone.

1 Like