mirror of
https://github.com/Reuh/language-candran.git
synced 2025-10-27 12:19:30 +00:00
Add snippet for creating a local function
This commit is contained in:
parent
bc0ddc02b6
commit
ff6f1af0db
2 changed files with 4 additions and 0 deletions
|
|
@ -21,6 +21,7 @@ Common snippets
|
||||||
| ife | if else conditional | if value then --body... else --body... end |
|
| ife | if else conditional | if value then --body... else --body... end |
|
||||||
| ifn | if not conditional | if not value then --body... end |
|
| ifn | if not conditional | if not value then --body... end |
|
||||||
| ifne | if not else conditional | if not value then --body... else --body... end |
|
| ifne | if not else conditional | if not value then --body... else --body... end |
|
||||||
|
| lfun | local function | local function functionName (args) -- body... end |
|
||||||
| loc | local variable definition shortcut | local x = 1 |
|
| loc | local variable definition shortcut | local x = 1 |
|
||||||
| local | local variable definition | local x = 1 |
|
| local | local variable definition | local x = 1 |
|
||||||
| ltab | local table definition | local name = {} |
|
| ltab | local table definition | local name = {} |
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,9 @@
|
||||||
'for k,v in pairs()':
|
'for k,v in pairs()':
|
||||||
'prefix': 'forp'
|
'prefix': 'forp'
|
||||||
'body': 'for ${1:k},${2:v} in pairs(${3:table_name}) do\n\t${0:-- body...}\nend'
|
'body': 'for ${1:k},${2:v} in pairs(${3:table_name}) do\n\t${0:-- body...}\nend'
|
||||||
|
'local function':
|
||||||
|
'prefix': 'lfun'
|
||||||
|
'body': 'local function ${1:FunctionName} (${2:args})\n\t${0:-- body...}\nend'
|
||||||
'local variable definition':
|
'local variable definition':
|
||||||
'prefix': 'local'
|
'prefix': 'local'
|
||||||
'body': 'local ${1:x} = ${0:1}'
|
'body': 'local ${1:x} = ${0:1}'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue