IntelliSense

The term IntelliSense refers to the editor functionality that offers suggestions to you as you type code. The major IntelliSense features that you are probably most familiar with are statement completion, parameter info, and complete word.

Statement Completion, Parameter Info, and Complete Word

Statement completion is the UI that displays what objects you can insert into your code that will be valid for that given location. It is also referred to as list members.

Complete word is very similar to statement completion, but without the UI. If the method or object you are typing is unique, complete word will fill out the word for you, even if statement completion is not showing. Complete word is the equivalent of clicking or hitting Enter on a particular method or object in statement completion.

I always have to go back and look up the difference between parameter info and quick info. Quick info displays a ToolTip with information about the given method or object. It is the ToolTip you see when you hover over a method or object. Parameter info is a little more self-explanatory. It is the ToolTip you see when you are filling in the parameters to your method call.

Tip 2.30: You can use Ctrl+J to invoke statement completion

The keyboard shortcut to invoke statement completion is Ctrl+J, which is bound to the command Edit.ListMembers.

Tip 2.30: You can use Ctrl+J to invoke statement completion

In the Text Editor toolbar, you can invoke statement completion via the Show Member List icon.

Tip 2.30: You can use Ctrl+J to invoke statement completion

Tip 2.31: How to display parameter info for a function

Press Ctrl+Shift+Space to display the parameter info. The command is Edit.ParameterInfo.

Tip 2.31: How to display parameter info for a function

To iterate through the possible parameter choices, press the down arrow to go to the next function overload and press the up arrow to go to the previous function overload. For whatever reason, I always reverse these arrow keys and end up navigating backward.

Tip 2.32: How to display quick info for a function

Type in a method name—for example, Console.Read—and then press Ctrl+K, Ctrl+I to invoke Quick Info on a function. The command is Edit.QuickInfo.

Tip 2.32: How to display quick info for a function

Tip 2.33: How to complete a word

Whenever you can invoke statement completion, you can also execute the Edit. CompleteWord command. This command completes a word that is partially complete and that has no other possibilities. And if there are other multiple possibilities, the command invokes statement completion.

In the following example, since Console.WriteL has no possible matches other than Console. WriteLine, pressing Ctrl+Space or Alt+Right Arrow will write out WriteLine.

Tip 2.33: How to complete a word

Tip 2.34: How to increase the statement completion font size

Go to Tools–Options–Environment–Fonts And Colors and set the Show Settings For option to Statement Completion. Now you can modify the font and font size.

Tip 2.34: How to increase the statement completion font size

This is the statement completion box at font size 12.

Tip 2.34: How to increase the statement completion font size

Tip 2.35: You can resize the statement completion dialog box

It’s all about the simple things in life.

Yep, you can resize the statement completion dialog box from any direction.

Tip 2.35: You can resize the statement completion dialog box

A couple of things to note:

  • Max height is limited to one-third of the screen size.

  • Although width is resizable, only height is persisted.

Tip 2.36: You can toggle between the Common and All Statement Completion tabs via the keyboard

Once the statement completion dialog box is up, press Alt+. to move to the All tab and Alt+, to move to the Common tab.

Tip 2.36: You can toggle between the Common and All Statement Completion tabs via the keyboard

Tip 2.37: How to turn off IntelliSense by default

Just in case you ever need to do this....

Go to Tools–Options–Text Editor–All Languages–General and uncheck Auto List Members and Parameter Information. If you just want to disable IntelliSense by default for a particular language, go to the Text Editor–<language>–General option page and set the behavior there.

Tip 2.37: How to turn off IntelliSense by default

Note that the IntelliSense commands themselves are not disabled, meaning you can still invoke IntelliSense via the keyboard shortcut or a toolbar button.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.118.229