Skip to content

Instantly share code, notes, and snippets.

@mathvp
Last active February 2, 2019 01:16
Show Gist options
  • Save mathvp/5d00ea7b691815902d87a7108ef21a2d to your computer and use it in GitHub Desktop.
Save mathvp/5d00ea7b691815902d87a7108ef21a2d to your computer and use it in GitHub Desktop.
Custom Ruby/Rails Snippets for VSCode
{
// Custom Ruby/Rails Snippets for VSCode - Matheus Vieira
// Place on .config/Code/User/snippets or go to 'File > Preferences >
// User snippets' and create a Ruby snippet file
// TODO Needs to remove extra whitespaces from the feature name string
// https://code.visualstudio.com/docs/editor/userdefinedsnippets
"do": {
"prefix": "do",
"body": [
"do",
"\t$0",
"end"
],
"description": "Insert 'end' after 'do'"
},
"spec_feature": {
"prefix": "feature",
"body": [
"feature '${TM_FILENAME_BASE/([_]|[a-z]*$)/${2} /g} $0' do",
"\tscenario 'Successfully' do",
"\t\t",
"\tend",
"end"
],
"description": "Spec feature"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment