Selection Embedding

The Selection Embedding feature is used to surround a piece of code with a boilerplate block (for instance, try..catch). Predefined embeddings are available for C#, Visual Basic, and XAML.


To embed one or more lines of code, select them and press Ctrl + . or Ctrl + ~. In the invoked menu, open the Embed Selection group and choose the required embedding from the list.


One-key Embedding is also available. Refer to the Selection | Embedding group in the shortcuts configuration to enable specific shortcuts.

You can edit an existing embedding or add a new one using the Editor | All Languages | Selection Embeddings options page.