Visual Studio IntelliSense

.Visual Studio IntelliSense
.IntelliSense

IntelliSense is the general term for a number of features: List Members, Parameter Info, Quick Info, and Complete Word. These features help you to learn more about the code you are using, keep track of the parameters you are typing, and add calls to properties and methods with only a few keystrokes. Many aspects of IntelliSense are language-specific. IntelliSense options are on by default. To turn them off, click Tools/Options/Text Editor and deselect Parameter information or Auto list members if you do not want the List Members feature.


Ctrl + K, Ctrl + W - Intellisense, invokes intellisense for current cursor position

Ctrl + Space - Complete Word, completes the rest of a variable, command, or function name once you have entered enough characters to disambiguate the term.

Ctrl + I - Quick Info, displays the declaration syntax and description.  You may also get this information with a mouse over.

Ctrl + . - Generate Code,  use when the code is marked as an error.  Select the code generation desired to resolve the error.  You can also click on the little blue box under the code, but it can be difficult than using the keyboard shortcut.

See this link for All VS Keyboard Shortcuts.


Code Generation

Code can generated upon request (Edit, Intellisense, Insert Snippet..) and (Edit, Intellisense, Generate).

Also Intellisense can create code snippets from short cuts. You enter the short name and then press the TAB key twice. I works like a macro which replaces the snippet shortcut with the actual snippet of code. For example:

type: prop, then TAB + TAB, to insert this code snippet for automatically creating a property => public int MyProperty { get; set; }



Visual Studio Code Snippets
Snippet Name Description Location
#if Creates a #if directive and a #endif directive. Anywhere.

#region

creates a #region directive and a #endregion directive.

anywhere.

~

creates a destructor for the containing class.

inside a class.

attribute

creates a declaration for a class that derives from attribute.

inside a namespace (including the global namespace), a class, or a struct.

checked

creates a checked block.

inside a method, an indexer, a property accessor, or an event accessor.

class

creates a class declaration.

inside a namespace (including the global namespace), a class, or a struct.

ctor

creates a constructor for the containing class.

inside a class.

cw

creates a call to writeline.

inside a method, an indexer, a property accessor, or an event accessor.

do

creates a do while loop.

inside a method, an indexer, a property accessor, or an event accessor.

else

creates an else block.

inside a method, an indexer, a property accessor, or an event accessor.

enum

creates an enum declaration.

inside a namespace (including the global namespace), a class, or a struct.

equals

creates a method declaration that overrides the equals method defined in the object class.

inside a class or a struct.

exception

creates a declaration for a class that derives from an exception (exception by default).

inside a namespace (including the global namespace), a class, or a struct.

for

creates a for loop.

inside a method, an indexer, a property accessor, or an event accessor.

foreach

creates a foreach loop.

inside a method, an indexer, a property accessor, or an event accessor.

forr

creates a for loop that decrements the loop variable after each iteration.

inside a method, an indexer, a property accessor, or an event accessor.

if

creates an if block.

inside a method, an indexer, a property accessor, or an event accessor.

indexer

creates an indexer declaration.

inside a class or a struct.

interface

creates an interface declaration.

inside a namespace (including the global namespace), a class, or a struct.

invoke

creates a block that safely invokes an event.

inside a method, an indexer, a property accessor, or an event accessor.

iterator

creates an iterator.

inside a class or a struct.

iterindex

creates a "named" iterator and indexer pair by using a nested class.

inside a class or a struct.

lock

creates a lock block.

inside a method, an indexer, a property accessor, or an event accessor.

mbox

creates a call to messagebox.show. you may have to add a reference to system.windows.forms.dll.

inside a method, an indexer, a property accessor, or an event accessor.

namespace

creates a namespace declaration.

inside a namespace (including the global namespace).

prop

creates an auto-implemented property declaration.

inside a class or a struct.

propfull

creates a property declaration with get and set accessors.

inside a class or a struct.

propg

creates a read-only auto-implemented property with a private "set" accessor.

inside a class or a struct.

sim

creates a static int main method declaration.

inside a class or a struct.

struct

creates a struct declaration.

inside a namespace (including the global namespace), a class, or a struct.

svm

creates a static void main method declaration.

inside a class or a struct.

switch

creates a switch block.

inside a method, an indexer, a property accessor, or an event accessor.

try

creates a try-catch block.

inside a method, an indexer, a property accessor, or an event accessor.

tryf

creates a try-finally block.

inside a method, an indexer, a property accessor, or an event accessor.

unchecked

creates an unchecked block.

inside a method, an indexer, a property accessor, or an event accessor.

unsafe

creates an unsafe block.

inside a method, an indexer, a property accessor, or an event accessor.

using

creates a using directive.

inside a namespace (including the global namespace).

while

creates a while loop.

inside a method, an indexer, a property accessor, or an event accessor



Visual Studio Code Snippets
.IntelliSense Code Generation



Insert Code Snippet



Code can also be generated to resolve a detected error (Ctrl + .). You can also click on the little blue box under the code, but it can be difficult than using the keyboard shortcut.

.Code Completion for a Detected Error



Code Generated to Resolve Error


Babel Icons

Babel Icons are used in IntelliSense completion lists and in the drop-down bar used for quick navigation. Most of these icons are arranged in sets of six variations, where each variation corresponds to the access concepts of public, internal, friend, protected, private, and shortcut. For example, you can have different icons for a method depending on whether it is public, protected or private.

.Babel Icons used in  IntelliSense Completion Lists

Icon group

Enumeration

Description

------------

enum ScopeIconGroup

---------------------------------

0-5

IconGroupClass

Class

6-11

IconGroupType

Constant

12-17

IconGroupDelegate

Delegate

18-23

IconGroupType2

Enumeration

24-29

IconGroupType3

Enumeration Member

30-35

IconGroupEvent

Event

36-41

IconGroupResource

Resource

42-47

IconGroupFieldBlue

Field

48-53

IconGroupInterface

Interface

54-59

IconGroupTextLine

Macro

60-65

IconGroupScript

Map

66-71

IconGroupScript2

Map Item

72-77

IconGroupMethod

Method

78-83

IconGroupMethod2

Overloaded Method

84-89

IconGroupDiagram

Module

90-95

IconGroupNamespace

Namespace

96-101

IconGroupFormula

Operator

102-107

IconGroupProperty

Property

108-113

IconGroupStruct

Structure

114-119

IconGroupTemplate

Template

120-125

IconGroupOpenSquare

Type Definition (typedef)

126-131

IconGroupBits

Type

132-137

IconGroupChannel

Channel

138-143

IconGroupFieldRed

Variable

144-149

IconGroupUnion

Union

150-155

IconGroupForm

Intrinsic

156-161

IconGroupFieldYellow

Miscellaneous field

------------

enum ScopeIconMisc

---------------------------------

162

IconBlackBox

Assembly

163

IconLibrary

Library

164

IconProgram

Visual Basic Project

165

IconwebProgram

Web-based program

166

IconProgramEmpty

Empty program

167

IconwebProgramEmpty

Empty web-based program

168

IconComponents

Components

169

IconEnvironment

Environment

170

IconWindow

Window

171

IconFolderOpen

Open Folder

172

IconFolder

Closed Folder

173

IconArrow

Arrow

174

IconAmbiguous

Error

175

IconShadowClass

Grayed-out class

176

IconShadowMethodPrivate

Grayed-out private method

177

IconShadowMethodProtected

Grayed-out protected method

178

IconShadowMethod

Grayed-out method

179

IconCompleteSource

Miscellaneous document



Babel Icons used in IntelliSense