Been having this with most Delphi versions over the years, so I'm wondering if maybe it's just something wrong with my code or is this the expected behavior from the IDE..
Normally when you place the cursor over a procedure/function/variable etc you can press Alt+Up and it goes to wherever it was declared whether in the same unit or in separate ones, just like if you right-click and pick "Find Declaration", but very often this doesn't work, even if when you hover the mouse over and after a second it tells you like.. "Declared in xx.pas", but it still won't go there. Even if I type unitname.proc and try on the proc, it still doesn't jump to the proc. If I open the unit (ctrl+enter over the unit) first once, even if I close it afterwards, then it works.
Is there any reason why this happens?
Go to "Project">"Options...">"Compiler".
Here tick the following boxes:
"Debug information"
"Local symbols"
"Reference info"
Press "OK".
Restart Delphi.
This is solved the problem in my case (Delphi 7).
Good luck
This happens because the related systems are driven by their own special parser that's different from the one in the compiler, and it's been very buggy and poorly maintained for years now. It's been a known issue for a long time, but it's apparently pretty low-priority for the folks at Embarcadero.
I ran into this problem with the latest (as of 5/2/16) version of RadStudio (RadStudio/Delphi Berlin).
My settings, more or less, already matched those suggested by tcxbalage. Here's the RadStudio Berlin equivalent:
Project | Option... | Delphi Compiler | Compiling | Debugging: Local symbols: true Symbol reference info: Reference info
Here's what I did that got the "Find Declaration" support working correctly:
1) I changed Symbol reference info to "Definitions Only". 2) Pressed "OK". 3) Reopened Project | Options and change "Symbol reference info" back to "Reference info". Pressed "OK". 4) Rebuilt my project.
Hope this helps anybody else who runs into the same problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With