Wraps a code selection in an "if" or "try/catch" block with proper indentation
Surround With
This extension is patterned after IntelliJ's "Surround With..." command. It is based on and adds some bug fixes to this unsupported project.
Install
Install from VS Code with cmd+shift+x
(or ctrl+shift+x
on Windows), search for vscode-surround-with
, and click "Install".
Usage
Select text to wrap with an if
or try/catch
block, press cmd+shift+p
(ctrl+shift+p
on Windows), and select one of the following:
- Surround with if
- Surround with try/catch
Release Notes
1.0.0
First release
1.1.0
Slightly modified the generated code