summaryrefslogtreecommitdiff
path: root/test-beta/completion
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-09-08 18:21:27 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-09-08 18:21:27 +0800
commit9aa78df23915920738da936698cda56c7c883288 (patch)
treed95c331b2fbf6945d2b4abac0fd61c9295941975 /test-beta/completion
parent7a2ef1c1a699417ce7998bc088c68fc652d745af (diff)
downloadlua-language-server-9aa78df23915920738da936698cda56c7c883288.zip
字符串枚举值的自动完成
Diffstat (limited to 'test-beta/completion')
-rw-r--r--test-beta/completion/init.lua98
1 files changed, 54 insertions, 44 deletions
diff --git a/test-beta/completion/init.lua b/test-beta/completion/init.lua
index d73ec4f4..d8a1af04 100644
--- a/test-beta/completion/init.lua
+++ b/test-beta/completion/init.lua
@@ -49,7 +49,9 @@ function TEST(script)
for _, item in ipairs(result) do
core.resolve(item.id)
for k in pairs(item) do
- if k ~= 'label' and k ~= 'kind' then
+ if k ~= 'label'
+ and k ~= 'kind'
+ and k ~= 'textEdit' then
item[k] = nil
end
end
@@ -454,79 +456,87 @@ collectgarbage($)
]]
(EXISTS)
--- TODO
-do return end
-
TEST [[
collectgarbage('$')
]]
{
{
- label = 'collect',
- filterText = 'collect',
+ label = "'collect'",
kind = CompletionItemKind.EnumMember,
- documentation = EXISTS,
- textEdit = EXISTS,
- additionalTextEdits = EXISTS,
+ textEdit = {
+ start = 16,
+ finish = 17,
+ newText = "'collect'",
+ },
},
{
- label = 'stop',
- filterText = 'stop',
+ label = "'stop'",
kind = CompletionItemKind.EnumMember,
- documentation = EXISTS,
- textEdit = EXISTS,
- additionalTextEdits = EXISTS,
+ textEdit = {
+ start = 16,
+ finish = 17,
+ newText = "'stop'",
+ },
},
{
- label = 'restart',
- filterText = 'restart',
+ label = "'restart'",
kind = CompletionItemKind.EnumMember,
- documentation = EXISTS,
- textEdit = EXISTS,
- additionalTextEdits = EXISTS,
+ textEdit = {
+ start = 16,
+ finish = 17,
+ newText = "'restart'",
+ },
},
{
- label = 'count',
- filterText = 'count',
+ label = "'count'",
kind = CompletionItemKind.EnumMember,
- documentation = EXISTS,
- textEdit = EXISTS,
- additionalTextEdits = EXISTS,
+ textEdit = {
+ start = 16,
+ finish = 17,
+ newText = "'count'",
+ },
},
{
- label = 'step',
- filterText = 'step',
+ label = "'step'",
kind = CompletionItemKind.EnumMember,
- documentation = EXISTS,
- textEdit = EXISTS,
- additionalTextEdits = EXISTS,
+ textEdit = {
+ start = 16,
+ finish = 17,
+ newText = "'step'",
+ },
},
{
- label = 'setpause',
- filterText = 'setpause',
+ label = "'setpause'",
kind = CompletionItemKind.EnumMember,
- documentation = EXISTS,
- textEdit = EXISTS,
- additionalTextEdits = EXISTS,
+ textEdit = {
+ start = 16,
+ finish = 17,
+ newText = "'setpause'",
+ },
},
{
- label = 'setstepmul',
- filterText = 'setstepmul',
+ label = "'setstepmul'",
kind = CompletionItemKind.EnumMember,
- documentation = EXISTS,
- textEdit = EXISTS,
- additionalTextEdits = EXISTS,
+ textEdit = {
+ start = 16,
+ finish = 17,
+ newText = "'setstepmul'",
+ },
},
{
- label = 'isrunning',
- filterText = 'isrunning',
+ label = "'isrunning'",
kind = CompletionItemKind.EnumMember,
- documentation = EXISTS,
- textEdit = EXISTS,
- additionalTextEdits = EXISTS,
+ textEdit = {
+ start = 16,
+ finish = 17,
+ newText = "'isrunning'",
+ },
},
}
+-- TODO
+do return end
+
TEST [[
io.read($)
]]