Jump to content
PeterPanettone

Uses Clause Manager in Tree in r2809

Recommended Posts

I have compiled GExperts 1.3.14 build 80 (r2809) in Delphi 10.3.1 image.png.29cc635efa8c7ce91d1d265c63eb11b2.png

 

Searched for identifier "newshortcut" in Uses Clause Manager:

 

image.png.c7e33a8366d98e94c529797f082b66e2.png

 

As you can see in the above screenshot, nothing was found.

 

Then I searched in RFindUnit 1.2.0 and found several identifiers:

 

image.thumb.png.d24f8bcc2a1e0720c2863517ea54e58a.png

 

So why GExperts couldn't find these identifiers?

 

Please have a look at RFindUnit at GitHub - it has a lot of useful features:

 

https://github.com/rfrezino/RFindUnit

 

Unfortunately, the author has abandoned the project. :classic_sad:

 

Please ask him whether you can use the source code in the GExperts Uses Clause Manager.

 

 

Edited by PeterPanettone

Share this post


Link to post

By default, the uses manager only looks for identifiers only in the favorite units. If that is empty, you won't get any. In the settings you can tell it to search all units instead.

Share this post


Link to post
21 minutes ago, dummzeuch said:

By default, the uses manager only looks for identifiers only in the favorite units. If that is empty, you won't get any. In the settings you can tell it to search all units instead.

Here are the settings:

 

image.png.d96d9d09735b1298eb1b4e42108714ab.png

 

As you can see, the "Parse all units" option is checked.

 

PS: I have also cleared and rebuilt the UCM cache. Still no results for "newshortcut" yet. (However, a search for "newcolor" got 6 results).

Edited by PeterPanettone

Share this post


Link to post

I should have looked closer at the rfindunit results: There is no identifier that starts with newshortcut, its only part of a word. The uses clause manager searches only for identifiers that start with the given search text.

So, maybe it should also search for identifiers that contain in anywhere.

 

As for using rfindunit sources: I looked into it a while ago and found only one advantage: It extracts identifiers from the dcu files when no sources are available. This turns into a drawback when the dcu format changes (which it will). I definitely won't invest the time for reverse engineering the dcu format whenever it changes.

Share this post


Link to post
7 minutes ago, dummzeuch said:

I should have looked closer at the rfindunit results: There is no identifier that starts with newshortcut, its only part of a word. The uses clause manager searches only for identifiers that start with the given search text.

So, maybe it should also search for identifiers that contain in anywhere.

RFindUnit finds madShell.newShortCut - so UCM should also find it. Why it doesn't?

 

image.thumb.png.95478bc9afa4cb19e008bc58e3ba2550.png

Edited by PeterPanettone

Share this post


Link to post
47 minutes ago, dummzeuch said:

So, maybe it should also search for identifiers that contain in anywhere.

There is absolutely NO logic in searching only for identifiers STARTING with the search term. Searching for identifiers CONTAINING the search term is the sensible way to go. Or you could add an option radio choice "Starts/Contains the search term".

Edited by PeterPanettone

Share this post


Link to post
4 hours ago, dummzeuch said:

As for using rfindunit sources: I looked into it a while ago and found only one advantage: It extracts identifiers from the dcu files when no sources are available.

You can process the DCU files whenever you want, MANUALLY:

 

processdecus.thumb.jpg.36a003188bc0de5cdebbab5832e1db9e.jpg

 

It says: "This command will list all the DCUs files that you don't have access to .PAS and process it to make it available for search."

 

PS: And it would be easy to make it process only those .DCU files where there is no .PAS file with the same name.

Edited by PeterPanettone

Share this post


Link to post

The GExperts UCM has the advantage to open the unit with the selected identifier in the IDE, so the user can inspect it:

 

openunit.thumb.jpg.fda0b2c8a64ba8a3787b5a7f264d2eff.jpg

 

Unfortunately, RFindUnit does not have this feature.

 

So, in my Christmas wishlist I have inserted a GExperts UCM which has all the other features of RFindUnit. :classic_smile:

Share this post


Link to post

BTW, in the UCM configuration options there should be a warning when the user activates the "Read project units from map file rather than .dpr" checkbox (otherwise he would not see any units from the map file):

 

image.png.d96d9d09735b1298eb1b4e42108714ab.png

 

The warning message should say: "Please make sure to activate the Map file creation in the Project options".

Share this post


Link to post

If the user has activated the map file usage for UCM (and activated map file creation in the project options) then the list of the project units in UCM contains all units the project uses EXPLICITLY and IMPLICITLY:

 

projectunits.thumb.jpg.0f4d6c321fff8c8b80d546460615f0c1.jpg

 

This list can be quite USEFUL.

 

So please add a button in the Project tab to copy/save this list. This would be very useful!

Share this post


Link to post

May I remind you that adding suggestions to the sf.net ticketing system increases your chances of gettimg them implemented?

Share this post


Link to post
3 minutes ago, dummzeuch said:

May I remind you that adding suggestions to the sf.net ticketing system increases your chances of gettimg them implemented?

I will do that, but useful ideas from other users could also arise here which could be added to the sf.net ticketing system later.

Share this post


Link to post

I couldn't wait, so I implemented the Copy Project Units List myself:

 

copybutton.thumb.jpg.23743c104fb4346b98dfaf3eaf64596d.jpg

 

The code is very simple:

 

code.thumb.jpg.e8bf441a6a1bc4aec0c966b50b3cd3bf.jpg

 

If you like, the button will save the list to a text file instead (in a save dialog), if the CTRL key is pressed while clicking.

 

I have sent you the modified source in a personal message.

Edited by PeterPanettone
  • Thanks 1

Share this post


Link to post

No, it's the combination of the project's search path and the library path. Basically everything the IDE knows about.

Share this post


Link to post
1 hour ago, dummzeuch said:

No, it's the combination of the project's search path and the library path. Basically everything the IDE knows about.

It would be useful if the user could add a list of custom paths to this "Search Path". (Like with the MMX Indexer)

Share this post


Link to post
1 hour ago, Fr0sT.Brutal said:

@PeterPanettone

man you really mixing forum and WhatsApp.

You really mix up WhatsApp and delphi praxis forum.

 

Don't you know what a forum is used for?

 

Please don't annoy forum users.

Share this post


Link to post

Sure, this is a place to discuss. But there is no need to get mad to each other.

This thread is quite dominant in all listings of recent activity and indeed this happens from time to time when a thread is quite active. Nonetheless you should accept when other people say "come on, keep it short". Honestly, it is a very specific topic and as long as we have no option to really ignore a thread, it pops up again and again. So this thread has an impact to this community. By nature of couse, because this community is a place for discussions. So when you are contribuiting to a thread that sticks out like this and is basically a conversation between two people, there might be some reactions to it - yes. I think we all need some forbearance [never used this word before, but dictionary says it is right 😉 ] here.

Share this post


Link to post

Personally I also find threads annoying that have multiple posts after each other from the same person.

 

Possible solutions:

- make posts editable for a reasonable amount of time so people don't have to multipost but can amend to their previous one

- moderate and manually squash such posts into one

Share this post


Link to post
5 hours ago, Daniel said:

But there is no need to get mad to each other.

MAD PEOPLE certainly should not participate in an IT forum. MAD PEOPLE should rather search for psychiatric help, maybe in a psychotherapeutic forum where they can criticize each other for writing too much.

Edited by PeterPanettone
  • Haha 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×