[Lazarus] CodeTools knowledge about a project - find a class

Mattias Gaertner nc-gaertnma at netcologne.de
Fri May 26 13:01:51 CEST 2017


On Fri, 26 May 2017 11:47:35 +0100
Graeme Geldenhuys via Lazarus <lazarus at lists.lazarus-ide.org> wrote:

> Hi,
> 
> Does CodeTools only know about the unit or units that are currently 
> open? Or does in know about all files in a project - and maybe even 
> associated packages?

Codetools only knows about the defines for each directory.
But any IDE addon can access source editor and codetools.

 
> The problem
> ===========
> I want to implement a Lazarus IDE feature "open type" - that's if it 
> doesn't already exist (please let me know). Imagine, you need to have a 
> look at the "TFoo" class. But, where is the "TFoo" class? Is it in the 
> "Boo" project or maybe in the Boo_tools.lpk package? Or somewhere else 
> (in a project search path)?
>
> I would like to be able to simply trigger the "Open Type" shortcut, 
> which shows me a dialog where I can type "Foo", and a listbox below that 
> will list all possible class matches with the name "Foo" (similar to 
> what the Procedure List dialog currently does. I can then simply press 
> Enter to select the first found option, or press the up/down arrows to 
> select another match and then press Enter, and it will take me to the 
> correct unit and class definition.

Sounds like cody's dictionary:
http://wiki.lazarus.freepascal.org/Cody#Unit_.2F_Identifier_Dictionary

 
> Ctrl+LClick can already to this - somewhat. But for Ctrl+LClick to work, 
> you need the correct unit in the uses clause. My problem is, what if you 
> don't know the unit name either, or the unit name isn't in the uses list 
> (yet - or might not even be needed at all, you simply wanted to double 
> check something in the "TFoo" class).


Mattias


More information about the Lazarus mailing list