mirror of
https://gitee.com/zhangsken/AndroidIDE.git
synced 2026-10-16 07:49:44 +08:00
feat(lsp/java): add more snippets
This commit is contained in:
@@ -72,5 +72,32 @@
|
||||
"\t$0",
|
||||
"}"
|
||||
]
|
||||
},
|
||||
"new_object": {
|
||||
"desc": "Create a new object",
|
||||
"body": [
|
||||
"${1:Object} ${2:foo} = new $1($3);",
|
||||
"$0"
|
||||
]
|
||||
},
|
||||
"trycatch": {
|
||||
"desc": "A try-catch statement",
|
||||
"body": [
|
||||
"try {",
|
||||
"\t$0",
|
||||
"} catch(${1:Exception} ${2:err}) {",
|
||||
"\t",
|
||||
"}"
|
||||
]
|
||||
},
|
||||
"tryresources": {
|
||||
"desc": "A try-with-resources statement",
|
||||
"body": [
|
||||
"try ($1) {",
|
||||
"\t$0",
|
||||
"} catch(${2:Exception} ${3:err}) {",
|
||||
"\t",
|
||||
"}"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"const": {
|
||||
"desc": "Create a constant field",
|
||||
"body": [
|
||||
"public static final ${1:type} ${2/(.*)/${1:/upcase}/} = ${3:value};"
|
||||
]
|
||||
},
|
||||
"ctor": {
|
||||
"desc": "Public constructor",
|
||||
"body": [
|
||||
"public "
|
||||
]
|
||||
},
|
||||
"public_method": {
|
||||
"desc": "Create a new public method",
|
||||
"body": [
|
||||
"public ${1:void} ${2:method}(${3:params}) {",
|
||||
"\t$0",
|
||||
"}"
|
||||
]
|
||||
},
|
||||
"protected_method": {
|
||||
"desc": "Create a new protected method",
|
||||
"body": [
|
||||
"protected ${1:void} ${2:method}(${3:params}) {",
|
||||
"\t$0",
|
||||
"}"
|
||||
]
|
||||
},
|
||||
"private_method": {
|
||||
"desc": "Create a new private method",
|
||||
"body": [
|
||||
"private ${1:void} ${2:method}(${3:params}) {",
|
||||
"\t$0",
|
||||
"}"
|
||||
]
|
||||
},
|
||||
"public_static_method": {
|
||||
"desc": "Create a new public static method",
|
||||
"body": [
|
||||
"public static ${1:void} ${2:method}(${3:params}) {",
|
||||
"\t$0",
|
||||
"}"
|
||||
]
|
||||
},
|
||||
"private_static_method": {
|
||||
"desc": "Create a new private stataic method",
|
||||
"body": [
|
||||
"private static ${1:void} ${2:method}(${3:params}) {",
|
||||
"\t$0",
|
||||
"}"
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user