Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi annoyances, "find declaration" often doesn't work

Tags:

ide

delphi

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?

like image 795
hikari Avatar asked Oct 17 '14 20:10

hikari


3 Answers

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

like image 136
tcxbalage Avatar answered Nov 11 '22 23:11

tcxbalage


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.

like image 11
Mason Wheeler Avatar answered Nov 11 '22 23:11

Mason Wheeler


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.

like image 1
dph2016 Avatar answered Nov 12 '22 00:11

dph2016