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

Comments

  1. 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.
    If you're using the DCUs, what do you expect it to do?

    ReplyDelete
  2. It does. You need to update your browsing and library paths.

    ReplyDelete
  3. in addition to above comments, you need to know that:
    - this feature is old
    - it's still buggy after over a decade, i.e. not always working, sometimes even throws an exception

    ReplyDelete
  4. Martijn Coppoolse Oliver Funcke  The location of the source files were in the browsing path but not in the library path. Thank you.

    ReplyDelete
  5. If 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!

    ReplyDelete
  6. Please don't put any 3rd party source files in your library path!

    This 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.

    ReplyDelete
  7. Stefan Glienke Right, but if you need to debug 3rd party components. Those entries should be removed in release configuration.

    ReplyDelete
  8. Stefan Glienke Oops, you're absolutely right!
    I 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.

    ReplyDelete
  9. 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.

    ReplyDelete
  10. Stefan 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
  11. *.dcu files in library path, *.pas files in browsing path.
    If this is done you can use Ctrl Click as fine as Ctrl Enter ;-)

    ReplyDelete
  12. 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:
    Unable to locate file "blabla.pas".

    Martijn Coppoolse Debug source path has nothing to do with that afaik.

    ReplyDelete
  13. Stefan Glienke - Thank you, I finally have it figured out... I think.  :-)

    By 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.

    ReplyDelete
  14. 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).

    About 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.

    ReplyDelete
  15. Stefan Glienke Thank you. I just posted a question on the Raize forum. http://www.raize.com/forums/viewtopic.php?f=23&t=481

    ReplyDelete
  16. Damn, yeah; Ctrl+Click is nice. Beats right-click, find Declaration.. which also sometimes just does nothing. Probably related to paths as Oliver Funcke mentioned.

    ReplyDelete
  17. Here is 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

    ReplyDelete
  18. Michael Riley I disagree with some things he wrote there because that simply does not work most of the time.
    Also 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).

    ReplyDelete
  19. Stefan Glienke Thank you for your thorough and thoughtful answers on this question. In the end we all learn from this type of interaction.

    ReplyDelete
  20. Anyone 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.

    ReplyDelete
  21. Jeroen Wiert Pluimers - I think CTRL-Enter is what you're looking for.

    ReplyDelete
  22. I believe Ctrl-Enter is for opening the file, where cursor is currently, in the IDE?

    I have this combo committed to memory, not as cool...
    special "menu key", down arrow, find declaration. 

    http://en.wikipedia.org/wiki/Menu_key

    ReplyDelete
  23. Paul Thornton nope, `Ctrl+Enter` is for opening the unit name that is under the cursor.

    ReplyDelete
  24. On my german keyboard it is Alt + ArrowUp

    ReplyDelete
  25. Hmm. Here, the Alt-UpArrow will take you to the declaration of the method your cursor is located.

    ReplyDelete
  26. Hm, on my IDE Ctrl + Shift + ArrowUp (or ArrowDown) will switch between declaration and implementation of a method, but i think this is from GExpert.
    I also found a hotkey from DDevExtensions for FindDeclaration: Ctrl + Alt + PageUp.

    ReplyDelete

Post a Comment