Skip to content

Commit c70ba52

Browse files
Meir017-msftfbricon
authored andcommitted
add try-resources snippet
Signed-off-by: Meir Blachman <meblachm@microsoft.com>
1 parent e93092c commit c70ba52

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

snippets/java.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@
9898
],
9999
"description": "try/catch block"
100100
},
101+
"tryresources": {
102+
"prefix": "try_resources",
103+
"body": [
104+
"try ($1) {",
105+
"\t$2",
106+
"} catch (${3:Exception} ${4:e}) {",
107+
"\t$5//${0:TODO}: handle exception",
108+
"}"
109+
]
110+
},
101111
"private_method": {
102112
"prefix": "private_method",
103113
"body": [

0 commit comments

Comments
 (0)