Is there an "automagical" way in Delphi to lookup which unit an Undeclared Identifier possibly is in?
For example, I open up a new Project, with a TEdit
and TButton
. And I simply type:
TFile
I get an undeclared identifier, but in this case I am lucky because when pressing F1, I get that it is in System.IOUtils
. But sometimes, I am not so lucky.
Is there some sort of shortcut key, or how do you people do it?
(I must confess, I usually Google this up)
CodePudding user response:
There are the following convenient methods that I know about:
- The built in "Find Unit" refactoring of the IDE. Unfortunately I don't find it very reliable.
- The "Uses Clause Manager" expert in GExperts (switch to the Identifier tab on the right)
- The "Delphi Uses Helper" IDE plugin written by Stefan Glienke.
The comments list a few others that I think aren't that convenient (with the possible exception of the MMX Code Explorer which I don't know). The "Grep Search" expert in GExperts might also help. Or instead of typing the search term into Google manually, you could use the "Delphi Help Expert" which allows you to specify a search engine of your choice which is then opened when you press F1 a modifier key.
CodePudding user response:
My choice in preferred order:
- Alt F11 - "Use unit" from list of units in active project, in case I know which unit I need.
- Grep search of GExperts
I never use Find Unit of IDE, it crash almost always in last dozen versions of RAD Studio and after that I need to restart IDE and reload project group which takes way too much time compared to Grep search.
Probably you asking for something magical like in Android Studio - sorry, we don't have such tool in RAD Studio. Maybe it's time for someone to make it.