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
 1640: listboxes are irritating me
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Uniwares
Tomato Guru

Portugal
2321 Posts

Posted - Jun 21 2008 :  12:53:28 PM  Show Profile  Reply with Quote
VS2005, C#

I dont know when that started but the listboxes are really irritating me now, although i have checked "List non-inheritet members first", the first selected member is ALWAYS the first inherited member.
It also seems to me that the match preference when typing is ALWAYS on inherited members, instead of local variables or direct class members.
I very often end up writing more now with VAX than as I would without it since i have to correct the mistakes VAX makes.

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jun 22 2008 :  6:29:29 PM  Show Profile  Reply with Quote
You may already know that, there are 2 types of listboxes: suggestion listboxes are VA's best guess at what you might be typing. Member listboxes appear after typing a dot or -> and list the class members.

About "List non-inherited members first": They are only applies to member listboxes, so suggestions listboxes do not give preference to non-inherited members. Can you try the following: type "this->" For me non-inherited members are the first, and when I start to type and an inherited and a non-inherited member begins with the same word, the preferred selection will be the non-inherited one. If you seeing something different: can you give me an example when this goes wrong?

About match preference: There is a feature request to give more priority to local symbols:

case=10535
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2321 Posts

Posted - Jun 22 2008 :  6:54:53 PM  Show Profile  Reply with Quote
When typing the selection may be on a non-inheritet member, not sure though, have to try it out. But anyway, the selection is by default at the first inherited member, so if you are not sure whats the name of the member, you MUST scroll to the beginning of the list ALWAYS.
Since the list is also used to "browse" this behavior is contraproductive.

Another thing that falls in here, but this has been reported I think, is that the selection is jumping too much between possible items, obviously without any preference when you type. Hope that gets fixed soon.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18941 Posts

Posted - Jun 23 2008 :  09:50:18 AM  Show Profile  Reply with Quote
using VS2005 and VA 1640 I have just added the following code to a C# file:

    class test_completion_list_BaseClass
    {
        public int baseNumber1;
        public int baseNumber2;

        public test_completion_list_BaseClass()
        {
            baseNumber1 = 0;
            baseNumber2 = 0;
        }
    }

    class test_completion_list_ChildClass : test_completion_list_BaseClass
    {
        public int childNumber1;
        public int childNumber2;

        public test_completion_list_ChildClass()
        {
            childNumber1 = 0;
            childNumber2 = 0;
        }
    }

    class test_completion_list
    {
        private void testCallingChildClass()
        {
            test_completion_list_ChildClass foo;
            // typing these lines, one at a time
            // the default selected item in the listbox is always the last called class member
            foo.baseNumber1;
            foo.childNumber1;
            foo.GetType();
        }
    }

I have both:

VA Options -> Advanced -> Listboxes -> Bold non-inherited members
VA Options -> Advanced -> Listboxes -> List non-inherited entries first

turned on. As the comment explains, when I type those three lines of code in "testCallingChildClass()" the default item in the listbox is actually the last item I used. Adding a 4th line proved the point, since "foo." defaulted to "GetType()".

Can you try this and see if you are seeing the same pattern? This is a very simple test case, perhaps to simple.

zen is the art of being at one with the two'ness
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18941 Posts

Posted - Jun 23 2008 :  09:52:02 AM  Show Profile  Reply with Quote
quote:
Originally posted by Uniwares

Another thing that falls in here, but this has been reported I think, is that the selection is jumping too much between possible items, obviously without any preference when you type. Hope that gets fixed soon.



Are you talking about the default selection, or how typing filters the list and changes the selection?

If my results about the default selected item hold true then this might explain why the default selected item keeps jumping at "random".

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2321 Posts

Posted - Jun 23 2008 :  10:04:33 AM  Show Profile  Reply with Quote
Add to your sample:
public void GetSomething(){}
public void GetSamething(){}

now type foo.gets and the selection will be on GetHashCode() instead of any of the two functions.

And the typefilters/selection change is whats totally out of control, but on the global completion level, like typing a local variable name and it jumps around between various classes, functions and other variables even if there is a direct match to the local variable.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18941 Posts

Posted - Jun 23 2008 :  4:45:29 PM  Show Profile  Reply with Quote
the default item in the listbox first. I am now using this code, using VS2005 and VA 1640 and C#. Currently I just want to decide what the IDE does by default.

class test_completion_list_BaseClass
{
    public int baseNumber1;
    public int baseNumber2;

    public test_completion_list_BaseClass()
    {
        baseNumber1 = 0;
        baseNumber2 = 0;
    }
}

class test_completion_list_ChildClass : test_completion_list_BaseClass
{
    public int childNumber1;
    public int childNumber2;

    public test_completion_list_ChildClass()
    {
        childNumber1 = 0;
        childNumber2 = 0;
    }

    public int GetHeight() { return 2; }
    public int GetWidth() { return 3; }
}

class test_completion_list
{
    private void testCallingChildClass()
    {
        test_completion_list_ChildClass foo = new test_completion_list_ChildClass();
        // default item in listbox when typing "foo." is the last item
        // selected from the listbox, as seen when typing the following three lines
        foo.|
    }
}


With VA disabled, when I first load the IDE and type the dot a listbox appears with the very first item selected, but no "focus". Once an item has been selected from the list it becomes the default item the next time the list appears. I need to restart the IDE to reset to this behaviour.

It seems the IDE remembers the selected item. Moving between two types, "test_completion_list_ChildClass" and "String" the IDE is remembering the last selected item for both classes. I don't know how many types it will remember this information for, but that is an interesting question.

It looks like VA is respecting this default item in the listbox. This is a *good* think when creating variables, e.g. when typing:

List<int> someList = new |

where you want the default item to be the type you are creating.

Do you find the default item in the list being the last item you selected from the list helpful or not? As soon as the list is "split", no longer in alphabetical order, then this makes a bit less sense.


The second point about typing a local variable, I have no idea what you are seeing. Can you try and explain what is happening? When typing a local variable I would expect you to see suggestions appearing and helping.

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2321 Posts

Posted - Jun 23 2008 :  5:17:36 PM  Show Profile  Reply with Quote
Default item seems to work just fine, EXCEPT that the selected/shown item when opening the list the first time is always on the first inherited item, no matter how you have VAX show the items.

After the first time, it does stay on the last used item. So far as expected. Now see the sample with the two additional functions I gave above.


Now to the type filter: thats quite old and still not really fixed. I guess you'll find my original post in the archives still.
Let me try a sample here:

    public class myClass {};
    public class myOtherClass {};
    public class my3rdClass {};
    public class myClassyClass {};
    public enum myEnumType {};
    public class myClassIwillUseNow
    {
        public void funcSomething() {}
        public void funcSomeOtherthing() { }
        public void funcOtherthing() { }

        public void funcTestMeHere(String myParam1, myEnumType myEnumParam, myClass unrelated, Object objectParam)
        {
            my3rdClass my3rd = new my3rdClass();
            myClassyClass mcc = | ; // first sample
            Console.Write(|); // second sample
        }
    }


Lets start: put the cursor after the "mcc = " and type o b j. To be helpful, VAX should suggest a local variable starting with obj (objectParam in this case), instead of the system type object. No help here from VAX to insert objectParam, except if I turn on shorthand and type instead opa.

Second sample: start typing mye, VAX pops up with two entries, myEnumParam and myEnumType, the later is selected. Why the preference on the type over the variable? No help again here. If instead now you cancel the list, press Ctrl+Space the same list comes up again, this time with the correct item pre-selected.

I will add new cases as i run into them, hope to make it clearer.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18941 Posts

Posted - Jun 23 2008 :  5:52:41 PM  Show Profile  Reply with Quote
I have been trying to pin this down for the last hour, and so has accord.

quote:
Originally posted by Uniwares

Default item seems to work just fine, EXCEPT that the selected/shown item when opening the list the first time is always on the first inherited item, no matter how you have VAX show the items.


Not for me. For me the default item is the first item in alphabetic order. Add the function "appleCount()" as a Non inherited item, and suddenly this is the default item when first loading the IDE, since it is the first in alphabetic order.

It *looks* like the item is always the first inherited item, simply because of the chosen names in the first set of examples.

The fact that the list has been re-ordered confuses this, but it is always the first in alphabetic order, which often ends up being in the middle of the list. But sometimes it is the first item in the list.

Hopefully you will see the same thing, if you look for it. I will have a look at the rest of this shortly.

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2321 Posts

Posted - Jun 23 2008 :  7:15:58 PM  Show Profile  Reply with Quote
No, sorry, not seeing the same thing here. Take for example a Forms.Control derived class which has a considerable amount of inherited and own members.
Example: a Timer control on a form named cTimer,
entering this.cTimer. VAX comes up with a list of members, the non-inherited in bold and first, followed by the inherited members. But the first selected item is now .Container which is the first inheritet item, instead of .Dispose which is the first non-inheritet item.
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2321 Posts

Posted - Jun 23 2008 :  8:25:18 PM  Show Profile  Reply with Quote
Just noticed one thing about it: using the lists toolbar to limit what is shown, it shows different behavior:
1) showing all: selection is on the first inherited item, non-inheritet items coming before this one
2) showing events: only non-inherited events are shown, selection is on the first item
3) showing public methods: selection is on the first non-inheritet item, first in the list
4) showing public properties: selection is again on the first inheritet item, non-inheritet shown before
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18941 Posts

Posted - Jun 24 2008 :  11:22:09 AM  Show Profile  Reply with Quote
This is going to be very focussed on "tiny" details. I feel we keep talking about different things that look very similar.

All of my tests (several hours worth), in VS2005 with VA 1640, are showing the same thing.

Firstly my test examples may be far to simple. This is a real risk. However I am seeing consistent results with various classes, so I don't think this is a problem.

Secondly, I need to *restart* the IDE before each test. This is because the IDE is remembering the last item I selected After a dot (so a class member listbox). So it is taking me ages to run a group of tests.

As soon as you start typing or filtering the listbox in any way you will see different behaviours in VS2005 vs VS2008, even when using the same version of VA and the same IDE and VA settings. So we need to consider the default item when *filtering* the listbox as a separate (and perhaps IDE specific) point.

ONLY looking at the default / initial selected item in a class member listbox the very first time the listbox appears (so before there is any selection history), totally ignoring suggestion listboxes, filtering the listbox, etc, all of my results show that the default selected item is the first item in alphabetic order. This may or may not be an inherited item, it depends on the names of the items in the listbox. So if you have both:

VA Options -> Advanced -> Listboxes -> Bold non-inherited members
VA Options -> Advanced -> Listboxes -> List non-inherited entries first

turned on then it should be either the first bold item or the first non bold item, since both "groups" inside the listbox are sorted into alphabetic order for me. For a form timer I have used the following very simple test:

public class felineFormTimer : Timer
{
    public int CatCount() { return 3; }
    public void SetCatCount(int newCount) { }
}

public class testDefaultItemInMemberListbox
{
    private void testUsingFormThings()
    {
        felineFormTimer fooTimer;
        fooTimer.|
    }
}


and the first time after loading the IDE and typing the dot I am seeing:



If the default item for you is "now" on the timer class instance then I suspect (from my tests) that this is caused by selection history. If you were to restart the IDE you would probably see a different default item.

If all of this holds for other people (and it should) then the simple question is do people like the IDE setting the default item in a *member* listbox to the last member you selected?

I can make a good argument that this should be ignored if you have:

VA Options -> Advanced -> Listboxes -> List non-inherited entries first

turned On. Note that this overlaps with how the selected item changes as you filter the listbox, at least some of the time.

zen is the art of being at one with the two'ness
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18941 Posts

Posted - Jun 24 2008 :  12:09:49 PM  Show Profile  Reply with Quote
Passing through the IDE options dialog I have just noticed:

IDE tools menu -> Options -> Text Editor -> C# -> IntelliSense -> IntelliSense pre-selects most recently used members

which is turned On on my test system. That makes sense, given what I am seeing happening here.

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2321 Posts

Posted - Jun 24 2008 :  12:56:30 PM  Show Profile  Reply with Quote
quote:
Originally posted by feline

If the default item for you is "now" on the timer class instance then I suspect (from my tests) that this is caused by selection history. If you were to restart the IDE you would probably see a different default item.


No, for me in this case (the Timer class, or any derived from Control) the default item is always .Container (while showing all members) UNLESS i had selected something else before.

quote:
Originally posted by feline

If all of this holds for other people (and it should) then the simple question is do people like the IDE setting the default item in a *member* listbox to the last member you selected?


I think thats ok unless there is an easy way to determine a better selection. Depending on context and time/developers at hand to make really sophisticated analysis, the result is going to be somewhere between impossible and fantastic.

Edited by - Uniwares on Jun 24 2008 12:57:27 PM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18941 Posts

Posted - Jul 03 2008 :  4:18:06 PM  Show Profile  Reply with Quote
Apologies for the delay in getting back to this.

The initial default item being Container when there is no selection history, do you see the same problem with VA disabled?

Loading the IDE and then disabling VA before loading the solution should be a good enough test for this. I am guessing that what you are seeing is an IDE problem. If so then VA is working correctly, and it is picking up the IDE's default selection correctly.

Trying to determine a better selection, this is fairly quickly going to turn into or look like VA suggestions, so wonderful when it gets it right and "terrible" when it gets it wrong.



Going back to your code sample now:

    public class myClass {};
    public class myOtherClass {};
    public class my3rdClass {};
    public class myClassyClass {};
    public enum myEnumType {};
    public class myClassIwillUseNow
    {
        public void funcSomething() {}
        public void funcSomeOtherthing() { }
        public void funcOtherthing() { }

        public void funcTestMeHere(String myParam1, myEnumType myEnumParam, myClass unrelated, Object objectParam)
        {
            my3rdClass my3rd = new my3rdClass();
            myClassyClass mcc = | ; // first sample
            Console.Write(|); // second sample
        }
    }


If I turn Off:

IDE tools menu -> Options -> Text Editor -> C# -> IntelliSense -> Show completion list after a character is typed

then I am actually seeing very good suggestions for these two positions, since I am getting VA suggestion listboxes. With this IDE option turned On then the full blown listboxes are much less helpful, since they are much less focussed.

Are you working with this option turned on or off? If you have this turned off then:

case=10535

should help when it is done, since this asks for local symbols / variables to have priority in suggestion listboxes.

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2321 Posts

Posted - Jul 03 2008 :  4:39:57 PM  Show Profile  Reply with Quote
Just turned it off now to see the difference.
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