I just discovered the Ctrl Click IDE shortcut.
I just discovered the Ctrl Click IDE shortcut.
I wish the Ctrl Click worked on third party component libraries such as Raize components.
Update 05/28/2014:
Please check out the response I received from Ray Konopka regarding the find declaration for Raize Components.
http://www.raize.com/forums/viewtopic.php?f=23&t=481#p1285
I wish the Ctrl Click worked on third party component libraries such as Raize components.
Update 05/28/2014:
Please check out the response I received from Ray Konopka regarding the find declaration for Raize Components.
http://www.raize.com/forums/viewtopic.php?f=23&t=481#p1285
If you have the source code for the external libraries (and you're including them in your library path), it should work fine. At least, it does here.
ReplyDeleteIf you're using the DCUs, what do you expect it to do?
It does. You need to update your browsing and library paths.
ReplyDeletein addition to above comments, you need to know that:
ReplyDelete- this feature is old
- it's still buggy after over a decade, i.e. not always working, sometimes even throws an exception
Martijn Coppoolse Oliver Funcke The location of the source files were in the browsing path but not in the library path. Thank you.
ReplyDeleteIf CTRL-Click doesn't work, place the cursor on the unit name and press CTRL-Enter. Quite often this works when CTRL-Click doesn't. Bug!
ReplyDeletePlease don't put any 3rd party source files in your library path!
ReplyDeleteThis is one of the mistakes Delphi developers have been doing for ages.
It causes the third party source to be recompiled every time you build your project which is not necessary because most 3rd party components already built their stuff when you installed them (and if done properly put them into their own dcu directory). It also causes the 3rd party source to be built with the options in your project which might differ from the settings of their packages.
Stefan Glienke Right, but if you need to debug 3rd party components. Those entries should be removed in release configuration.
ReplyDeleteStefan Glienke Oops, you're absolutely right!
ReplyDeleteI meant the Debug source path under "Debugger Options/Embarcadero Debuggers" in the Tools/Options dialog. That is meant for exactly that purpose, Oliver Funcke.
You can also specify this per project, in Source Path in the "Debugger" section of the project options.
Oliver Funcke Library path is IDE wide. What you are talking about is called search path and is specific to the build configuration of a project.
ReplyDeleteStefan Glienke - If I have the source code to a 3rd party component suite such as Raize, is there a way to get the same Ctrl Click behavior on those objects without recompiling the vendors source code?
ReplyDelete*.dcu files in library path, *.pas files in browsing path.
ReplyDeleteIf this is done you can use Ctrl Click as fine as Ctrl Enter ;-)
Michael Riley The dcus need to be built with "Debug information", "Local symbols" and "Symbol reference info". Any dcu that has these settings will work for "Find declaration" (aka Ctrl+Click). Of course you also need to have the source files in the browsing path of your IDE. If that is not the case the "Find declaration" will complain with an error telling you:
ReplyDeleteUnable to locate file "blabla.pas".
Martijn Coppoolse Debug source path has nothing to do with that afaik.
Stefan Glienke - Thank you, I finally have it figured out... I think. :-)
ReplyDeleteBy including the Raize source folder in the library path it did in fact as you stated, recompile all the dcu's and placed them into the project output directory. (This is not what I intended)
Because the Build configuration was debug those dcu's in the output folder now include the debug information.
When I compare the dcu file sizes from my output directory to the vendor supplied lib files they are different. Obviously the vendor created those dcu's in release mode.
Michael Riley Yes, that is what most of them do (I think that is also the settings we do in Spring4D - I might have another look and change that).
ReplyDeleteAbout the following I am not sure but I think if a dcu contains debug info or not is not relevant to the produced binary in the end unless you turn on Debug Information in the Linker settings so they might also turn these settings on to make "Find declaration" work.
Stefan Glienke Thank you. I just posted a question on the Raize forum. http://www.raize.com/forums/viewtopic.php?f=23&t=481
ReplyDeleteDamn, yeah; Ctrl+Click is nice. Beats right-click, find Declaration.. which also sometimes just does nothing. Probably related to paths as Oliver Funcke mentioned.
ReplyDeleteHere is the response I received from Ray Konopka regarding the find declaration for Raize Components.
ReplyDeletehttp://www.raize.com/forums/viewtopic.php?f=23&t=481#p1285
Michael Riley I disagree with some things he wrote there because that simply does not work most of the time.
ReplyDeleteAlso I am quite surprised that hesitates to specify $REFERENCEINFO ON because it does not change the endresult in any form (to answer your question you posted there) according to the doc: http://docwiki.embarcadero.com/RADStudio/XE6/en/Symbol_declaration_and_cross-reference_information_(Delphi)
Edit: After testing back and forth (recompiling a dozen times with different settings for $DEBUGINFO, $LOCALSYMBOLS and $REFERENCEINFO/$DEFINITIONINFO) it turns out that really only $DEFINITIONINFO ON (or $YD) is needed for being able to use find declaration (as I was guessing when reading the documentation).
Stefan Glienke Thank you for your thorough and thoughtful answers on this question. In the end we all learn from this type of interaction.
ReplyDeleteAnyone who found a pure keyboard shortcut for this? Visual Studio has F12 (but no Ctrl-Click) and I always wondered if Delphi had a pure keyboard shortcut for this.
ReplyDeleteJeroen Wiert Pluimers - I think CTRL-Enter is what you're looking for.
ReplyDeleteI believe Ctrl-Enter is for opening the file, where cursor is currently, in the IDE?
ReplyDeleteI have this combo committed to memory, not as cool...
special "menu key", down arrow, find declaration.
http://en.wikipedia.org/wiki/Menu_key
Paul Thornton nope, `Ctrl+Enter` is for opening the unit name that is under the cursor.
ReplyDeleteOn my german keyboard it is Alt + ArrowUp
ReplyDeleteHmm. Here, the Alt-UpArrow will take you to the declaration of the method your cursor is located.
ReplyDeleteHm, on my IDE Ctrl + Shift + ArrowUp (or ArrowDown) will switch between declaration and implementation of a method, but i think this is from GExpert.
ReplyDeleteI also found a hotkey from DDevExtensions for FindDeclaration: Ctrl + Alt + PageUp.