Author |
Topic |
Nobodo
Tomato Guru
126 Posts |
Posted - Nov 24 2008 : 2:51:21 PM
|
I would really appreciate it if an option could be added to not display regions in places like the find references display and the context dropdown. Some places are really fond of regions and as part of their coding standards want regions around each property and method. This REALLY looks bad in some of the VA displays. I would even call it a bug in the find references display, since regions in completely unrelated classes are displayed.
Using build 1649 (C#, VS2005), but these issues are not unique to that build.
Sample find references, finding unrelated regions. Note that I looked for references to a method in one class, and it found totally unrelated regions in other classes.
Sample context dropdown. That is a LOT of regions to wade through before ever getting to real code!
Thank you! Mark. |
Edited by - Nobodo on Nov 24 2008 2:56:50 PM |
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
Posted - Nov 24 2008 : 4:32:01 PM
|
I am seeing the same effect here. I have put in a bug report for find references:
case=21070
I have put in a feature request to be able to turn off showing regions in alt+m list to see what our developers make of it:
case=21071 |
|
|
Nobodo
Tomato Guru
126 Posts |
Posted - Nov 25 2008 : 3:40:42 PM
|
Thank you!
Va_outline is another place that could be MUCH MORE useful with the option to turn off the display of regions. See example:
|
|
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
Posted - Nov 26 2008 : 1:46:45 PM
|
We are planning to use an outline behavior definition file to control what to hide:
case=19673 |
Edited by - accord on Nov 26 2008 1:48:57 PM |
|
|
sean
Whole Tomato Software
USA
2817 Posts |
Posted - Jan 27 2009 : 8:32:52 PM
|
case=21071 is implemented in build 1715 as a registry only setting.
To disable the display of regions in the Methods in File list: Close all instances of Visual Studio. Use regedit to change the value of MethodsInFile_Regions to 00 to disable the display of regions in the alt+m list. (HKCU\\Software\\Whole Tomato\\Visual Assist X\\VANet9 for vs2008, VANet8 for vs2005, etc).
|
|
|
Nobodo
Tomato Guru
126 Posts |
Posted - Apr 20 2009 : 10:33:03 AM
|
Has there been a regression on this?
I have MethodsInFile_Regions = 00, which has worked since 1715, but now in 1722 I'm right back to getting every single region that has in it the method name I'm searching for.
Thanks, Mark.
|
|
|
Nobodo
Tomato Guru
126 Posts |
Posted - Apr 20 2009 : 10:44:35 AM
|
Actually... rereading this thread... it only states that the alt+m list has been changed. I can confirm the alt+m list is ok, still not displaying the regions when I have that registry key set...
BUT... I could have sworn (or I'm delusional) that it also changed the behavior of the "VA Find References" searches? Here's what I see today with 1722 when I search for references to a method named 'Execute' in a class named 'DialerFulfillment', which only has one reference anywhere in the solution:
|
|
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
Posted - Apr 21 2009 : 12:06:11 PM
|
I am seeing a change in behaviour between VA 1715 and VA 1722:
case=21070
It looks like this was never officially fixed, so I am not sure why it worked more successfully in VA 1722.
Are you seeing other problems as well, besides the #region lines? Your screen shot is rather long, and without knowing your code, I don't know which bits are considered correct and which bits are considered wrong. |
zen is the art of being at one with the two'ness |
|
|
Nobodo
Tomato Guru
126 Posts |
Posted - Apr 22 2009 : 10:11:46 AM
|
Sorry, I should have highlighted the correct references. In the example above, the first entry (minus the #regions) is the actual method that references were searched for. The entry near the bottom that says "ExecutePull (933): if(Dialer.Execute(batchLogID)) is the only valid reference.
The thing I see as a regression: #region sections anywhere in the solution that have the same word in them as the reference being searched for are appearing as references.
This I see as a new problem that only started a few builds ago: References within xml comment documentation are also appearing in the search results. This problem also appears in the example above (near the bottom), but gets kinda lost in the sea of #region results. So here is a new example that has a references search for a very unique method name that isn't repeated in a ton of #region lines.
Note the two references in xml comments (one highlighted). I doubt anybody would find it helpful when searching for references to a method to get results that include the method in xml comment documentation.
Thank you, Mark. |
|
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
Posted - Apr 22 2009 : 10:55:59 AM
|
To make the screen shots easier to read you can delete lines from the Find References Results list. Just press Delete on the keyboard, or use the right click menu. You can delete a file, taking out all items in the file, or just a single reference in a file.
The #region lines, it is sort of a regression. It seems to have been fixed by accident in VA 1715 and returned to "normal" behaviour in VA 1722.
The current line in the results list, the file name says .xml, so I am confused by "xml comments". XML comments are normally added to .cs files, starting with /// at the beginning of each line.
What are you talking about? Can you post a code sample showing what VA is searching please? |
zen is the art of being at one with the two'ness |
|
|
Nobodo
Tomato Guru
126 Posts |
Posted - Apr 22 2009 : 12:46:54 PM
|
If you have a web application added to a solution instead of a website, xml documentation is created in the website's bin folder. Until recently, this xml documentation was (correctly in my opinion) not being searched on a 'find references'.
So if your methods, properties, etc. have xml documentation on them, this documentation is created at compile time into a separate documentation file.
In the example above, the xml documentation present in the source code for the method 'CreateMasterSlaveLinkage' was added at compile time to the documentation file "BusinessObjects.xml".
Example: header of this method in the C# code: /// <summary> /// Overloaded. Creates a master / slave link between two policies. Returns true if new link is created, false /// if other contract is not already a collection member or already linked /// </summary> /// <remarks> /// Function name: CreateMasterSlaveLinkage /// Creation date: 2/12/2008 /// Author: msjohnson /// Modification History: /// msj - 2/12/2008 - Initial Revision /// Further Description: /// </remarks> /// <param name="OtherContractIsSlave">If true, the other contract is the slave. If false, the current contract is the slave</param> /// <param name="OtherContractFullContractNumber">Full contract number of the other contract</param> /// <returns>bool indicating sucess of operation</returns> public bool CreateMasterSlaveLinkage(bool OtherContractIsSlave, string OtherContractFullContractNumber) {
Example: the above xml comments as compiled into the xml documentation file named businessobjects.xml: <member name="M:AGI.CSP.ContractQuote.OtherContracts.CreateMasterSlaveLinkage(System.Boolean,System.Decimal)"> <summary> Overloaded, creates a master/slave linkage when ContractQuoteID of other contract is known </summary> <remarks> Function name: CreateMasterSlaveLinkage Creation date: 2/20/2008 Author: msjohnson Modification History: msj - 2/20/2008 - Initial Revision Further Description: </remarks> <param name="OtherContractIsSlave">If true, the other contract is the slave. If false, the current contract is the slave</param> <param name="OtherContractQuoteID">ContractQuoteID of the other contract</param> <returns>bool indicating sucess of operation</returns> </member> |
Edited by - Nobodo on Apr 22 2009 12:51:18 PM |
|
|
Nobodo
Tomato Guru
126 Posts |
Posted - Apr 22 2009 : 12:55:20 PM
|
In the example above, I pulled the code documentation for one overload of the method and the nodes in the xml doc file for the other overload. This doesn't really matter to this thread so the only reason I'm commenting here is I don't want you to get confused when you see different signatures. Sorry for the confusion. |
Edited by - Nobodo on Apr 22 2009 12:56:14 PM |
|
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
Posted - Apr 22 2009 : 3:42:00 PM
|
This makes sense, and I see where this XML file comes from. I don't understand why VA is looking inside of it though.
Can you please make sure this XML file is not open in the IDE and then open VA's OFIW dialog. If you filter the dialog on ".xml" is this documentation file listed?
More specifically, is the file part of your solution? In my test project this file is not part of the solution by default. |
zen is the art of being at one with the two'ness |
|
|
Nobodo
Tomato Guru
126 Posts |
Posted - Apr 23 2009 : 11:03:24 AM
|
Hi again.
The xml documentation files are not part of the solution; nothing in the website's bin folder is. However... since these files do exist (get created) in the folder structure of the website they are considered part of the website project (any files in a website structure are considered part of the project and part of the website).
I can right-click on these files in solution explorer and exclude them from the project. All that really does is rename the files to .xml.exclude. When I do that and do a VA find references, they do not appear in the results. However, as soon as I do a build the xml documentation files reappear, and also reappear in VA find references searches.
The xml file(s) are not open in the IDE; in fact the only times I have ever opened them is when they have appeared in VA Find References results.
On the OFIW dialog, yes the xml documentation files do appear. Again I think this is probably because there is no official list of files belonging to a website, their mere presence makes them part.
I just did a test with interesting results. I manually deleted the .xml documentation files, and confirmed they did not appear in a Find References search. I did a build, which recreated the .xml files. I again did a search, this time the VA Find References did not see them, and neither did OFIW. I restarted the IDE to see if it was an anomaly, and it wasn't, the files still were not seen in either search. Then I cleared the VA history and rebuilt symbols, restarted the IDE. After VA finished its indexing, the xml files were not showing up in any of the searches.
So... at this point it is working correctly (from my perspective anyway), and these .xml documentation files are not showing up in the VA searches. I don't know if they will reappear in the future, though.
Unless this xml doc problem reappears, I guess the only issue here is still the original ones of regions showing up in searches.
Thanks, Mark.
|
|
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
Posted - Apr 23 2009 : 3:48:43 PM
|
The XML file is being re-created due to a project setting in VS2005, perhaps Build settings.
Currently I am trying to work out why my project is behaving differently to yours. I have turned on building this documentation XML file, but it is not being automatically picked up. Using VS2005 I have created a new Project of type Visual C# -> ASP.NET Web Application.
Is this the wrong type of project?
VA searching all files that are "part of the project", so that are listed in OFIW, is an interesting point. Find References should probably ignore XML files while I suspect Rename should probably include them as comments / string references. |
zen is the art of being at one with the two'ness |
|
|
Nobodo
Tomato Guru
126 Posts |
Posted - Apr 23 2009 : 4:14:34 PM
|
At this point the .xml files are there and for whatever reason something in the sequence of changes I made caused VA to stop seeing them. I'm not sure I can recreate it.
Yes, it is an asp.net web application. Yes, the build settings say to create these .xml documentation files, because we have an automated process that uses them to create a documentation website.
Since I'm not seeing the problem anymore, it might not be worth your time trying to replicate it unless it comes back or others report it.
I know the .xml doc files started appearing in search results on or about build 1715, but they have been present for well over a year.
Thanks for your help, Mark.
|
|
|
Nobodo
Tomato Guru
126 Posts |
Posted - May 01 2009 : 3:24:34 PM
|
Back to the original purpose of this thread...
case=21070 This was apparently unintentionally fixed in (somewhere around) 1715, then broken again in a later build.
I just want to add that it is not only Regions that this problem shows up in.
For example, I just did a 'find references' on a method named 'Register' in a database class, to see where in this solution this particular method is used. I end up with this:
Note that every webpage that has a control registered shows up in the search. That has nothing to do with what I'm looking for references to! By contrast, here is the same 'find references' search in Resharper:
No misses, and easy to read results.
Same search in MZ-Tools:
Now mz-tools doesn't search web projects, but what it does search matches the Resharper search exactly.
I hope some of these issues with VA find references can be addressed; I'd rather not have to turn to other tools for this purpose.
Thanks, Mark. |
|
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
Posted - May 02 2009 : 5:02:36 PM
|
Lets start by assuming I know nothing at all about ASPX files, which is basically true
What are these lines that are being picked up? Are they comment lines? Some form of code line? Do they go somewhere special in an ASPX file?
I am not interested in learning all about ASPX files right now, I just want to construct a sensible test case. I have a sample ASPX file that I use for testing things, and it is just a very simple piece of HTML with a couple of empty script blocks in it, one for JavaScript and one for VBScript.
The screen shots, I am not sure what I am looking at. The other two screen shots look different, more tree like, but this is not a particularly helpful observation. Is there some feature in particular you like, or is it just that they are not finding unwanted results? |
zen is the art of being at one with the two'ness |
|
|
Nobodo
Tomato Guru
126 Posts |
Posted - May 04 2009 : 10:16:40 AM
|
Hi again. The 'register' entries in the example screenshot are directives in a webpage that register user controls or custom controls for use in that webpage. What I was searching for references to had nothing at all to do with that.
Really the point I was making is that a 'VA Find References' is in a LOT of cases not really doing what a developer is expecting. This is one specific example of confusing the results, but there seem to be a lot of ways. If you click on a method name and then perform a 'find references', you expect to get results that are just the places in the solution where that particular method is referenced, not all the places in code where that word happens to exist.
I included screenshots from a couple of other tools mostly just to show what is expected when performing a 'find references'. Honestly in my opinion this functionality in VA is so easy to confuse and return meaningless results that it really needs to spend a lot of time in QA to make it work correctly. Doing a 'find references' search is a very important part of coding (especially when working with somebody else's code), and when the results are cluttered with nonsense matches the usefulness approaches zero very quickly.
Thanks, Mark.
|
Edited by - Nobodo on May 04 2009 10:23:32 AM |
|
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
Posted - May 05 2009 : 10:47:35 PM
|
I agree with your specific point, but I do want to comment on your use of the word "code". In terms of scanning actual code Find References works quite well. I base this statement on lots of test cases I have run, and the nature of the edge case bugs I see working support.
One problem here is "other" file types, files that may not actually contain code. VA 17xx has introduced initial support for ASP/ASP.NET, HTML, XML, JavaScript, VBScript, and XAML which is where the problems seem to be coming from. Extra files need to be scanned for Find References to work in these languages.
I have put in a bug report for the "Register" keyword in ASPX files:
case=26668
Find References and XML files, I have just created an XML documentation file from some C# code in VS2005, and then manually added this XML file to the solution. It is listed in Solution Explorer.
Even after a restart Find References is not searching inside this XML file. If I open the XML file then the function name that I am searching for is present, but VA is not picking it up.
This is with VA 1723.
Which version of VA are you currently using?
It looks like there is some specific trigger to get VA to search inside XML files like this, which I have not yet found. |
zen is the art of being at one with the two'ness |
|
|
Nobodo
Tomato Guru
126 Posts |
Posted - May 06 2009 : 12:30:26 PM
|
On the "Register" keyword in asp.net files (case=26668) I don't have time to test now, but I seriously doubt it is specific to the 'Register' directive. For example, see the list of directives here: http://authors.aspalliance.com/aspxtreme/aspnet/syntax/pagedirectives.aspx I'm willing to bet it would happen with any of them.
Along with the originally reported problem (case=21070 references results showing any occurrence of the same word in the comment text for a region), the impression is that VA will find all the real references, then instead of stopping there it does an additional search for any occurrence of the word in places it doesn't really understand. If it didn't mingle those "I don't really understand whether this is a reference or not" with the definite reference matches, then it wouldn't be a problem. For an example, see the screenshot above of a Resharper 'Find References'. Note that it has a separate display below the actual references of 'textual occurrences' it found. If VA kept all the "I don't knows" separated like this, they wouldn't really be an issue.
On the xml doc: I saw the problem with ~ 1715 through 1721. As stated above, I tried fiddling with it quite a bit including deleting the files and letting a compile add them back, and at the same time deleting the VA cache. Somewhere in that mix of testing the problem disappeared. I have not seen that problem since then, and I'm now on 1724. I get the impression that rebuilding the cache while the xml files were not present did the trick, then they were not seen again.
Thanks, Mark.
|
Edited by - Nobodo on May 06 2009 1:08:49 PM |
|
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
Posted - May 06 2009 : 7:32:42 PM
|
VA is supposed to keep "textual occurrences" separate, they should not show up at all in the Find References Results list.
If you run Rename then they should show up, but can be selected / unselected all at once via the "Comments and Strings" check box.
I had not really taken in that feature of the Resharper screen shot, thank you for pointing it out. This is something to consider.
The ASPX keywords, you are quite right, all of those words show the problem. Thank you for the link, my first search for register and ASPX just returned web pages inviting you to register *sigh* which was very little use.
XML files, something very strange is going on here. Hopefully this problem will stay fixed, but if it comes back again then we need to try and find out what the trigger is, so it can be properly fixed. |
zen is the art of being at one with the two'ness |
|
|
Nobodo
Tomato Guru
126 Posts |
Posted - May 08 2009 : 10:15:40 AM
|
quote: The ASPX keywords, you are quite right, all of those words show the problem. Thank you for the link, my first search for register and ASPX just returned web pages inviting you to register *sigh* which was very little use.
My apologies; I should have explained the directives better instead of causing time to be wasted.
Thanks for your help, Mark.
|
|
|
Nobodo
Tomato Guru
126 Posts |
Posted - May 08 2009 : 1:45:04 PM
|
XML doc again:
quote: Find References and XML files, I have just created an XML documentation file from some C# code in VS2005, and then manually added this XML file to the solution. It is listed in Solution Explorer.
Even after a restart Find References is not searching inside this XML file. If I open the XML file then the function name that I am searching for is present, but VA is not picking it up.
This is with VA 1723.
Which version of VA are you currently using?
Using 1724, this has returned. Here is an example I just did in 1724 with a result in an xml doc file, and also including two 'region' statements that happen to have the text in them.
|
Edited by - Nobodo on May 08 2009 3:00:41 PM |
|
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
Posted - May 11 2009 : 2:22:44 PM
|
After some more testing I have managed to reproduce the XML files problem here:
case=26866
The project type seems to matter. I seem to have a reliable test case, so I have no idea why the problem appears and disappears for you. Do you have ReSharper and MZ-Tools installed on the same machine at the same time? It is possible there is some form of interaction between VA and one or both of these tools, which explains why this problem appears and disappears.
I am not sure why this should happen, but it is possible. |
zen is the art of being at one with the two'ness |
|
|
Nobodo
Tomato Guru
126 Posts |
Posted - May 12 2009 : 1:48:05 PM
|
I have MZTools loaded at all times on all machines. I've never seen any problems with it and other addins.
I have Resharper set to not load on startup, so it is on-demand. I typically use the add-in manager to load it when I need to use its functionality, then to unload it when I am done using it.
yes, I have seen a number of undesirable interactions between VA and Resharper, that is why I have Resharper 'load on demand'. Since VA doesn't obey the add-in manager settings, I can't do the same with VA, so it is either installed or uninstalled. I have sometimes used the registry hack to turn off VA when I know I am going to be using Resharper quite a bit, but of course that requires a reverse registry hack while Visual Studio is unloaded to be able to open VA again, so I avoid that unless necessary.
Thanks, Mark.
|
|
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
Posted - May 12 2009 : 6:31:14 PM
|
Your comment about the add-in manager interests me. There is actually a known bug in VS2005 its self, the add-in manager does not work correctly. You can use the add-in manager to tell VA not to load in the other IDE's where it works correctly.
It sounds like ReSharper is working around this bug its self.
We try to fix interaction problems between VA and ReSharper when we find them.
This does not really sound like a plugin interaction problem. Fixing this, removing or separating out XML files in the Find References Results list should help, regardless of this random aspect. |
zen is the art of being at one with the two'ness |
|
|
Nobodo
Tomato Guru
126 Posts |
Posted - May 13 2009 : 1:58:53 PM
|
??? A lot of other addins load, unload, and startup correctly per the addin manager settings in vs2005 by using a .addin file. Quoting from the MS page referenced in the VA forum 'Troubleshooting' post 'How do I stop Visual Assist X from loading?' :
quote: It appears that VS2005 supports loading of addins listed at: HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Addins
But it does not support modification of "Startup" (LoadBehavior) for addins listed at that key.
Addins that use a .addin xml file located at: <userprofile>\\My Documents\\Visual Studio 2005\\Addins are supported properly.
|
|
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
Posted - May 14 2009 : 1:01:59 PM
|
As far as I know VA does not use a .addin file. VA does things the "other" or "hard" way, we have to, due to the things we do to the IDE, often without its knowledge. Remember we also support VC6, which works quite differently.
So the IDE dialog works for most addin's, but it does not work for all addin's, and VA is one of the addin's that it does not work for. This suggests that ReSharper does use a .addin file.
The registry key you change to stop VA from loading is actually the registry key that the addin's dialog is expected to change but does not. |
zen is the art of being at one with the two'ness |
|
|
Nobodo
Tomato Guru
126 Posts |
Posted - Jun 10 2009 : 3:27:04 PM
|
quote: Originally posted by accord on 11/24/2008
I am seeing the same effect here. I have put in a bug report for find references:
case=21070
Is there any progress on this?
Here is an example Find References I just did for a method named 'Create' in a class named 'PaymentInfoFactory'. There should be two items returned; the actual method itself and the one, single time it is referenced anywhere in code (the highlighted line in the below image). Instead, I get multiple pages (yes, pages!) of things that should not be included at all in classes that have never heard of PaymentInfoFactory.Create(). Often I have to wade through screens of false hits to find the real references. This is a bug that drives me to other 'find references' tools daily!
Thanks, Mark.
|
|
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
Posted - Jun 12 2009 : 2:11:26 PM
|
Good news, this has been fixed internally and the fix should show up in the next build of VA, which is due soon. |
zen is the art of being at one with the two'ness |
|
|
Topic |
|