mirror of
https://github.com/rafamadriz/friendly-snippets
synced 2024-09-16 22:14:02 +02:00
Add reason snippets
All snippets are from 8745b53c04/snippets/reason.json
with some descriptions added.
This commit is contained in:
parent
ea84a71026
commit
9edfe7745d
2 changed files with 72 additions and 0 deletions
|
@ -475,6 +475,10 @@
|
|||
{
|
||||
"language": "nu",
|
||||
"path": "./snippets/nushell.json"
|
||||
},
|
||||
{
|
||||
"language": "reason",
|
||||
"path": "./snippets/reason.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
68
snippets/reason.json
Normal file
68
snippets/reason.json
Normal file
|
@ -0,0 +1,68 @@
|
|||
{
|
||||
"function": {
|
||||
"prefix": "let",
|
||||
"body": ["let ${1:f} = (${2:pattern}) => ${3:${2:pattern}};$0"],
|
||||
"description": "Snippet for a short function definition"
|
||||
},
|
||||
"function (block)": {
|
||||
"prefix": "let",
|
||||
"body": ["let ${1:f} = (${2:pattern}) => {", "\t${3:${2:pattern}}$0", "};"],
|
||||
"description": "Snippet for a function block definition"
|
||||
},
|
||||
"lambda": {
|
||||
"prefix": "fun",
|
||||
"body": ["(${1:pattern}) => ${2:${1:pattern}}"],
|
||||
"description": "Snippet for a lambda function"
|
||||
},
|
||||
"lambda (switch)": {
|
||||
"prefix": "fun",
|
||||
"body": ["fun", "\t| ${1:pattern} => ${2:${1:pattern}}", "\t;"],
|
||||
"description": "Snippet for a lambda switch function"
|
||||
},
|
||||
"let": {
|
||||
"prefix": "let",
|
||||
"body": ["let ${1:pattern} = ${2:()};$0"],
|
||||
"description": "Snippet for a variable declaration"
|
||||
},
|
||||
"let (block)": {
|
||||
"prefix": "let",
|
||||
"body": ["let ${1:pattern} = {", "\t$0", "};"],
|
||||
"description": "Snippet for a block variable declaration"
|
||||
},
|
||||
"module": {
|
||||
"prefix": "module",
|
||||
"body": ["module ${1:M} = ${2:{}};$0"],
|
||||
"description":"Snippet for a module declaration"
|
||||
},
|
||||
"module (block)": {
|
||||
"prefix": "module",
|
||||
"body": ["module ${1:M} = {", "\t$0", "};"],
|
||||
"description":"Snippet for a block module declaration"
|
||||
},
|
||||
"module function": {
|
||||
"prefix": "module",
|
||||
"body": ["module ${1:M} = (${2:X}: $3{:{}}) => ${4:${2:X}};$0"],
|
||||
"description": "Snippet for a functor declaration"
|
||||
},
|
||||
"module function (block)": {
|
||||
"prefix": "module",
|
||||
"body": ["module ${1:M} = (${2:X}: $3{:{}}) => {", "\t${4:include ${2:X}}", "\t$0", "};"],
|
||||
"description": "Snippet for a functor block declaration"
|
||||
},
|
||||
"switch": {
|
||||
"prefix": "switch",
|
||||
"body": ["switch ${1:scrutinee} {", "| ${2:pattern} => ${3:${2:pattern}}", "};"],
|
||||
"description": "Snippet for a pattern matching declaration"
|
||||
},
|
||||
"type (alias or abstract)": {
|
||||
"prefix": "type",
|
||||
"body": ["type ${1:name} ${2:${3:'${4:arg} }= ${5:'${4:arg}}};$0"],
|
||||
"description": "Snippet for a type alias declaration"
|
||||
},
|
||||
"type": {
|
||||
"prefix": "type",
|
||||
"body": ["type ${1:name} ${2:'${3:arg} }=", "\t| ${4:Con${2: '${3:arg}}}", "\t;"],
|
||||
"description": "Snippet for a variants declaration"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in a new issue