Wraps a code selection in an "if" or "try/catch" block with proper indentation
This extension is patterned after IntelliJ's "Surround With..." command. It is based on and adds some bug fixes to this unsupported project.
Install from VS Code with cmd+shift+x
(or ctrl+shift+x
on Windows), search for vscode-surround-with
, and click "Install".
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
First release
Slightly modified the generated code
Updated logo to look better in dark mode