Surround selection experiment

Mads Kristensen

You want to quickly select some text and surround it with quotation marks. So, you select your text and hit the quotation mark key on your keyboard, only to find that the selected text now has been replaced by a single “. What you hoped would happen was that the selected text would be surrounded by an opening and closing quotation mark like in the animation below. Let’s do something to fix this.

Image Surrounder2

In this experiment, we want to test if we can create a general feature for all languages that makes it easy to surround the selection. In fact, multiple developers have requested this feature, so remember to vote for it if you agree.

Our hypothesis is that a feature like this is language agnostic and doesn’t need to be customized per language. But we need your help to help test that hypothesis and, potentially, help improve the feature design. We’ve created an extension for Visual Studio called Surrounder that we’ll be using for this experiment.

The extension is very simple to use. Any time you have a selection and type one of the supported characters, the selection will be surrounded by that character and its closing equivalent, as shown in this table:

Opening Closing
` `
( )
[ ]
{ }
< >

 

To participate in this experiment, install the Surrounder extension and let us know how it works for you. Either by commenting in this blog post, or by opening issues or pull requests on the GitHub repo.

There is currently an open feature request for us to implement this behavior in Visual Studio, so make sure to go vote for it.