Find procedure jump only works from declaration lazarus / 9-Editor ---------------------------------------------------------------------- BigChimp · 2012-01-04 09:31 Hi all, Sometimes I want to see the procedure body of a procedure that is called somewhere in code. Selecting Find.. procedure jump doesn't work though, it jumps to the declaration section. What does work is first Find declaration, then you've got the declaration, then Find..Procedure jump. Am I making a stupid mistake or is this behaviour by design? Thanks, Lieutenant Hopeful ---------------------------------------------------------------------- Never · 2014-11-02 13:13 Created this macro to solve this proplem Code: [Select]begin ecFindDeclaration; ecLineEnd; ecFindProcedureDefinition; end.will drive you to the Definition of the procedure can be applied on a selected identifier ex: assuming you attach the macro on shift+2 Code: [Select]procedure proc_; procedure inside_TARGET(); ................................... ....................................... A)procedure proc_() begin .................. B)inside_TARGET()<---dbl click to select and press [shift+2]; ................ end; B)procedure inside_TARGET() begin <---your cursor will be here after .............. ............ end; ---------------------------------------------------------------------- taazz · 2014-11-02 15:30 Quote from: BigChimp on January 04, 2012, 10:31:12 amHi all, Sometimes I want to see the procedure body of a procedure that is called somewhere in code. Selecting Find.. procedure jump doesn't work though, it jumps to the declaration section. What does work is first Find declaration, then you've got the declaration, then Find..Procedure jump. Am I making a stupid mistake or is this behaviour by design? Thanks, Lieutenant Hopeful My process is to use the ctrl+click and if required ctrl+down arrow to jump to the procedure implementation. I'm thinking of using a keyboard shortcut for the ctrl+click as well but haven't looked in to it any farther. What do you mean when you say [q]find.... procedure jump[/q]? I'm looking in my menus and dialogs  and although I do see a find... menu it does not have any "procedure jump" inside the dialog or in the other menus. ---------------------------------------------------------------------- Never · 2014-11-02 15:57 QuoteWhat do you mean when you say [q]find.... procedure jump[/q]? I'm looking in my menus and dialogs  and although I do see a find... menu it does not have any "procedure jump" inside the dialog or in the other menus. is in the context menu when right click inside the source editor second from the top there is a sub menu click there and you will see the command wich regardless the selection always aplies to the current procedure the macro provided is a temporary solution until this fixed ---------------------------------------------------------------------- JuhaManninen · 2014-11-02 16:24 Quote from: BigChimp on January 04, 2012, 10:31:12 amSometimes I want to see the procedure body of a procedure that is called somewhere in code. Selecting Find.. procedure jump doesn't work though, it jumps to the declaration section. What does work is first Find declaration, then you've got the declaration, then Find..Procedure jump. Do you mean this issue?   http://bugs.freepascal.org/view.php?id=13245 I don't know what Mattias thinks of it. It has been open for long. ---------------------------------------------------------------------- taazz · 2014-11-02 16:34 Oh, you mean the popup menu which has the shortcut key shift+ctrl+up. This is what I know as jump to declaration, this is what it does yes shift+ctrl+up is considered jump to declaration of the current procedure/method block not the name that cursor is on or selected, shift+ctrl+down is the jump to implementation. The current implementation of those two actions is the same allowing them to be used both interchangeably so removing one and renaming the other to switch instead of jump will be my choice. There is no shortcut to the ctrl+click action as far as I know which is what BigChimp is looking for. EDIT: in "Options\Key Mappings" dialog those two are titled "find procedure definition" and "Find procedure method" which both titles missed the mark in my opinion. ---------------------------------------------------------------------- Never · 2014-11-02 16:44 ctrl+click jumps to to the declaration BigChimp  clearly states QuoteSometimes I want to see the procedure body of a procedure that is called somewhere in code. After all just try the macro to see the difference ---------------------------------------------------------------------- taazz · 2014-11-02 17:16 Quote from: Never on November 02, 2014, 05:44:41 pmctrl+click jumps to to the declaration BigChimp  clearly states QuoteSometimes I want to see the procedure body of a procedure that is called somewhere in code. After all just try the macro to see the difference For a good reason I suppose, eg what happens if the procedure is declared as external  ( dll/so etc) or it is declared as abstract and has no implementation? What happens if you are not interested in the current implementation but the declaration and keep on clicking until you reach some level of inheritance before jumping to the implementation? There is a bit of uncertainty of what it has to do if I had to implement it my self I would jump to the implementation when and if it is available or the declaration if it is not, it covers more use cases that way. ---------------------------------------------------------------------- Never · 2014-11-02 17:55 @taazz i agree with you i have filled a request in mantis about it but until then i prefer to hit shift+2 saves my self from 1 dblclick 1 rightclick 1 leftclick 1 dbliclck 1 rightclick 1 leftclick or insted ctrl+left click ctrl+down ps/ the macro is not disabling the current functionality in any way ---------------------------------------------------------------------- taazz · 2014-11-02 18:06 Quote from: Never on November 02, 2014, 06:55:34 pm@taazz i agree with you i have filled a request in mantis about it but until then i prefer to hit shift+2 saves my self from 1 dblclick 1 rightclick 1 leftclick 1 dbliclck 1 rightclick 1 leftclick or insted ctrl+left click ctrl+down ps/ the macro is not disabling the current functionality in any way try ctrl+shift+I, Esc, ctrl+down, it should be faster than Ctrl+Click, Ctrl+Shift+Down. I haven't looked the macro solution yet so no comments. ---------------------------------------------------------------------- Never · 2014-11-02 18:36 Sorry @taazz not willing to try anything unless is faster tha [key + key] press