mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
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:
34
.atom/snippets/coffee.cson
Normal file
34
.atom/snippets/coffee.cson
Normal 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'
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user