mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-19 06:58:26 +03:00
Make the fun
snippet work in more contexts
`fun` expands to a simple function definition in JavaScript, but there are certain contexts where that syntax is invalid, making the snippet much less useful. Now that we're scoping the insides of class bodies and object literals, though, we can define more specific snippets for those contexts that use the correct syntax. The class-instance-method snippet and the inside-an-object-literal snippet are identical, except that the latter has a trailing comma.
This commit is contained in:
parent
5c8f6abd94
commit
37a81ccb82
@ -128,3 +128,18 @@
|
||||
'return':
|
||||
'prefix': 'ret'
|
||||
'body': 'return $1;$0'
|
||||
|
||||
'.source.js .meta.block.function.js':
|
||||
'Function':
|
||||
'prefix': 'fun'
|
||||
'body': 'function ${1:functionName}($2) {\n\t$0\n}'
|
||||
|
||||
'.source.js .meta.block.class.js':
|
||||
'Function':
|
||||
'prefix': 'fun'
|
||||
'body': '${1:functionName}($2) {\n\t$0\n}'
|
||||
|
||||
'.source.js .meta.object.js':
|
||||
'Function':
|
||||
'prefix': 'fun'
|
||||
'body': '${1:functionName}($2) {\n\t$0\n},'
|
||||
|
Loading…
Reference in New Issue
Block a user