IDE - Goto Variable Declaration

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

IDE - Goto Variable Declaration

Post by skywalk »

Hi,
Please add menu item(and shortcut-able) - Goto Variable Declaration.
ie. If cursor is on a variable (array, structure, constant, etc.), then applying menu pick or shortcut "Goto Variable Declaration" will jump to the Define/Global or instantiation of that variable.

And / or allow the user to change the behavior of the Variable Viewer.
Please no more inserting of the variable name into code. :(
More helpful to me to jump to the variable declaration.
Last edited by skywalk on Sun Nov 25, 2012 8:56 pm, edited 3 times in total.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: IDE - Goto Variable Declaration

Post by PB »

> If cursor is on a variable, menu pick or shortcut "Goto Variable Declaration"
> will jump to the Define/Global or instantiation of that variable

What do you mean? That the editor will jump to the "Declare" line for the variable?
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: IDE - Goto Variable Declaration

Post by skywalk »

@PB, you got it :)

As of now, I have to [double-click] the variable, then hit [Ctrl+F] then [Enter].
But, the search function does not span beyond the current file.
So, then I have to hit [Ctrl+Tab].
Then [F3] and if not in that file...I have to close the search dialog once or twice.
Then repeat. :(
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
DarkDragon
Addict
Addict
Posts: 2344
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: IDE - Goto Variable Declaration

Post by DarkDragon »

Doesn't work with situations like this:

Code: Select all

Define A.l

; ...

Define A.l

; ...

A = 10
What to do then? Clone your monitor?
bye,
Daniel
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: IDE - Goto Variable Declaration

Post by c4s »

DarkDragon wrote:What to do then? Clone your monitor?
Go to the first declaration. At least it's better than nothing.
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: IDE - Goto Variable Declaration

Post by PB »

Out of curiosity: you don't normally redefine a variable's type once set,
so why would you need to jump to it so often that requires a dedicated
IDE function to do it?
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: IDE - Goto Variable Declaration

Post by c4s »

I thought the same but what about procedures?
For example I have several ones with "Protected Result", so maybe the IDE should then have an option like "Ignore Procedures"...
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: IDE - Goto Variable Declaration

Post by skywalk »

PB wrote:Out of curiosity: you don't normally redefine a variable's type once set,
so why would you need to jump to it so often that requires a dedicated
IDE function to do it?
This may or not be true for simple variables. However, with structures, if I need to add an element or whatever, it is so painful to get back to its definition. Or an array upper bound? Most often I just need to remember what other variables I defined or how I defined them. I do not use hungarian notation...arggh.

And what if the code is shared by several developers, then this is really, really helpful. No?

I kinda sorta have this feature with [Ctrl+K] which allows me to jump back and forth between the top and bottom of a procedure.

[Shift+F2] in Visual Studio, jumps to the current cursor's declaration point, anywhere in the project.
And [Ctrl+Shift+F2], brings you back. Currently [Ctrl+L] does not span the entire project. :(

Thanks for the questions. They continue to prompt me with edits to the request. :)
DarkDragon wrote:Doesn't work with situations like this:

Code: Select all

Define A.l

; ...

Define A.l

; ...

A = 10
What to do then? Clone your monitor?
Just follow the behavior of the search function (but allow me to search in reverse please.. [Shift+F3]).
In fact, I would want to know if I did this by mistake!
Post Reply