121 lines
2.5 KiB
Plaintext
121 lines
2.5 KiB
Plaintext
{
|
|
|
|
"for": {
|
|
"prefix": "for",
|
|
"body": "for $${1:item} in ${2:expr}"
|
|
},
|
|
"return": {
|
|
"prefix": "ret",
|
|
"body": "return ${1:expr}"
|
|
},
|
|
"import": {
|
|
"prefix": "import",
|
|
"body": "import module namespace ${1:ns} = '${2:http://www.example.com/}';",
|
|
"description": "Import module"
|
|
},
|
|
"module": {
|
|
"prefix": "module",
|
|
"body": "module namespace ${1:ns} = '${2:http://www.example.com}';"
|
|
},
|
|
"every": {
|
|
"prefix": "every",
|
|
"body": "every $${1:varname} in ${2:expr} satisfies ${3:expr}"
|
|
},
|
|
"some": {
|
|
"prefix": "some",
|
|
"body": "some $${1:varname} in ${2:expr} satisfies ${3:expr}"
|
|
},
|
|
"function": {
|
|
"prefix": "df",
|
|
"body": [
|
|
"(:~ $${2:name} :)",
|
|
"declare function ${1:ns}:${2:name}(){",
|
|
"${3:expr}",
|
|
"};"
|
|
],
|
|
"description": "declare a function"
|
|
},
|
|
"declare variable": {
|
|
"prefix": "dv",
|
|
"body": [
|
|
"(:~ $${1:varname} :)",
|
|
"declare variable $${1:varname} := ${2:expr};",
|
|
""
|
|
],
|
|
"description": "declare variable"
|
|
},
|
|
"switch": {
|
|
"prefix": "sw",
|
|
"body": [
|
|
"switch(${1:foo})",
|
|
"case ${2:foo} return ${3:true}",
|
|
"default return ${4:false}"
|
|
],
|
|
"description": "switch statement"
|
|
},
|
|
"typeswitch": {
|
|
"prefix": "type",
|
|
"body": [
|
|
"typeswitch(${1:foo})",
|
|
"case ${2:foo} return ${3:true}",
|
|
"default return ${4:false}"
|
|
],
|
|
"description": "typeswitch statement"
|
|
},
|
|
"try": {
|
|
"prefix": "try",
|
|
"body": [
|
|
"try { ${1:expr} } ",
|
|
"catch ${2:*} { ${3:expr} }"
|
|
],
|
|
"description": "switch statement"
|
|
},
|
|
"tumbling": {
|
|
"prefix": "tumbling",
|
|
"body": [
|
|
"for tumbling window $${1:varname} in ${2:expr}",
|
|
"start at $${3:start} when ${4:expr}",
|
|
"end at $${5:end} when ${6:expr}",
|
|
"return ${7:expr}"
|
|
],
|
|
"description": "tumbling window"
|
|
},
|
|
"sliding": {
|
|
"prefix": "sliding",
|
|
"body": [
|
|
"for sliding window $${1:varname} in ${2:expr}",
|
|
"start at $${3:start} when ${4:expr}",
|
|
"end at $${5:end} when ${6:expr}",
|
|
"return ${7:expr}"
|
|
],
|
|
"description": "sliding window"
|
|
}
|
|
}
|
|
//snippet if
|
|
// if(${1:true}) then ${2:expr} else ${3:true}
|
|
|
|
// default return ${4:false}
|
|
|
|
|
|
//snippet let
|
|
// let $${1:varname} := ${2:expr}
|
|
//snippet group
|
|
// group by $${1:varname} := ${2:expr}
|
|
//snippet order
|
|
// order by ${1:expr} ${2:descending}
|
|
//snippet stable
|
|
// stable order by ${1:expr}
|
|
//snippet count
|
|
// count $${1:varname}
|
|
//snippet ordered
|
|
// ordered { ${1:expr} }
|
|
//snippet unordered
|
|
// unordered { ${1:expr} }
|
|
//snippet treat
|
|
// treat as ${1:expr}
|
|
//snippet castable
|
|
// castable as ${1:atomicType}
|
|
//snippet cast
|
|
// cast as ${1:atomicType}
|
|
|