summaryrefslogtreecommitdiff
path: root/server/src/core/snippet.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-08-27 20:28:01 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-08-27 20:28:01 +0800
commita828a593e119ec222e4ef9e6a737234cabe00245 (patch)
tree8c39fb4a4738bdaa1d6d81173e42ba50903cb368 /server/src/core/snippet.lua
parentf188a3001de879387fafbb3e875ceafa48e74ab9 (diff)
downloadlua-language-server-a828a593e119ec222e4ef9e6a737234cabe00245.zip
函数调用的代码片段
Diffstat (limited to 'server/src/core/snippet.lua')
-rw-r--r--server/src/core/snippet.lua27
1 files changed, 9 insertions, 18 deletions
diff --git a/server/src/core/snippet.lua b/server/src/core/snippet.lua
index a098d6a0..a4458788 100644
--- a/server/src/core/snippet.lua
+++ b/server/src/core/snippet.lua
@@ -18,8 +18,7 @@ end
add('key', 'do', 'do .. end') [[
do
$0
-end
-]]
+end]]
add('key', 'elseif', 'elseif .. then')
[[elseif ${1:true} then]]
@@ -27,50 +26,42 @@ add('key', 'elseif', 'elseif .. then')
add('key', 'for', 'for .. in') [[
for ${1:key, value} in ${2:pairs(t)} do
$0
-end
-]]
+end]]
add('key', 'for', 'for i = ..') [[
for ${1:i} = ${2:1}, ${3:10, 2} do
$0
-end
-]]
+end]]
add('key', 'function', 'function name()') [[
function ${1:name}(${2:arg1, arg2, arg3})
$0
-end
-]]
+end]]
add('key', 'function', 'function ()') [[
function (${1:arg1, arg2, arg3})
$0
-end
-]]
+end]]
add('key', 'local', 'local function') [[
local function ${1:name}(${2:arg1, arg2, arg3})
$0
-end
-]]
+end]]
add('key', 'if', 'if .. then') [[
if ${1:true} then
$0
-end
-]]
+end]]
add('key', 'repeat', 'repeat .. until') [[
repeat
$0
-until ${1:true}
-]]
+until ${1:true}]]
add('key', 'while', 'while .. do') [[
while ${1:true} do
$0
-end
-]]
+end]]
add('key', 'return', 'do return end')
[[do return ${1:true} end]]