Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Invalid suggestions
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Nobodo
Tomato Guru

126 Posts

Posted - Aug 09 2012 :  10:13:22 AM  Show Profile  Reply with Quote
I've actually seen this for years, but have been ignoring it and never reported it even though it is pretty irritating.

VAX will often suggest completion items that are totally invalid.
What I'm reporting here are actually two different problems, but they relate to each other and compound each other.

In the image below, the current class inherits from an abstract base class a property called 'FordDivision'. The base class had two private variables called 'fordDivision' and 'fordCSPDivision'.

I went to the base class and removed the private variable 'fordCSPDivision'. I then saved the base class.

Then I tried to add to the child class a reference to the property in the base class. I type the first few letters, and VAX pops up a selection dialog of choices. However, instead of only including the property, it also includes the two base class private variables that it cannot access at all. One of those base class private variables was removed from code and the change was saved before anything was typed in the child class. See the suggestions in the image below.



I then forced VAX to reparse both files. After doing that, the private variable 'fordCSPDivision' no longer appeared in the suggestion dialog, but the private variable 'fordDivision' still appeared even though it was inaccessible.



Like I said, I've been working around this problem for a long time, but occasionally I will forget and choose the wrong suggestion. The image above shows what happens when a build is done after accepting the invalid VAX suggestion.

So two things here.
  • Why does VAX put ANYTHING in the suggestion list that is not accessible at all from the point of suggestion?
  • Why does VAX not reparse files automatically when changes are made and saved? I can wait several minutes (no keyboard activity) and still VAX presents variables that have been removed (and saved), and then have to force VAX to reparse the files.


Thanks,
Mark.

Edited by - Nobodo on Aug 09 2012 10:32:23 AM

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Aug 11 2012 :  02:46:20 AM  Show Profile  Reply with Quote
Suggestion listboxes are just guesses from VA about what you might be typing, so the longer you type, the better suggestions you get. Recently-typed and nearby symbols are likely suggestions. You can even configure Visual Assist X to include bits of code in your suggestions to help reduce the typing of repetitious code. These bits of code are typically taken from nearby lines. They mostly there just so you can avoid re-type or copy-paste, but they aren't necessarily correct.

So basically, they are just symbol "collections", without strict context verification. When creating new code (e.g. typing in a new member) the we wouldn't be able to know the name of the new symbol, but the suggestions are still there, so you can accept a similar name and then correct it. We have recently introduced "smart" suggestions which improves suggestions based on context, but they don't recognize every situation and still not as strict as member listboxes.

Regarding the member delete problem: I wasn't able to reproduce the problem here. Can you please try creating a clean new test project to see if you can reproduce the problem there? It may depend on the code you use or other circumstances. If you are seeing the same in the test problem, you can send it in, so I can look into the problem, and hopefully will be able to reproduce it here, using the very same code.

The easiest way to send the project is to zip it up and send the zip via the following form:
http://www.wholetomato.com/support/contact.asp

Please include the URL of this topic in the description field so we can match it up.
Go to Top of Page

Nobodo
Tomato Guru

126 Posts

Posted - Aug 11 2012 :  3:31:05 PM  Show Profile  Reply with Quote
quote:
Originally posted by accord

Suggestion listboxes are just guesses from VA about what you might be typing, so the longer you type, the better suggestions you get.



I'm sorry, but that doesn't make a lot of sense to me.
Visual studio provides its own suggestions when you type, and the only reason to use the suggestions provided by VAX would be if they improve on the suggestions made by Visual Studio.

The case I presented is a class that inherits from a base class. The base class has a private variable that has the same name as a public property, but with a different case. This is a standard practice for variable naming.

So.... from the point where I am typing, the only possible match that starts with the letters 'ford' that is accessible at all is the property "FordDivision". The private variable "fordDivision" is not accessible at all. It would not matter how many letters I typed, VAX would continue to suggest a completely invalid variable name that is not accessible.

Ok, now lets go back to the statement "The only reason to use the suggestions provided by VAX would be if they improve on the suggestions made by Visual Studio.".
Visual Studio NEVER makes a suggestion of something that is completely inaccessible from the point where you are typing. If it did, it would be a bug reported to the VS Dev team to fix; suggestions should never allow code to break.

Ok, now let's look at the competition. Resharper provides suggestions as you type, and nothing is ever suggested that is completely inaccessible and would break code if accepted.

  • With VAX enabled, when I type 'ford' in this situation, I am presented with the options 'FordDivision' and 'fordDivision'. If I accept one of those suggestions I am ok, if I accept the other one I just broke my code.

  • With VAX disabled and Resharper enabled, when I type 'ford' in this situation, I am presented with only one option, 'FordDivision', and it is the only valid option so I can happily accept it.

  • With no addins at all enabled and I type 'ford' in this situation, VS2010 presents me with with only one option, 'FordDivision', and it is the only valid option so I can happily accept it.


It really sounds like you are saying that VAX has chosen to take a totally different path with suggestions than the original path as envisioned by Microsoft and improved on by other products.

If VAX in fact makes no attempt to ensure suggestions will not break code, how are the suggestions made by VAX an improvement on the suggestions already provided by Microsoft? Can you explain why it is a good thing for VAX to suggest a variable name that exists but is not accessible at all from the point where it is suggested? How is that helpful in the slightest?

Thanks,
Mark.

Edited by - Nobodo on Aug 11 2012 3:34:09 PM
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Aug 13 2012 :  6:12:00 PM  Show Profile  Reply with Quote
You made some valid points, and you are absolutely right: VA should improve the user experience without breaking anything that already has worked. I work with C++, but it seems things are a little bit different in C#, and your example is a bug rather than a "feature", in C#. (we'd like to improve the C++ behavior as well with private variables, though) Our goal is to be consistent with default intellisense, and when it's done we improve the experience over it. Cases when VA is not consistent are handled as bugs.

Unfortunately, I wasn't able to reproduce your problem so my first goal is to reproduce it. I started from a very simple code "snippet" to see whether you see the same thing as me, so we can see if you have some different settings or you have something in your code that triggers this problem.



Can you please create a new C# test project to see if you can reproduce the problem on your side by pasting the following code into a .cs file?
namespace TestNS
{
    class testbase
    {
        private int Apple;
    }
    class testsub : testbase
    {
        void func()
        {
            
        }
    }
}


With test projects we can rule out other factors and so it's more likely that we're able to repro the problem here. If you're cannot reproduce, do you have any idea what change could trigger the bug?

Anyway, we may mean different things by suggestions, which would lead to further confusion, so let's clear this a little bit up. Visual Studio can create seemingly invalid suggestions, depending on what we call a suggestion:

Visual Assist is disabled:



So this is why I wrote that suggestions are just "guesses". This is a different context though, but with suggestions, VA have to deal with a lot of types of contexts like this, and we support some of them.

An example when VA improves the default behavior:



VA analyzes the context and only suggests variables that has the same type, after you press space after the '='.
You can read more about smart suggestions here:
http://www.wholetomato.com/products/features/smartSuggestions.asp

We call anything a "suggestion" that appears when you "just type" in contrast with "member" listboxes which appears after you press . (dot) (e.g. after an object, namespace, etc.)

Edited by - accord on Aug 13 2012 6:15:40 PM
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Aug 13 2012 :  6:18:03 PM  Show Profile  Reply with Quote
(I attached a wrong screenshot for my second screenshot, so if you have already read my post (e.g. because you've subscribed to the topic), please take a look at the corrected screenshot because the previous was totally out of context)

Edited by - accord on Aug 13 2012 6:21:39 PM
Go to Top of Page

Nobodo
Tomato Guru

126 Posts

Posted - Aug 14 2012 :  07:55:10 AM  Show Profile  Reply with Quote
Thanks for the replies. I'll create a small test project this weekend to demonstrate the problem.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000