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

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Fri May 26 12:47:35 CEST 2017


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?

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.

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).

Regards,
   Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp


More information about the Lazarus mailing list