Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add crystal snippets #22

Merged
merged 1 commit into from
Sep 22, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions snippets/crystal.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,24 @@
],
"description": "Constructor method for an Object."
},
"protected def": {
"prefix": "pro",
"body": [
"protected def ${1:method_name}",
"\t$0",
"end"
],
"description": "Protected method for an Object, can only be referenced inside the namespace where they are defined."
},
"private def": {
"prefix": "pri",
"body": [
"private def ${1:method_name}",
"\t$0",
"end"
],
"description": "Private method for an Object, can only be invoked without a receiver."
},
"method definition": {
"prefix": "def",
"body": [
Expand All @@ -119,6 +137,13 @@
],
"description": "Method names begin with a lowercase letter and, as a convention, only use lowercase letters, underscores and numbers."
},
"delegate": {
"prefix": "del",
"body": [
"delegate ${1:method}, to: ${2:@variable}"
],
"description": "Delegate methods to to. This is only useful when no captured blocks are involved"
},
"Struct definition": {
"prefix": "struct",
"body": [
Expand Down