Share via


TAB TAB TAB

We're going back and forth on a rather narrow design issue in IntelliSense.

Suppose you're writing some code. (It's a stretch, I know.) You go to type an if/else:

        if (expr)

        {

            // ...

        }

        else // here

        {

            // ...

        }

Here’s what happens when you type ‘else’.

1. You hit ‘e’ and the completion list pops up. This behavior is new in Whidbey. Users don’t usually notice the change, but when the do realize it, they are usually enthusiastic about it. Suppose you’re a fast typist, so you ignore the completion list and keep going.

2. You hit ‘l’, ‘s’, and ‘e’, and they appear in your code.

3. You hit ENTER to insert a line break.

Since a completion list is up, the ENTER is a commit action. It doesn’t insert a line break. You have to hit ENTER twice if the completion list was up. (Since a statement ends with ‘;’, it doesn’t have that problem.) You get annoyed & send us feedback via ladybug.

We hear your feedback, and change the behavior. ENTER commits the completion list and inserts a line break.

Now you’re writing code to call a method on a class you don’t know well. You type:

        foo. // completion list pops up

You consider the possibilities, select the one you want, and hit ENTER to commit it. You’re glad that it inserts the method name, but annoyed that it adds a line break. You have to undo/backspace to add the method parameters. You get annoyed & send us feedback via ladybug.

We hear your feedback, and change the behavior. ENTER always commits the completion list. If the contents of the completion list and what you’ve typed are identical, we also insert a newline.

Consider TAB. Similar issues exist here.

Suppose you want to use the ‘for’ expansion. Type ‘fo’ and hit TAB to complete. It completes to ‘for’. Then TAB again to expand. Cool.

Suppose instead you type ‘for’ and then TAB. The completion list is up, so you have to hit TAB once to dismiss it, and once to expand.

Based on the above discussion, we make TAB act like ENTER – it only expands an expansion if the match is exact.

I think this is the behavior we should keep. However, we have gotten a bit of feedback about it.

Consider this:

1. Open a .cs file

2. Go to the top of the file to add a ‘using’ directive.

3. Type ‘using’.

4. Notice that ‘using’ is in the completion list, so hit TAB to commit.

This inserts a “using statement” in a very bogus location.

Are we doing it right?