mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 01:07:18 +03:00
9fb7f11316
* Replace more instances of 'scenario' with 'script' changelog_begin * Remove Daml Studio 'scenario' snippet * Add Daml Studio 'script' snippet * Update documentation for 'daml test' command changelog_end * remove 'test' snippet changelog_begin * Remove Daml Studio 'test' snippet changelog_end
141 lines
2.7 KiB
JSON
141 lines
2.7 KiB
JSON
{
|
|
"controller": {
|
|
"prefix": "controller",
|
|
"body": [
|
|
"controller ${1:party} can",
|
|
" ${2:Call} : ${3:ContractId ${4:Type}}",
|
|
" with ${5:name} : ${6:Type}",
|
|
" do",
|
|
" $0"
|
|
]
|
|
},
|
|
"choice": {
|
|
"prefix": "choice",
|
|
"body": [
|
|
"choice ${2:Call} : ${3:ContractId ${4:Type}} with",
|
|
" ${1:party} : Party",
|
|
" controller ${1:party}",
|
|
" do",
|
|
" $0"
|
|
]
|
|
},
|
|
"case-example": {
|
|
"prefix": "case",
|
|
"body": [
|
|
"case ${1:expression} of",
|
|
" ${2:[]} -> ${3:expression}",
|
|
" ${4:${5:x}::${6:xs} } -> ${expression}"
|
|
]
|
|
},
|
|
"daml-module-name": {
|
|
"prefix": "daml",
|
|
"body": [
|
|
"module ${3:${2:Module}.${TM_FILENAME_BASE}} where",
|
|
"",
|
|
"$0"
|
|
]
|
|
},
|
|
"import": {
|
|
"prefix": "import",
|
|
"body": [
|
|
"import ${1:Module.Name}${2: as ${3:ModuleName}}",
|
|
"$0"
|
|
]
|
|
},
|
|
"create": {
|
|
"prefix": "create",
|
|
"body": [
|
|
"create ${1:this} with ${2:${3:owner} = ${4:newOwner}}",
|
|
"$0"
|
|
]
|
|
},
|
|
"module": {
|
|
"prefix": "module",
|
|
"body": [
|
|
"module ${3:${2:Module}.${TM_FILENAME_BASE}} where",
|
|
"",
|
|
"$0"
|
|
]
|
|
},
|
|
"match": {
|
|
"prefix": "fetch",
|
|
"body": [
|
|
"${2:rec} <- fetch ${1:contractId}",
|
|
"${3:assert (${4:rec.owner} == ${5:owner})}",
|
|
"$0"
|
|
]
|
|
},
|
|
"if": {
|
|
"prefix": "if",
|
|
"body": "if ${1:condition}\n then ${2:consequence}\n else ${3:alternative}"
|
|
},
|
|
"exercise": {
|
|
"prefix": "exercise",
|
|
"body": [
|
|
"exercise ${1:contractId} ${2:Transfer}"
|
|
]
|
|
},
|
|
"let": {
|
|
"prefix": "let",
|
|
"body": [
|
|
"let ${1:var} = ${2:value}",
|
|
"$0"
|
|
]
|
|
},
|
|
"type declaration": {
|
|
"prefix": "data",
|
|
"body": [
|
|
"data ${1:Type} = ${2:${1:Type}}",
|
|
" with",
|
|
" ${3:name} : ${4:Type}",
|
|
" $0"
|
|
]
|
|
},
|
|
"template definition": {
|
|
"prefix": "template",
|
|
"body": [
|
|
"template ${1:Name}",
|
|
" with",
|
|
" ${2:party} : ${3:Party}",
|
|
" where",
|
|
" signatory ${4:party}",
|
|
" $0"
|
|
]
|
|
},
|
|
"lambda": {
|
|
"prefix": "\\",
|
|
"body": "\\${1:var} -> $0"
|
|
},
|
|
"script": {
|
|
"prefix": "script",
|
|
"body": [
|
|
"${1:name} = script do",
|
|
" ${2:${3:p} <- allocateParty \"${4:party}\"}",
|
|
" $0"
|
|
]
|
|
},
|
|
"agreement": {
|
|
"prefix": "agreement",
|
|
"body": [
|
|
"agreement \"${1:legal text}\"",
|
|
" <> \"${2:more text}\"",
|
|
"${0}"
|
|
]
|
|
},
|
|
"signatory": {
|
|
"prefix": "signatory",
|
|
"body": [
|
|
"signatory ${1:owner}",
|
|
"${0}"
|
|
]
|
|
},
|
|
"observer": {
|
|
"prefix": "observer",
|
|
"body": [
|
|
"observer ${1:regulator}",
|
|
"${0}"
|
|
]
|
|
}
|
|
|
|
}
|