Skip to content

Commit f774bce

Browse files
authored
elixir.json: Add "df" and "dfw" for one-liner functions (#519)
* elixir.json: Add "df" and "dfw" for one-liner functions (with when guard)
1 parent 8a934f9 commit f774bce

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

snippets/elixir.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@
1414
"body": ["defp ${1:name}() do", " $0", "end"],
1515
"description": "Define a private function"
1616
},
17+
"df": {
18+
"prefix": "df",
19+
"body": "def ${1:name}(), do: $0",
20+
"description": "Define a one-liner function"
21+
},
22+
"dfw": {
23+
"prefix": "dfw",
24+
"body": "def ${1:name}(${2:args}) when ${3:guard}, do: $0",
25+
"description": "Define a one-liner function with when guard"
26+
},
1727
"IO.puts": {
1828
"prefix": "put",
1929
"body": "IO.puts($0)"

0 commit comments

Comments
 (0)