27 lines
569 B
Plaintext
27 lines
569 B
Plaintext
snippet docstring "Document string" b
|
|
-- Filename: `!p snip.rv = fn`
|
|
-- Author: ${1:Yannick Reiß}
|
|
-- Copyright: ${2:MIT-License}
|
|
-- Description: ${3:Funny lua script}
|
|
$0
|
|
endsnippet
|
|
|
|
snippet fun "New function"
|
|
-- @name $2
|
|
`!p
|
|
lines = t[5].split('\n')
|
|
for line in lines:
|
|
if line.startswith("return"):
|
|
snip.rv = f"-- @return {line.replace('return', '').replace(' ', '')}\n"
|
|
``!p
|
|
param = ""
|
|
for i in t[3].split(","):
|
|
param += f"-- @param {i.replace(' ', '')}\n"
|
|
snip.rv = param
|
|
`-- @short ${4:Description}
|
|
${1:local }function ${2:Name} (${3:})
|
|
$5
|
|
end;
|
|
$0
|
|
endsnippet
|