0

In the Delphi 10.4.2 IDE Code Editor, when selecting an Identifier, the Find References menu item in the Search menu is disabled (grayed out):

enter image description here

enter image description here

I seem to remember that it did work in previous versions of the Delphi IDE.

So why it is not working?

EDIT: In a simple project such as this Embarcadero demo project:
C:\Users\Public\Documents\Embarcadero\Studio\21.0\Samples\Object Pascal\VCL\ActivityIndicator
the Find References menu item is enabled:

enter image description here

My project, where the Find References menu item is disabled, is a complex project with several forms, and its main form unit contains about 15,000 lines. Maybe this complexity blocks the Find References menu item?

user1580348
  • 5,721
  • 4
  • 43
  • 105
  • In the D10.4.2 IDE, if I select a member item, such as a TButton of a form in the Code window, Find References, Find Local References are all enabled and work fine. With no item selected, they are disabled. Have you tried with one of the Delphi demo projects? – MartynA Aug 01 '21 at 10:55
  • In the code of another form of my same complex project, the `Find References` menu item does work! So maybe the amount of code in my form unit (15,000 lines) blocks the `Find References` menu item? – user1580348 Aug 01 '21 at 11:43
  • 3
    It is, unfortunately, very well known that the RAD Studio IDE has quite a lot of problems related to Code Insight in non-trivial projects. If you have a look at the Embarcadero Jira, you will find hundreds of such reports. Fortunately, the quality of the IDE seems to be improving, and I do get the feeling that Embarcadero really is listening to its customers. – Andreas Rejbrand Aug 01 '21 at 12:04
  • @user1580348 Does the mentioned unit compile? Code insight will stop working properly if they are syntactical errors in the unit. – SilverWarior Aug 01 '21 at 20:19
  • There are no syntactical errors in the code, and of course, it does compile. – user1580348 Aug 01 '21 at 20:33
  • @SilverWarior: The problem is that Code Insight often stops working even if the code is correct (that is, your implication isn't an equivalence). – Andreas Rejbrand Aug 01 '21 at 21:28
  • What I have noticed: If the quantitative or qualitative logical complexity of the code exceeds a certain level, then the compiler can get confused. For example, when having several nested `try-finally-end` statements mixed inside with many conditional `Exit` statements and loops then the compiler sometimes suddenly shows errors in distant and unrelated places where there have not been errors before. – user1580348 Aug 01 '21 at 22:44
  • @AndreasRejbrand Yes I have heard of such scenarios. Must admit that I haven't encountered such scenario myself yet. Probably because I mostly working on less complex projects. But it is far more likely you will end up with CodeInsight not working as expected when you write half of the code line and then jump or try to jump to another part of the unit just to check how something is implemented there so you can finish writing your code line so that it will work properly with existing code. ... – SilverWarior Aug 02 '21 at 14:11
  • ... And the main cause for this is that CodeInsight doesn't really have code scope awareness and therefore needs recheck all the code from the beginning to the end of the unit file. And if it encounters an error along the way all the code that follows the point of that error never gets rechecked and therefore it is as it doesn't even exist. You can observe this easily by folding all of the methods in your unit writing unfinished codeline and then moving your cursor away from that line. All the code that follows that line will get unfolded because CodeIsight can't reevaluate it properly. – SilverWarior Aug 02 '21 at 14:22

0 Answers0