Page 1 of 1

Jumping to macro definition (like procedures)

Posted: Sun May 24, 2009 6:00 am
by PB
I just held down the Control key and double-clicked a macro and the source
didn't jump to it. (Initially, I thought I was double-clicking a procedure name).
Could this functionality please be added for a future release? Thanks.

Re: Jumping to macro definition (like procedures)

Posted: Sat May 24, 2014 1:05 pm
by c4s
PB wrote:I just held down the Control key and double-clicked a macro and the source
didn't jump to it. (Initially, I thought I was double-clicking a procedure name).
Could this functionality please be added for a future release? Thanks.
+1

This "jump to definition" feature is very handy - I use it a lot! The only downside is that it doesn't work for macros. Any updates on this feature request?


Exactly 5 years have passed since the initial post. I swear this is a coincidence! ;)

Re: Jumping to macro definition (like procedures)

Posted: Sat May 24, 2014 2:46 pm
by Tenaja
c4s wrote:This "jump to definition" feature is very handy - I use it a lot! The only downside is that it doesn't work for macros. Any updates on this feature request?
+1

Re: Jumping to macro definition (like procedures)

Posted: Sat May 24, 2014 5:33 pm
by luis
I don't know if this is gonna happen.

First of all, a procedure it's an identifier always followed by (), a macro doesn't always need that so it's harder to identify it in the source for the editor, which it's not the compiler.

Also a macro can be generated by other macros, so when you select the macro invocation there is no place where jump to because the macro it's not plainly declared, it's generated.

Also a macro can be in a resident while a proc can't (but can be in a dll).

Example

Code: Select all

  
Macro colon
 :
EndMacro

Macro buildmacro
 colon#Macro test : Debug "hello world" colon#EndMacro
EndMacro

buildmacro

test ; nowhere to jump 

On second thought the same can be said for procs generated by macros too, and so this can already happening.
Maybe I'm wrong then, if accepting these limitations is ok. Just thinking out loud...ehm....

Re: Jumping to macro definition (like procedures)

Posted: Sat May 24, 2014 7:25 pm
by c4s
@luis
The Procedure Browser tool already allows jumping to the definition of procedures and macros. In your example "buildmacro" and "colon" are listed, so I'd suggest that only those two would be available for the jump.

Re: Jumping to macro definition (like procedures)

Posted: Sat May 24, 2014 7:33 pm
by luis
c4s wrote:@luis
The Procedure Browser tool already allows jumping to the definition of procedures and macros.
Oh, I completely forgot about that, I'm sorry. So yes, it's already doing what requested, just somewhere else.

And yes, only those two would be "available" for the jump.
That was my point as in "it can't work for every macro, since you can actually generate them in code".
But anyhow was a moot point since the same already happen for procedures built through macros.
Please forgive my intrusion :P