Surround code block with curly braces?

后端 未结 6 982
Happy的楠姐
Happy的楠姐 2021-02-18 22:53

Is there a shortcut to surround a given (selected) code block with curly braces?

VS 2015 + R# 2016.1

6条回答
  •  长情又很酷
    2021-02-18 23:22

    You do not need Resharper for this. You can use the "surround with" with a custom snippet.

    Then you can select your text with Ctrl + K, Ctrl + S and select the snippet {} in the custom snippet. In order to create such a snippet :

    1. Create a ".snippet" file containing the content below
    2. Go to the snippet manager (Tools > Code Snippets Manager)
    3. Click import and select the file you just created

    Use the following snippet :

    
    
     
      
    {} {} Code snippet for {} Alexandre Expansion SurroundsWith

提交回复
热议问题