Load snippets from CSON/JSON. Use syntax properties for scoping.

This commit eliminates the custom `snippets` format and instead just
uses CSON/JSON.
This commit is contained in:
Corey Johnson & Nathan Sobo
2013-01-07 13:35:08 -07:00
parent 2d4c4b3930
commit 361bf83345
6 changed files with 108 additions and 149 deletions

View File

@@ -0,0 +1,34 @@
".source.coffee":
"Describe block":
prefix: "de"
body: """
describe "${1:description}", ->
${2:body}
"""
"It block":
prefix: "i"
body: """
it "$1", ->
$2
"""
"Before each":
prefix: "be"
body: """
beforeEach ->
$1
"""
"Expectation":
prefix: "be"
body: "expect($1).to$2"
"Console log":
prefix: "log"
body: "console.log $1"
"Range array":
prefix: "ra"
body: "[[$1, $2], [$3, $4]]"
"Point array":
prefix: "pt"
body: "[$1, $2]"
"Create Jasmine spy":
prefix: "pt"
body: 'jasmine.createSpy("${1:description}")$2'

View File

@@ -1,34 +0,0 @@
snippet de "Describe block"
describe "${1:description}", ->
${2:body}
endsnippet
snippet i "It block"
it "$1", ->
$2
endsnippet
snippet be "Before each"
beforeEach ->
$1
endsnippet
snippet ex "Expectation"
expect($1).to$2
endsnippet
snippet log "Console log"
console.log $1
endsnippet
snippet ra "Range array"
[[$1, $2], [$3, $4]]
endsnippet
snippet pt "Point array"
[$1, $2]
endsnippet
snippet spy "Jasmine spy"
jasmine.createSpy("${1:description}")$2
endsnippet