ReSharper 2021.1 Help

Extend/Shrink Selection

ReSharper | Edit | Extend/Shrink Selection
Control+W/ Control+Shift+W
ReSharper_ExtendSelection/ ReSharper_ShrinkSelection

The Extend Selection command allows you to successively select expanding logical blocks of code so that you can easily select any expression in the code by placing the caret somewhere inside it and pressing Control+W a few times. The command is also available in the main menu: ReSharper | Edit | Extend Selection.

ReSharper: Extend selectionReSharper: Extend selectionReSharper: Extend selectionReSharper: Extend selection

Shrink Selection does exactly the opposite. Press Control+Shift+W or choose ReSharper | Edit | Shrink Selection in the main menu to apply this command.

With CamelHumps (the Use CamelHumps checkbox on the Environment | Editor | Behavior page of ReSharper options), the Extend/Shrink selection commands work in a slightly different way.

If the CamelHumps is enabled, the Extend/Shrink Selection commands take into account parts of compound names. Suppose you have placed the caret in the middle of a compound name with several parts that begin with uppercase letters:

ReSharper: using CamelHumps to extend selection within a word
With CamelHumps, pressing Control+W for the first time selects the current part of the word:
ReSharper: using CamelHumps to extend selection within a word
Only after pressing this keystroke for the second time ReSharper selects the whole word:
ReSharper: using CamelHumps to extend selection within a word
All subsequent presses are processed as usual.

This feature is supported in the following languages and technologies:

Language: C#Language: VB.NETLanguage: C++Language: HTMLLanguage: ASP.NETLanguage: RazorLanguage: JavaScriptLanguage: TypeScriptLanguage: CSSLanguage: XMLLanguage: XAMLLanguage: ResxLanguage: Build ScriptsLanguage: ProtobufLanguage: JSON
Feature is available in C#Feature is available in Visual Basic .NETFeature is available in C++Feature is available in HTMLFeature is available in ASP.NETFeature is available in RazorFeature is available in JavaScriptFeature is available in TypeScriptFeature is available in CSSFeature is available in XMLFeature is available in XAMLFeature is available in Resource filesFeature is available in build script filesFeature is available in ProtobufFeature is available in JSON

The instructions and examples given here address the use of the feature in C#. For details specific to other languages, see corresponding topics in the ReSharper by Language section.

Last modified: 08 March 2021