T O P I C R E V I E W |
Sasa |
Posted - May 13 2007 : 3:11:38 PM This one is not very hard to implement given VAX parser and it could be a real helper.
Highlight in the current file ONLY the method/member/variable on double-click/select in the editor on that method/member/variable.
This will help a lot where the declaration is at the top and we want to quickly have an overview of the useage of that variable _in the current file only_ without doing a fully fledged Find references.
Of course, it has to be enabled/disabled via options for people that don't want to use it.
Eclipse has a similar functionality, and it is very usefull for code navigation. |
30 L A T E S T R E P L I E S (Newest First) |
Sasa |
Posted - Mar 18 2009 : 09:21:04 AM Wow!! nice, a year and a half later...I come back to visit the forums and it is implemented! :D
It is a good thing since I will be going back to C++ real soon. Thanks WT. |
support |
Posted - Jan 27 2009 : 10:59:37 PM case=21926 deals with automatic highlighting of references to the symbol under the cursor.
case=21926 is implemented in build 1715
Enable in VA Options|Advanced|Refactoring|Automatically highlight references to symbol under cursor. |
Wernight |
Posted - Dec 05 2008 : 02:37:02 AM quote: Originally posted by feline
We are talking about different things. [...] We are considering some form of active highlighting similar to Eclipse, but it has not yet been implemented: case=5141
I agree these are different and the Eclipse way sound much more useful as it doesn't require to type or click any button to add some natural help. |
wroemer |
Posted - Dec 04 2008 : 09:14:31 AM quote: Originally posted by support
Highlighting find results (case=5141) is implemented in build 1707
Works great! That's what I was looking for, too! |
support |
Posted - Dec 01 2008 : 07:25:16 AM Highlighting find results (case=5141) is implemented in build 1707 |
feline |
Posted - Feb 12 2008 : 1:58:14 PM We are talking about different things. case=5180 has the title "find references only in current file command"
We are considering some form of active highlighting similar to Eclipse, but it has not yet been implemented:
case=5141 |
Wernight |
Posted - Feb 12 2008 : 03:14:59 AM The function is still missing in my point of view.
I, like others here, like the VIM and Eclipse function of word highlighting. What's wrong here to my point of view: - Pop-up a window with the results (not needed for that function). - Requires another keyboard shortcut to be pressed (too long, another thing to remember). - Hard to remove the highlight.
How it could work: - Auto highlight without result windows on double click. - Auto remove highlights on double click elsewhere or something like Eclipse.
I think the performance issue isn't really an issue if VAX can do the computation in background. This is because the highlight effect/result doesn't have to be instant (same as Eclipse btw.). |
support |
Posted - Oct 29 2007 : 01:54:15 AM case=5180 is implemented in Build 1614 |
Sasa |
Posted - Jun 07 2007 : 2:07:01 PM quote: Originally posted by feline
I think I finally understand now I have put a note on the case about this. It is almost a separate feature / command, but sitting on top of exactly the same Find References logic.
Exactly! :) |
feline |
Posted - Jun 07 2007 : 12:48:30 PM I think I finally understand now I have put a note on the case about this. It is almost a separate feature / command, but sitting on top of exactly the same Find References logic. |
Sasa |
Posted - Jun 07 2007 : 11:39:57 AM Yes, I want to use it more to read and understand code and not to highlight and change my highlighted values. For this type of intervention where I want to actually change some code, the find reference function works pretty good since I might want to find reference in other files as well in order to modify the code.
That is why I was suggesting a quick way to get rid of the highlighting. Unchecking the highlighting in the Find Ref results or sending a command is definitivly not the way to go.
Browsing away from the symbol, or selecting another symbol would be the more sensible approach for that application. |
feline |
Posted - Jun 05 2007 : 12:09:42 PM Via the keyboard I can use CTRL+Up_arrow and CTRL+Down_arrow to scroll, as if with the mouse, but this breaks down when the caret reaches the top or bottom of the screen.
I think we are probably approaching this from two different perspectives. For me, if I highlight all instances of something I have done so for a reason, I want to work with it, modify it, change it, I normally want to edit *something*, which requires moving the caret As soon as I do this I would loose the highlighting.
I suspect you are looking to read and understand code, where highlighting different things in quick succession makes more sense.
When I use VIM I have turned on highlighting the last item found, which is similar to Find References with highlighting turned on. Moving and editing have limited to no effect on the highlighting. This is what I am used to, so this is what I think in terms of.
In VIM there is the command "nohl" or "nohighlight" which turns off highlighting when you are finished. In VAX there is the checkbox for highlighting in Find References Results.
Neither solution is as quick and simple as moving the caret to turn off highlighting, but they are designed for more persistent highlighting. |
Sasa |
Posted - Jun 05 2007 : 12:00:53 PM quote: Originally posted by feline
*um*
Assume for a moment that I am working on a function that does not fit on the screen. I have various functions that do not fit, often for good reasons.
This means that I trigger this command on something inside this function, to see the references to the "thing" quickly and easily, and then when I try to find them the highlighting disappears...
Isn't this rather unhelpful?
And you would use your keyboard arrows to scroll up/down instead of the vertical scroll bar of the mouse scrollwheel?
If so, what would then be the most appropriate way to clear the references highlighting besides clicking on another symbol? |
feline |
Posted - Jun 05 2007 : 06:40:20 AM *um*
Assume for a moment that I am working on a function that does not fit on the screen. I have various functions that do not fit, often for good reasons.
This means that I trigger this command on something inside this function, to see the references to the "thing" quickly and easily, and then when I try to find them the highlighting disappears...
Isn't this rather unhelpful? |
Sasa |
Posted - Jun 04 2007 : 2:25:29 PM quote: Originally posted by feline
*nods* the open case that I found is asking for Find References, limited to the current file, which apart from marks in the sidebar is exactly what you are looking for.
The references to Eclipse are confusing me more than helping me, since I have never used it, so I have no good mental model of what people are referring to.
Eclipse is a great IDE, one of the best IMHO. It is a shame that refactoring in C++ is so much more complex than refactring in Java.
One critical detail I forget to mention that should be attached to the issue, is the "clear of the references highlight"
As soon as the symbol is not selected anymore (because you used the arrows to navigate the cursor somwhere else, or you double-clicked on another symbol) the highlighting of references should be cleared.
I hope that I was clear enough :) |
feline |
Posted - Jun 01 2007 : 1:55:51 PM *nods* the open case that I found is asking for Find References, limited to the current file, which apart from marks in the sidebar is exactly what you are looking for.
The references to Eclipse are confusing me more than helping me, since I have never used it, so I have no good mental model of what people are referring to. |
Sasa |
Posted - Jun 01 2007 : 11:48:49 AM quote: Originally posted by feline
Is this matching limited to the current function (code is parsed) or simply whole word and case matching?
The first is exactly what VA's Find References does, but some of the discussions here seem to be talking about simple string matching with no code parsing.
If you are only looking for a local variable then trigger VA's Find References, it is clever enough to know that you are searching for a local variable and you get a nearly instant result.
What I suggested was code parsing, like a VAX Find Ref on local file only, on symbol double click/select.
Then we said that if the feature was too hard to implement, which I think is not, that it would be OK, for now, to do a simple string match.
But ultimetly it has to be a smart highlight, a la Find Reference + marking of location into the sidebar. And if people want only dumb string compares, then maybe it should be an option or something. I don't see myself using that feature for a simple string comparison highlight.
Here is my quote from an eralier post
quote:
That's exactly it: Find References in current file only.
Since VAX parser already does a global Find References, doing it locally shouldn't be too much of a stretch I am guessing.
It would be an easy to implement, super feature to have that no other helper tools have.
Thanks.
P.S: If this task proves to be more challenging, a phased in approach could be used, where Phase1 will be simple string match, and Phase2 in next build could be the Find References in current file only.
|
feline |
Posted - May 31 2007 : 1:06:05 PM Is this matching limited to the current function (code is parsed) or simply whole word and case matching?
The first is exactly what VA's Find References does, but some of the discussions here seem to be talking about simple string matching with no code parsing.
If you are only looking for a local variable then trigger VA's Find References, it is clever enough to know that you are searching for a local variable and you get a nearly instant result. |
Sasa |
Posted - May 31 2007 : 11:01:17 AM quote: Originally posted by feline
I think I know the answer, but I will ask anyway. What happens if I do this:
static void testFunction()
{
int nFoo;
nFoo++;
nFoo--;
}
and select the red bit? This is not going to work at all in the context of VA's Find References, since Find References should not even be offered on this.
I suspect we are back to the fundamental difference between Find References and the concept of "just highlight all piece of text that match the following regular expression pattern", which is what VIM will let you do, and is probably where this discussion is going
I have never used Eclipse, so I don't actually know what it is doing, so maybe I guessed wrong.
Well, obviously, nothing should happen :)
But this
static void testFunction()
{
int nFoo;
int nFooBar;
if(true)
{
int nFoo;
nFoo++;
}
nFoo++;
nFooBar++;
nFoo--;
}
Should only highlight the following lines:
static void testFunction()
{
int nFoo;
int nFooBar;
if(true)
{
int nFoo;
nFoo++;
}
nFoo++;
nFooBar++;
nFoo--;
}
|
feline |
Posted - May 29 2007 : 12:14:57 PM I think I know the answer, but I will ask anyway. What happens if I do this:
static void testFunction()
{
int nFoo;
nFoo++;
nFoo--;
}
and select the red bit? This is not going to work at all in the context of VA's Find References, since Find References should not even be offered on this.
I suspect we are back to the fundamental difference between Find References and the concept of "just highlight all piece of text that match the following regular expression pattern", which is what VIM will let you do, and is probably where this discussion is going
I have never used Eclipse, so I don't actually know what it is doing, so maybe I guessed wrong. |
Sasa |
Posted - May 29 2007 : 10:25:45 AM quote: Originally posted by sl@sh
quote: Originally posted by Sasa No, no special command, double-click should be fine. This is how it works in eclipse and it works beatifully.
IIRC Eclipse does not require double-clicking.
I like the shortcut-to-command suggestion - you can always define left-double-click to be your shortcut if you so prefer
Eclipse works on selection, which is what a double-click on a word does in Visual Studio.
Ideally, you would want it to work on selection too, but for the sake of getting this feature out of the door faster, double click should suffice for now :) |
sl@sh |
Posted - May 29 2007 : 06:00:33 AM quote: Originally posted by Sasa No, no special command, double-click should be fine. This is how it works in eclipse and it works beatifully.
IIRC Eclipse does not require double-clicking.
I like the shortcut-to-command suggestion - you can always define left-double-click to be your shortcut if you so prefer |
Sasa |
Posted - May 28 2007 : 01:03:57 AM quote: Originally posted by feline
I had been picturing a command that you could bind to your own keyboard shortcut to highlight the current symbol, the one the caret is sitting in, just like Find References currently works.
Triggering on double click is an interesting idea, I am just wondering if there are any obvious edge cases where this will cause problems. *checks*
I had been thinking of how F8 works in MS Word, I am sure I have seen double click select a word, triple click to select a line, and so on, but the IDE is not doing this. Shows how much I use the mouse when coding
I have put a note about this on the feature request, case=5180
No, no special command, double-click should be fine. This is how it works in eclipse and it works beatifully.
I think this feature is simple to implement and adds a big value to code browsing.
Of course, this feature should be an option so people that dont want it can disable it. The highlight colors used will be the same colors that the highligh references uses (the 2 colors) |
feline |
Posted - May 26 2007 : 10:35:34 AM I had been picturing a command that you could bind to your own keyboard shortcut to highlight the current symbol, the one the caret is sitting in, just like Find References currently works.
Triggering on double click is an interesting idea, I am just wondering if there are any obvious edge cases where this will cause problems. *checks*
I had been thinking of how F8 works in MS Word, I am sure I have seen double click select a word, triple click to select a line, and so on, but the IDE is not doing this. Shows how much I use the mouse when coding
I have put a note about this on the feature request, case=5180 |
Sasa |
Posted - May 26 2007 : 01:16:34 AM quote: Originally posted by feline
I got the impression from the last line of RoSe's post. Hanging out here trains you to try and read between the lines, but you don't always get this right
Scrolling... but that's what the page up / page down keys and next / previous context keys are for! Different people view things differently, but years working on a dumb terminal with VIM, to me scrolling always means moving the caret up / down the code. From this point of view picking up the symbol the caret is currently sitting in is likely to produce "interesting" effects most of the time.
Feline, let's just start with a find references in current file on double-click on symbol (which in effect highlights the symbol). That should be easy enough :)
We will take care of the other situations later. |
feline |
Posted - May 24 2007 : 2:35:44 PM I got the impression from the last line of RoSe's post. Hanging out here trains you to try and read between the lines, but you don't always get this right
Scrolling... but that's what the page up / page down keys and next / previous context keys are for! Different people view things differently, but years working on a dumb terminal with VIM, to me scrolling always means moving the caret up / down the code. From this point of view picking up the symbol the caret is currently sitting in is likely to produce "interesting" effects most of the time. |
sl@sh |
Posted - May 23 2007 : 03:56:01 AM Not sure how you read that from RoSe's (or anyone else's?) posting, but anyway: when you scroll a file, the cursor position is not changed. (Unless you move the cursor to obtain scrolling effects, obviously) Only the view is.
With respect to Eclipse, IIRC (been some time) indeed the symbol a cursor is currently on will always be picked up and appearances highlighted with the current file (or view, at least).
That said, I remember that highlighting in Eclipse sometimes took a noteable amount of time (like 0.5 to 1 seconds), so I don't think such a feature would be easy to implement for VA without severe effects on performance. Hence the first thing to shoot for would be a triggered highlighting (by key, mouse-event, or button). If it turns out this is working very fast you probably could chain the highlighting to the 'cursor position changed' event and check whether it's still feasible or not. |
feline |
Posted - May 22 2007 : 1:25:25 PM *um* if I follow correctly you are describing:
As I move the caret through the source code, what ever symbol the caret is currently sitting in is picked up, and all instances of this symbol in the current file are highlighted.
Is that it? This is not what I am envisaging by the concept of Find References in only the current file.
I am a little concerned with the overhead required for this, since we do not "own" the editor, we are changing it "after" the fact. Also how does this work with scrolling though the code? Thinking about scrolling the code, as soon as you scroll to find the highlighted references the highlighting will chance, since you are on a different symbol. I assume I am mis-understanding. |
RoSe |
Posted - May 22 2007 : 07:36:24 AM Hi,
I posted for the same request some weeks ago and I'm glad that somebody else likes this feature, too (this identifies the eclipse guys ;-). I wonna vote for this feature, it really rocks. I think simple string matching would help a lot in a first step. Constraining to the right context is better but not really necessary. It would be best to start the search by positoning the curser to the member, method etc and to have a option in the properties to en/disable the "on the fly" search functionality. |
Sasa |
Posted - May 15 2007 : 1:14:00 PM quote: Originally posted by sl@sh
quote: Originally posted by feline
For now have you considered simply running Find References and then telling it to stop? It should scan the current file first already
I just tried this. Unfortunately, if you prematurely stop the find, then, apparently, the symbols already found are [u]not[/b] being highlighted! (hmm, I wonder if I'm being too excessive with commas here )
P.S.: an afterthought: would it be possible for VA to set some sort of mark into the sidebar (where the breakoint indicators go)? This would make it easier to spot symbols on very long lines (outside the view) or when the highlight color-to-background color contrast isn't too great.
Yeah, I like that feature as well. It would make a great addition to the HighLight upon select/double click feature.
Although it shouldn't stop the highlight on selection from being added any time sooner |