Symbol Code Completion (previously known as Basic Code Completion) completes names of classes, methods, variables, keywords, and any other symbols that are available within the current visibility scope (including extension methods that were previously imported).
- Place the caret at the position where you're going to type your code.
- Press Ctrl+Space.
TipTo make sure that CamelHumps works with Code Completion, clear the Case-sensitive prefix matching check box in ReSharper | Options | Environment | IntelliSense | Completion Behavior. Note that the Use CamelHumps check box in ReSharper | Options | Environment | Editor doesn't have any impact on how CamelHumps works in completion.
You can use the following examples to get an idea of how Symbol Code Completion works with various code items:
Suggesting type-based variable names
Suggesting members of a class
Suggesting visible types
Suggesting C# keywords
Suggesting "this" keyword for static methods in static classes
Completion for enum members
Symbol Completion using CamelHumps
Completion for unresolved symbols
Suggesting attributes in build scripts
Completing names of symbols in build scripts
Suggesting Type-Based Variable Names
Commonly used names for fields and variables are suggested depending on their type. After entering the type of a variable,
press Ctrl+Space. The look-up list displays the suggested names:
If you enter a variable name prefix, ReSharper will append it to each suggested name:
You can specify a common prefix and/or a common suffix for all new variable names in Options | Languages | Common | Naming Style. If you do that, completion items will be modified accordingly:
Suggesting Members of a Class
Suggesting Visible Types
Suggesting C# Keywords
Suggesting "this" Keyword for Static Methods in Static Classes
Completion for Enum Members
Symbol Completion Using CamelHumps
Completion for Unresolved Symbols
Early used names of data types and their members are suggested, even if they are not declared anywhere in the code and cannot
Suggesting Attributes in Build Scripts
Suppose that you started to type the
target build script node the code editor:
- Press Ctrl+Space or select ReSharper | Edit | Complete Symbol. The following drop-down list appears:
- Choose the appropriate keyword from the list and press Enter:
The new position of the caret allows you to easily specify the property name.
Completing Names of Symbols in Build Scripts
Suppose that you started typing a path:
- Press Ctrl+Space or select ReSharper | Edit | Complete Symbol. The following drop-down list displays:
The list includes all symbols visible in the current scope.
- You can pick an item from the list right away or continue typing to narrow down the choices:
- To choose an item from the list, press Enter: