Skip to content

Commit

Permalink
elixir.json: Add "df" and "dfw" for one-liner functions (#519)
Browse files Browse the repository at this point in the history
* elixir.json: Add "df" and "dfw" for one-liner functions (with when guard)
  • Loading branch information
multivac61 authored Dec 2, 2024
1 parent 8a934f9 commit f774bce
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions snippets/elixir.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
"body": ["defp ${1:name}() do", " $0", "end"],
"description": "Define a private function"
},
"df": {
"prefix": "df",
"body": "def ${1:name}(), do: $0",
"description": "Define a one-liner function"
},
"dfw": {
"prefix": "dfw",
"body": "def ${1:name}(${2:args}) when ${3:guard}, do: $0",
"description": "Define a one-liner function with when guard"
},
"IO.puts": {
"prefix": "put",
"body": "IO.puts($0)"
Expand Down

0 comments on commit f774bce

Please sign in to comment.