summaryrefslogtreecommitdiff
path: root/test-beta/completion/init.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-12-10 21:09:31 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-12-10 21:09:31 +0800
commit9dd7926771b7b6ad93b919746954bb68bde351a9 (patch)
tree403367b8864daf53d29f9cc4e7c0e71486c58a28 /test-beta/completion/init.lua
parente87c7b5567053de3d94f06c823a0d0962756b237 (diff)
downloadlua-language-server-9dd7926771b7b6ad93b919746954bb68bde351a9.zip
更新完成
Diffstat (limited to 'test-beta/completion/init.lua')
-rw-r--r--test-beta/completion/init.lua84
1 files changed, 71 insertions, 13 deletions
diff --git a/test-beta/completion/init.lua b/test-beta/completion/init.lua
index bebe481b..5736d9b0 100644
--- a/test-beta/completion/init.lua
+++ b/test-beta/completion/init.lua
@@ -132,12 +132,28 @@ ass$
{
{
label = 'assert',
- kind = CompletionItemKind.Function,
+ kind = CompletionItemKind.Function,
},
{
label = 'assert()',
- kind = CompletionItemKind.Snippet,
+ kind = CompletionItemKind.Snippet,
+ },
+}
+
+TEST [[
+local function ffff(a, b)
+end
+ff$
+]]
+{
+ {
+ label = 'ffff',
+ kind = CompletionItemKind.Function,
},
+ {
+ label = 'ffff()',
+ kind = CompletionItemKind.Snippet,
+ }
}
TEST [[
@@ -177,6 +193,7 @@ t.ab$
TEST [[
local mt = {}
+mt.ggg = 1
function mt:get(a, b)
return 1
end
@@ -186,16 +203,15 @@ mt:g$
{
label = 'get',
kind = CompletionItemKind.Method,
- documentation = EXISTS,
- detail = EXISTS,
},
{
label = 'get()',
kind = CompletionItemKind.Snippet,
- documentation = EXISTS,
- insertText = EXISTS,
- detail = EXISTS,
},
+ {
+ label = 'ggg',
+ kind = CompletionItemKind.Text,
+ }
}
TEST [[
@@ -205,15 +221,10 @@ loc$
{
label = 'collectgarbage',
kind = CompletionItemKind.Function,
- documentation = EXISTS,
- detail = EXISTS,
},
{
label = 'collectgarbage()',
kind = CompletionItemKind.Snippet,
- documentation = EXISTS,
- detail = EXISTS,
- insertText = EXISTS,
},
{
label = 'local',
@@ -222,11 +233,58 @@ loc$
{
label = 'local function',
kind = CompletionItemKind.Snippet,
- insertText = EXISTS,
}
}
TEST [[
+do$
+]]
+{
+ {
+ label = 'dofile',
+ kind = CompletionItemKind.Function,
+ },
+ {
+ label = 'dofile()',
+ kind = CompletionItemKind.Snippet,
+ },
+ {
+ label = 'load',
+ kind = CompletionItemKind.Function,
+ },
+ {
+ label = 'load()',
+ kind = CompletionItemKind.Snippet,
+ },
+ {
+ label = 'loadfile',
+ kind = CompletionItemKind.Function,
+ },
+ {
+ label = 'loadfile()',
+ kind = CompletionItemKind.Snippet,
+ },
+ {
+ label = 'do',
+ kind = CompletionItemKind.Keyword,
+ },
+ {
+ label = 'do .. end',
+ kind = CompletionItemKind.Snippet,
+ }
+}
+
+TEST [[
+while true d$
+]]
+{
+ {
+ label = 'do',
+ kind = CompletionItemKind.Keyword,
+ },
+}
+
+TEST [[
t.a = {}
t.b = {}
t.$