Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio - What are suggestion and standard completion modes

In Visual Studio, there's a button on the toolbar with tooltip:

Toggles between suggestion and standard completion modes. (Ctrl+Alt+Space)

My guess is that these have something to do with IntelliSense, but I'm not sure.

What is suggestion mode and what is standard completion mode?

like image 355
Moffen Avatar asked Apr 04 '19 04:04

Moffen


People also ask

How do I get suggestions in Visual Studio?

Open the Default Keyboard Shortcuts (File > Preferences > Keyboard Shortcuts) and search for "suggest".

How do I use autocomplete in Visual Studio?

The suggestion list of Automatic completion appears as soon as you start typing a new identifier. The suggestion list of Basic completion appears when you press the default Visual Studio IntelliSense shortcut Ctrl+Space . If necessary, you can always return to the Visual Studio's native's IntelliSense.

How do I get suggestions in Visual Studio 2019?

Suggestions appear as Quick Actions in Visual Studio editor. IntelliCode suggestions have the Quick Action menu options Apply suggestion and Ignore suggestions like this. If you want to use the suggested change, select Apply suggestion.

What is IntelliSense in Visual Studio?

IntelliSense is a code-completion aid that includes a number of features: List Members, Parameter Info, Quick Info, and Complete Word. These features help you to learn more about the code you're using, keep track of the parameters you're typing, and add calls to properties and methods with only a few keystrokes.


1 Answers

The difference seems to be in whether completion is committed when you type keys that are not explicit commit keystrokes while typing. Tab is an explicit commit character; . and ; are examples of keys that are not explicit commit characters.

If I type "foo".sub( (in C# as an example) the behavior will be as follows:

  • with the button enabled (suggestion mode), I will get the same literal output with a closing parenthesis added: "foo".sub()
  • with the button disabled (standard mode), it completes using the best match in the completion list: "foo".Substring()

Turning this behavior on is more suitable in languages or projects where you are invoking dynamic (or new, not-yet-existing) methods and properites that are not present in the completion list, so that you don't have to fight with undesired partial matches.

like image 193
Jimmy Avatar answered Oct 27 '22 21:10

Jimmy