Author |
Topic  |
Nobodo
Tomato Guru
    
126 Posts |
Posted - Jul 07 2009 : 7:03:09 PM
|
Ok, this is a wierd one, but very repeatable.
C#, VS2005, VA1727
It's probably easiest to describe by showing how to create it, and by viewing the images:
- Create a method (or property, etc.) that has a few references to a variable (on different lines).
- Somewhere after the first reference but before the last reference, create a region that surrounds at least one of the references.
- Put the cursor on one of the references BELOW (must be below!) the region, so the references are highlighted.
- With the region expanded, highlighting of references will be normal.
- With the region collapsed, there will be no highlighting of references near the top of the edit window. The number of lines with references not highlighted increases as the number of collapsed lines increases. If you scroll the edit window with the cursor not moving, the highlight will dependably stop the same number of lines from the top of the edit window. If you increase the size of the collapsed region, you are increasing the number of lines from the top of the edit window without highlighting.
Here is a simple (meaningless code) example:
Region expanded, cursor on reference in line 45, highlighting normal:

Region collapsed, cursor on reference in line 45, bug displayed:
 |
|
feline
Whole Tomato Software
    
United Kingdom
19177 Posts |
Posted - Jul 08 2009 : 1:36:50 PM
|
I am seeing the same effect here. Thank you for the clear description.
case=29360 |
zen is the art of being at one with the two'ness |
 |
|
Nobodo
Tomato Guru
    
126 Posts |
Posted - Sep 22 2009 : 1:28:35 PM
|
Is there any progress on this?
Thanks, Mark. |
 |
|
Nobodo
Tomato Guru
    
126 Posts |
Posted - Sep 23 2009 : 2:23:14 PM
|
Expanding on that...
Here is a real-world example of why I see this as a real problem... Below is an actual image of some of the code I have to refactor for one client. Yep, one method, umpteen regions, several hundred lines of code. With this client I wade through this kind of code for days on end, so the ability to open just a couple of those regions, highlight references, and have it work correctly can make my life a lot easier! 

|
 |
|
feline
Whole Tomato Software
    
United Kingdom
19177 Posts |
Posted - Sep 24 2009 : 11:09:18 AM
|
There are no notes of progress on the bug report. Using VA 1736 I am seeing the problem when using:
VA Options -> Advanced -> Refactoring -> Automatically highlight references to symbol under cursor
but all of the references in my test case are correctly highlighted when using VA's Find References command with Highlight References turned on. Can you try this, and see if it works correctly for you?
There is also:
VA Options -> Advanced -> Display -> Highlight find results
which works correctly for me, but this is not syntax aware. |
zen is the art of being at one with the two'ness |
 |
|
Nobodo
Tomato Guru
    
126 Posts |
Posted - Sep 24 2009 : 4:09:13 PM
|
Yes, doing a 'find references' search does highlight correctly. That is the workaround I have had to use for the non-working "Automatically highlight references to symbol under cursor".
When stepping through unfamiliar code to get an idea of where variables are used, the ability to do a really quick "Automatically highlight references to symbol under cursor" is priceless. I find that I can't use it at all though because of this client's prolific use of regions in all code and how regions bust the VA functionality.
Thanks, Mark.
|
Edited by - Nobodo on Sep 24 2009 4:51:39 PM |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19177 Posts |
Posted - Sep 25 2009 : 10:46:22 AM
|
Can you try binding a keyboard shortcut to the command VAssistX.FindSelected ? I have this bound to Alt-K personally. This does an IDE find for the symbol the caret is sitting in, highlighting all of the references if you have:
VA Options -> Advanced -> Display -> Highlight find results
turned on, but it does so without moving the caret.
I appreciate this is not the same, and not as good as automatically highlighting the symbol under the caret, but it is a lot faster than running regular Find References.
case=29360 is down as a high priority bug report, but I am not sure when it will be looked at. |
zen is the art of being at one with the two'ness |
 |
|
Nobodo
Tomato Guru
    
126 Posts |
Posted - Sep 25 2009 : 1:32:26 PM
|
Thanks, but that highlights each occurrence of a word rather than finding an actual reference to the object/variable under the cursor. It also doesn't show a difference between a read-only and a write reference, and being able to see at a glance all the places where a particular variable is written to instead of just read from is a huge help when refactoring existing code.
Mark. |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19177 Posts |
Posted - Sep 28 2009 : 09:28:36 AM
|
*sigh* it was a nice idea while it lasted. I have increased the priority on this bug a bit more for you, and added a note explaining that this work around does not help. |
zen is the art of being at one with the two'ness |
 |
|
Nobodo
Tomato Guru
    
126 Posts |
Posted - Nov 06 2009 : 5:20:32 PM
|
This problem is MUCH more pervasive than I originally thought. I kept seeing it in all sorts of projects, and kept assuming it was the same thing (regions). It isn't regions at all, it is collapsed code.
Here's a simple example. 1 - Take the below code as a new C# console application. 2 - Right-click the code window, choose 'Outlining' - 'Collapse to Definitions'. 3 - Expand only the Main method (click the + on line 13 to the left of static void Main) 4 - Show the bug by clicking on words in the method headers (Test5, Test4, static, void).
You should be able to see the bug by clicking anywhere from Test3() or lower. It is EXTREMELY common to have at least some code collapsed! This isn't a rare problem.
Thanks, Mark.
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication9
{
class Program
{
/// <summary>
/// This is Main
/// </summary>
/// <param name="args"></param>
static void Main(string[] args)
{
Test5();
Test4();
Test3();
Test2();
Test1();
}
/// <summary>
/// This is Test1
/// </summary>
static void Test1()
{
Console.WriteLine("This is Test1");
Test2();
}
/// <summary>
/// This is Test2
/// </summary>
static void Test2()
{
Console.WriteLine("This is Test2");
Test3();
}
/// <summary>
/// This is Test3
/// </summary>
static void Test3()
{
Console.WriteLine("THis is Test3");
Test4();
}
/// <summary>
/// This is Test 4
/// </summary>
static void Test4()
{
Console.WriteLine("This is Test4");
}
/// <summary>
/// This is Test 5
/// </summary>
static void Test5()
{
Console.WriteLine(This is Test5");
}
}
}
|
 |
|
sean
Whole Tomato Software
    
USA
2817 Posts |
Posted - Nov 06 2009 : 10:06:45 PM
|
Mark, thanks for your persistence. The problem here is that we are trying to be efficient and only highlight what is visible on the screen. Collapsing the code wrecks our 'visible line count.' We'll revisit this. |
 |
|
Nobodo
Tomato Guru
    
126 Posts |
Posted - Jan 26 2010 : 12:18:48 PM
|
Greetings again. I see this problem was not addressed in build 1810. This problem makes one of the most beneficial features of VA useless to me. When is the plan to address this?
Thank you, Mark. |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19177 Posts |
Posted - Jan 26 2010 : 12:42:35 PM
|
This is being looked at, but unfortunately I don't have an estimate on when this will be fixed. The IDE does not make this as easy as it could, and we are having to focus quite a lot of attention on VS2010 at the moment. |
zen is the art of being at one with the two'ness |
 |
|
Nobodo
Tomato Guru
    
126 Posts |
Posted - Apr 12 2010 : 2:02:00 PM
|
Hi again. It has now been over 9 months since this problem was reported. It prevents a very useful feature of VAX from working if you also use an extremely useful (aka ESSENTIAL) feature of VS, the ability to collapse code.
Any news? |
 |
|
sean
Whole Tomato Software
    
USA
2817 Posts |
Posted - Apr 12 2010 : 2:45:35 PM
|
No change in 1819 but a solution is currently being tested and should show up in the next release cycle (that is, if 1819 does not get promoted to general release and we have an 1820, it won't be fixed in that one either). |
 |
|
Nobodo
Tomato Guru
    
126 Posts |
Posted - Apr 13 2010 : 2:09:26 PM
|
Thanks, Sean! That is very good news. |
 |
|
support
Whole Tomato Software
    
5566 Posts |
Posted - May 10 2010 : 9:00:37 PM
|
case=29360 is fixed in build 1823 |
Whole Tomato Software, Inc. |
 |
|
Nobodo
Tomato Guru
    
126 Posts |
Posted - Jun 14 2010 : 12:58:07 PM
|
This problem is still present in large code files with several collapsed sections.
For example, 1 C# class has 9,000 lines, with 300 or more collapsible sections. If I go to 'Outlining - collapse to definitons', then open one method, there is no 'Highlight Symbol under cursor' going on at all. The same is true with a lot of sections not collapsed and a number of collapsed sections. Find References works fine, but 'Highlight Symbol under cursor' might as well be turned off. In the same file, if I toggle all outlining so nothing is collapsed at all, the highlighting works fine.
I also find that if I work in one of these larger classes long enough, then go to a smaller class, the highlighting does not work there either until I close VS and reopen (stops working for the entire solution). |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19177 Posts |
Posted - Jun 14 2010 : 6:34:41 PM
|
Would you be able to send me a single large .cs file, that shows this problem, just for testing purposes?
If so please submit the file via the form:
http://www.wholetomato.com/support/contact.asp
including this thread ID or URL in the description, so we can match it up. |
zen is the art of being at one with the two'ness |
 |
|
Nobodo
Tomato Guru
    
126 Posts |
Posted - Jun 15 2010 : 2:00:25 PM
|
Sure, it might be a day or two before I'll have the chance but I'll do that.
Thanks, Mark. |
 |
|
Nobodo
Tomato Guru
    
126 Posts |
Posted - Jun 28 2010 : 11:39:53 AM
|
I haven't sent a file because I can't find a single file by itself that will do this. It seems to be related to the size of the project/solution.
With small projects and solutions, I do not see the problem, even with large classes. With larger projects and solutions, sometimes even in tiny classes the 'highlight symbol under cursor' does not work. In larger solutions, 100% of the time it doesn't work in larger classes, and after working in the larger solution for a while it completely stops working altogether. This is code that builds fine (happens in the prod release code branches also).
Sorry I can't be more specific than that. I generally work on large solutions or small ones; no problem with small ones but this feature is now unusable on larger solutions.
This new "non-working" problem (related to the "collapsed code" problem but different) started a couple of builds ago; no problem before then. It could be that it is a problem introduced with the fix to the "collapsed code" bug. Rebuild symbols/clear cache has no impact. |
Edited by - Nobodo on Jun 28 2010 11:46:12 AM |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19177 Posts |
Posted - Jun 28 2010 : 4:38:31 PM
|
I have reproduced something, but I am not sure I am seeing the same problem you are.
case=29360
I am working in a 3,663 line .cs file, and after using "Collapse to Definitions" and then expanding a single function VA highlighting of the symbol under the cursor stops working. This is happening for me every time, in both VA 1823 and VA 1827, even when I open the file on its own.
So far when working in a "large" C# solution I cannot reproduce the problem where highlighting just stops in other files. The solution has 1,381 files, and the source code is about 10meg in size. How does this compare to your solutions, where you are seeing problems? |
zen is the art of being at one with the two'ness |
 |
|
Nobodo
Tomato Guru
    
126 Posts |
Posted - Jun 29 2010 : 09:48:27 AM
|
I always collapse to definitions, and open only what I am working on when in any sizable class. I don't tend to do that in smaller classes.
The solutions I don't see this in are perhaps only a few classes and a couple of projects. I'll have to check what the smallest of the 'larger' solutions is that I see this problem with all the time. The solution I'm in today is all C#, has 319 folders, 4228 files, 27 projects, and is 218Mb in size. In this solution I am seeing the problem all the time in the larger classes, and most of the time in the smaller ones.
BTW - if this helps -- I believe this problem started with build 1823, or perhaps it is only another variation of a problem 'fixed' in 1823. Using VS2005, other plugins are "SonicFileFinder" and "Sql Prompt", but I've been using those plugins all along without seeing any interaction with VAX. I'll be updating the solutions for this customer to VS2010 within the next month; what impact that will have on this problem I don't know.
Here's another curiosity -- I a doing a release today, so right now the QA and Prod branches contain exactly the same code. In the prod branch the problem happens much more frequently than in the QA branch. I've noticed that over the past couple of weeks; the one solution has the problem consistently more often than the other. That is what first made me think rebuilding symbols and clearing cache, closing, restarting would help with the problem, but they do not.
Thanks, Mark. |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19177 Posts |
Posted - Jun 30 2010 : 08:52:45 AM
|
Your solution is a lot larger than the one I tried, so this might be a factor.
When you were looking at the two branches today, do you know if you had a lot more files open in the Prod branch IDE than the QA branch IDE?
I am searching for some clue as to what was encouraging the problem in one IDE over the other. |
zen is the art of being at one with the two'ness |
 |
|
Nobodo
Tomato Guru
    
126 Posts |
Posted - Jul 01 2010 : 1:23:16 PM
|
The initial state of the branch with the bigger problem is that it has roughly the same number of files open (5) as the other (6), but one of those 5 files is a really huge class. When I close the really huge one the problem is not reduced. The next time I check in this branch I'll do it without a large file open to see if that is where the difference is in this problem.
Thanks, Mark.
|
 |
|
Nobodo
Tomato Guru
    
126 Posts |
Posted - Jul 08 2010 : 4:52:06 PM
|
I have now converted these projects to VS2010, and am seeing a different flavor of this same problem.
When I click on a variable, the VAX colors are ignored, and the VS setting for "Highlighted Reference" are used instead.
Is there a way to get VS2010 to use the VAX "Highlight references using" colors with "automatically highlight references to symbol under cursor"?
Thanks, Mark. |
Edited by - Nobodo on Jul 09 2010 09:06:27 AM |
 |
|
sean
Whole Tomato Software
    
USA
2817 Posts |
Posted - Jul 09 2010 : 12:17:12 PM
|
The VA automatic highlight references feature is automatically disabled in C# files in VS2010 when the IDE version is enabled.
To see highlighting from VA in VS2010 C#, disable Tools | Options | Text Editor | C# | Advanced | Highlight references to symbol under cursor (assuming that the VA option is enabled).
The VA behavior in VS2010 is not affected by the collapsed outlining as it is in earlier versions of VS. The original testcase we were using for case=29360 does still pass, but as you've brought to our attention, there are still issues that we are investigating. |
Edited by - sean on Jul 09 2010 12:21:30 PM |
 |
|
Nobodo
Tomato Guru
    
126 Posts |
Posted - Jul 09 2010 : 1:48:36 PM
|
Thank you, Sean. I disabled the VS setting for 'Highlight references to symbol under cursor' and the VAX symbol under cursor is working perfectly in VS2010.
I definitely prefer the VAX highlighting for this, as there is no delay, and there are different colors for reads and assignments. I find the different colors EXTREMELY helpful.
I'd recommend putting an explanation in the popup instructions in VAX for "Automatically highlight references to symbol under cursor" of the need to turn off the VS setting.
Thanks again, Mark. |
 |
|
sean
Whole Tomato Software
    
USA
2817 Posts |
Posted - Jul 09 2010 : 8:23:44 PM
|
Thanks for feedback - good point re: the popup instructions. Since the option is on by default, we'll need to think about how best to communicate them. |
 |
|
Nobodo
Tomato Guru
    
126 Posts |
Posted - Aug 06 2010 : 1:00:29 PM
|
quote: The VA behavior in VS2010 is not affected by the collapsed outlining as it is in earlier versions of VS.
I am still seeing this problem in VS2010. Build 1827.
If I expand all collapsed regions, the problem is not present. If I have collapsed regions above where I click (for the 'highlight under cursor') I see the problem consistently.
I also see the previously described symptom where the highlighting works if the cursor is on an item at the top of the edit window but not if it is lower down.
|
 |
|
feline
Whole Tomato Software
    
United Kingdom
19177 Posts |
Posted - Aug 09 2010 : 11:54:44 AM
|
Thank you for the update. This is still being looked at, but unfortunately no progress to report yet. |
zen is the art of being at one with the two'ness |
 |
|
Topic  |
|