Forum > General
Exploring code in Lazarus
440bx:
Hello,
The Lazarus "Code Explorer" comes in handy quite often.
I was wondering if, somewhere/somehow, Lazarus can show a list of where a particular procedure/function is called (in addition to where it's defined.)
That's my question: does Lazarus show a list of _where_ a specific function/procedure is called and, if the answer is yes, how do I get it to show me that list ?
Thank you for your help.
dje:
Right click: Find->Find Identifier References...
Edit: Also available from the Search menu, and via Ctrl+Shift+I
440bx:
--- Quote from: dje on October 01, 2022, 05:03:53 am ---Right click: Find->Find Identifier References...
Edit: Also available from the Search menu, and via Ctrl+Shift+I
--- End quote ---
Thank you. It works great with variables and other identifiers but, when I tell it to find a function or procedure, it doesn't find any references/calls, not even "find in files" (with all project files) finds any references.
NOTE: using Lazarus 2.2RC1 (haven't tried with latest)
Arioch:
maybe you did not explicitly included those files in the project as top-level sources. I'd rather make grep (F-i-F) to look into select folders and their subfolers for *.pas;*.inc;*.pp, than merely "in project files"
did you set extra checkboxes in F-i-F ? sometimes things like "case sensitive" or "whole words only" can deny matches, especially id the copied text for searching contained spaces or brackets or other non-alphanumerics
MarkMLl:
--- Quote from: 440bx on October 01, 2022, 03:55:08 am ---I was wondering if, somewhere/somehow, Lazarus can show a list of where a particular procedure/function is called (in addition to where it's defined.)
--- End quote ---
I think the problem there is that if looked at globally, Lazarus (or a comparable tool) would show you all definitions of a function with a particular name irrespective of scope and parameter types. Similarly, if it were asked to look for invocations, it would only match by name.
This is very similar to the issue of the IBM mainframe expert who was enthusiastic about the feasibility of a cross compiler (i.e. FPC running on a PC but targetting an S/370 etc.) but lost interest when somebody (possibly Jonas) pointed out that he could /not/ be provided with an xref listing because of the number of places where e.g. objects in the compiler's AST were processed by functions determined at runtime.
I agree it would be nice to have. I'm not sure it's feasible.
MarkMLl
Navigation
[0] Message Index
[#] Next page