Visual Studio 2017 15.5.2 has this feature built-in after it was first hinted at in a Visual Studio 2017 Preview blog post (see section “Smart Code Editor”).
Invoking it can be done by going to Edit > Advanced > Expand Selection
or by binding the Edit.ExpandSelection
command to ShiftAlt= (actually the default if you start without any previous keybindings).
Shrinking / contracting the selection is possible as well, look for Edit > Advanced > Contract Selection
or the Edit.ContractSelection
command (default ShiftAlt- ).