[Lazarus] Getting help for a type if its unit is not in uses

Mattias Gaertner nc-gaertnma at netcologne.de
Wed Feb 5 12:25:18 CET 2014


On Wed, 05 Feb 2014 09:03:32 +0100
Sven Barth <pascaldragon at googlemail.com> wrote:

>[...]
> On the German Delphi-Forum Delphi-PRAXiS there was the question in which 
> unit the type TObjectList resided in Lazarus. Besides the obvious answer 
> "contnrs" there was also the suggestion to use F1 on the TObjectList 
> identifier to let the help find it for you.

 (For those that can read 
> German, here is the thread: 
> http://www.delphipraxis.net/178892-lazarus-kennt-keine-tobjectlist.html )
> 
> Now the problem is that this won't work in Lazarus which will return a 
> error message "Hilfeschlüsselwort "FPCKeyword_TObjectList" nciht[sic!] 
> gefunden." ("Help keyword "FPCKeyword_TObjectList" not found") [plus 
> another, in my opinion needless, error message afterwards with (in my 
> case)

The above message is now omitted. The hint is now in the debug log.


> "No help found for "project1.lpr" at (13,16)"] and the user is 
> none the wiser... This is at least the case in 1.0.12 on win64, I didn't 
> check for any changes here in 1.2/1.3...
> 
> Are there any ideas for improving this situation for people that know 
> that there is an identifier in the RTL, FCL, whatever, but don't know 
> which unit it resides in? E.g. Lazarus did scan the FPC sources, 
> couldn't it keep an identifier->unit index?

It only scanned the directories for file names. This alone can take
minutes on slow disks/networks.
There are currently two identifier->unit indices.

Code Browser:
- built in the IDE
- scans current project or IDE and all currently used packages
- does not save index to disk
- does not show identifiers of other packages (not used by project/IDE)

Cody Identifier Dictionary
- installed when Cody is installed
- keeps track of all scanned identifiers
- stores index to disk
- shows identifiers of other packages (if you used them once)
- if you used several copies of a unit on your disk, it will show
  all of them
- can be confusing when you renamed files or worked cross platform.

Basically you can use the Code Browser to update the dictionary.
Both show only top level identifiers, not sub identifiers or parameters.

When an identifier was not found it now starts the code browser, so
TObjectList of contnrs is now shown.


> Also could the error message 
> be improved a bit? E.g. kick out that second error and use "TObjectList" 
> instead of "FPCKeyword_TObjectList" in the error message?

You now get the codebrowser. There you can search for packages, units
and identifiers.

Mattias




More information about the Lazarus mailing list