Author |
Topic |
Sasa
Tomato Guru
272 Posts |
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. |
C++ Visual Studio 2008 Pro Windows 7 x64
|
Edited by - Sasa on May 13 2007 3:11:57 PM |
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
Posted - May 14 2007 : 09:40:08 AM
|
Are you talking about using Find References on the current file only? Or something slightly different?
VIM has a feature to highlight all instances of the given symbol, *but* this uses a simple string match, so the same symbol name in different functions will be highlighted, even though they are different symbols, and may have different types. |
zen is the art of being at one with the two'ness |
|
|
Sasa
Tomato Guru
272 Posts |
Posted - May 14 2007 : 4:48:21 PM
|
quote: Originally posted by feline
Are you talking about using Find References on the current file only? Or something slightly different?
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. |
C++ Visual Studio 2008 Pro Windows 7 x64
|
Edited by - Sasa on May 14 2007 4:52:36 PM |
|
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
Posted - May 14 2007 : 6:26:38 PM
|
For now have you considered simply running Find References and then telling it to stop? It should scan the current file first already
case=5180 |
zen is the art of being at one with the two'ness |
|
|
Sasa
Tomato Guru
272 Posts |
Posted - May 14 2007 : 6:59:01 PM
|
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
case=5180
LOL...
I hope I am not the only one who sees this highlighting upon selection as a usefull feature.
I do use it quite often myself for a quick visual overview of where a certain variable is used. |
C++ Visual Studio 2008 Pro Windows 7 x64
|
Edited by - Sasa on May 14 2007 7:00:57 PM |
|
|
sl@sh
Tomato Guru
Switzerland
204 Posts |
Posted - May 15 2007 : 03:53:11 AM
|
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. |
Edited by - sl@sh on May 15 2007 03:58:04 AM |
|
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
Posted - May 15 2007 : 07:54:57 AM
|
Sasa I used the equivalent feature all the time in VIM, and I use Find References a lot my self, I definitely see how this would help. As always the trick, as always, is balancing bug fixes with new features, and picking which features to do first.
sl@sh I have just tried stopping Find References with the stop button. This seemed to turn off highlighting, but when I simply turned it back on again, via the check box in Find References Results the references were highlighted for me.
Some form of marker... an interesting idea. I am not sure how this would work when you have break points, book marks, etc on the same lines. The IDE markers are designed to sit on top of each other, so you can sort of see all of them at once.
I will put in a feature request and see what people make of this.
case=6592 |
zen is the art of being at one with the two'ness |
|
|
Sasa
Tomato Guru
272 Posts |
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 |
C++ Visual Studio 2008 Pro Windows 7 x64
|
|
|
RoSe
Junior Member
15 Posts |
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. |
|
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
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. |
zen is the art of being at one with the two'ness |
|
|
sl@sh
Tomato Guru
Switzerland
204 Posts |
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. |
Edited by - sl@sh on May 23 2007 03:58:50 AM |
|
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
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. |
zen is the art of being at one with the two'ness |
|
|
Sasa
Tomato Guru
272 Posts |
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. |
C++ Visual Studio 2008 Pro Windows 7 x64
|
|
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
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 |
zen is the art of being at one with the two'ness |
|
|
Sasa
Tomato Guru
272 Posts |
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) |
C++ Visual Studio 2008 Pro Windows 7 x64
|
|
|
sl@sh
Tomato Guru
Switzerland
204 Posts |
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
Tomato Guru
272 Posts |
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 :) |
C++ Visual Studio 2008 Pro Windows 7 x64
|
|
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
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. |
zen is the art of being at one with the two'ness |
|
|
Sasa
Tomato Guru
272 Posts |
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--;
}
|
C++ Visual Studio 2008 Pro Windows 7 x64
|
|
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
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. |
zen is the art of being at one with the two'ness |
|
|
Sasa
Tomato Guru
272 Posts |
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.
|
C++ Visual Studio 2008 Pro Windows 7 x64
|
|
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
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. |
zen is the art of being at one with the two'ness |
|
|
Sasa
Tomato Guru
272 Posts |
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 :) |
C++ Visual Studio 2008 Pro Windows 7 x64
|
|
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
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? |
zen is the art of being at one with the two'ness |
|
|
Sasa
Tomato Guru
272 Posts |
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? |
C++ Visual Studio 2008 Pro Windows 7 x64
|
|
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
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. |
zen is the art of being at one with the two'ness |
|
|
Sasa
Tomato Guru
272 Posts |
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. |
C++ Visual Studio 2008 Pro Windows 7 x64
|
|
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
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. |
zen is the art of being at one with the two'ness |
|
|
Sasa
Tomato Guru
272 Posts |
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! :) |
C++ Visual Studio 2008 Pro Windows 7 x64
|
|
|
support
Whole Tomato Software
5566 Posts |
Posted - Oct 29 2007 : 01:54:15 AM
|
case=5180 is implemented in Build 1614 |
|
|
Wernight
New Member
France
2 Posts |
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.). |
|
|
Topic |
|