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.
Jumping to macro definition (like procedures)
Jumping to macro definition (like procedures)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.
Re: Jumping to macro definition (like procedures)
+1PB 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.
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!

If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
Re: Jumping to macro definition (like procedures)
+1c4s 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?
Re: Jumping to macro definition (like procedures)
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
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....
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
Maybe I'm wrong then, if accepting these limitations is ok. Just thinking out loud...ehm....
"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
Re: Jumping to macro definition (like procedures)
@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.
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.
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
Re: Jumping to macro definition (like procedures)
Oh, I completely forgot about that, I'm sorry. So yes, it's already doing what requested, just somewhere else.c4s wrote:@luis
The Procedure Browser tool already allows jumping to the definition of procedures and macros.
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

"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review