Forum > IDE/CodeTools
Auto resolver/finder of correct unit for uses section
(1/1)
_Antares_:
Hi,
I really would love to have a feature that automatically searches the right unit to include for me, if I add some code.
Example:
Writing a new class from scratch and adding a member like
position: TPoint;
is simple enough.
But the compiler moans that there is some unit missing for his uses section.
So, was it...
Math, UITypes, Classes, SysUtils or maybe a LCLIntf? (*)
What I usually do is going into a unit where this type (TPoint in this example) was used already, Ctrl+Click on it and see in which file I end up, then add this to the uses clause in my file and continue the actual task.
I think this could be automated, couldn't it?
(*)Yes, it was Classes. How about TModalResult? :P
Martin_fr:
Install package "Cody", and then "Show Identifier and unit dictionary" in menu "Source".
Though, it needs to learn first. Install the Package, work with the IDE for one or two weeks. Every time you navigate code (using ctrl click or alt up, or similar) it will learn.
_Antares_:
@Martin_fr: Hey, nice, thanks for the hint! I'll check that out!
_Antares_:
I also found out about an existing functionality in Lazarus here: https://forum.lazarus.freepascal.org/index.php/topic,62303.0.html - "Unknown Identifier Search".
Have to look for this as well. :o
Martin_fr:
Also maybe https://wiki.freepascal.org/Lazarus_InstantSearch
I have not tried myself...
Navigation
[0] Message Index