Place the cursor inside the bracket (not directly next to a bracket) and execute editor.action.smartSelect.grow until everything inside the bracket is selected. The default shortcut is Shift+Alt+Right (or Ctrl+Shift+Right on Mac).
You can shrink the selection with editor.action.smartSelect.shrink which has the default shortcut Shift+Alt+Left (or Ctrl+Shift+Left on Mac).
If you don't want to use an extension, this is the best I come up with so far: go to edit keyboard shortcuts and from there open your keybindings.json file and add the following lines
I suggest to remap those keys to another key, this key combination is popular, sometimes it doesn't work because of the conflict with other apps.
Open the key binding setting, type the smartselect to find this setting, grow is expand the selection from the cursor current position to the nearest bracket, press multiple times if you want to expand or shrink to the next bracket.
I still think the expand region extension is the way to go on this. But vscode 1.20 did add the "Select to Bracket" command (see command palette). It has no default keybinding but the command is
editor.action.selectToBracket
so you can assign your own binding. But it is not as handy as the extension. The smartSelect options mentioned above give me unexpected/unwanted results.
---------- Update ---------------
editor.action.smartSelect.expand command was added at some point after the answers here.
Bound to Shift+Alt+RightArrow. Will progressively expand the selection including to within and not including the brackets, parentheses if you wish. You will need to keep triggering the RightArrow to get to where you want. Will not select only within the brackets if you start right next to a bracket - start anywhere else and it will.
editor.action.smartSelect.expand, assigned to ctrl+shift+right will expand your current selection, so inside a string, will expand to the current word, and to the whole string when pressed again. I think this is the proper shortcut to learn because it can also expand beyond the string to select ever more wrappers, which is a pretty neat thing to be able to do.
As of v1.44, there is no keyboard shortcut assigned to editor.action.smartSelect.grow anymore, as mentioned in the current accepted answer by Wosi.
The extension BracketSelect does the trick perfectly!
It selects all text between the nearest matching quotes or bracketsat once. Press it twice, and it adds the delimiting elements (the quotes or brackets) to the selection. Press it once more and the selection grows it's way up.
Basically, it works like the smartSelect command, but with the neat difference that it selects all text inside the brackets or quotes at once, which to me is a way more common use case than the way smartSelect works.
I have found that all of the above answers do work, but they also select a space in front of the opening bracket, and selects the closing bracket. Rather than actually selecting only the text between brackets. You can test this by pressing command+[ and it will move an entire conditional, for example, rather than just the code between the brackets. Something I commonly used in Coda when formatting code.
One solution to this I found, is a plugin called Scoper.
This highlights everything between brackets without actually highlighting it. You can set the highlight color. Then I can click inside the first bracket, hold down shift, and click before the closing bracket to actually highlight everything between the brackets, and exclude the brackets themselves.
Many people may not see a use case for this, but thought I'd post just in case it helps anyone as none of the current solutions worked for me.