summaryrefslogtreecommitdiff
path: root/test-beta/completion/init.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-09-17 20:00:19 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-09-17 20:00:19 +0800
commitb6c59b00a307b7cb6396e96c65611a08ac3c3339 (patch)
treec9396a6689e72770f093a0a1f2183eb0be06af9b /test-beta/completion/init.lua
parent955e08617643e9961da0000e8bc270b0bd85047c (diff)
downloadlua-language-server-b6c59b00a307b7cb6396e96c65611a08ac3c3339.zip
支持自动变形为index
Diffstat (limited to 'test-beta/completion/init.lua')
-rw-r--r--test-beta/completion/init.lua55
1 files changed, 24 insertions, 31 deletions
diff --git a/test-beta/completion/init.lua b/test-beta/completion/init.lua
index b0cfd4e2..cf79d795 100644
--- a/test-beta/completion/init.lua
+++ b/test-beta/completion/init.lua
@@ -34,9 +34,10 @@ end
rawset(_G, 'TEST', true)
local Cared = {
- ['label'] = true,
- ['kind'] = true,
- ['textEdit'] = true,
+ ['label'] = true,
+ ['kind'] = true,
+ ['textEdit'] = true,
+ ['additionalTextEdits'] = true,
}
function TEST(script)
@@ -58,7 +59,7 @@ function TEST(script)
item[k] = v
end
for k in pairs(item) do
- if not Cared[k] then
+ if not Cared[k] then
item[k] = nil
end
end
@@ -962,7 +963,6 @@ else$
}
Cared['insertText'] = true
-
TEST [[
local xpcal
xpcal$
@@ -1000,9 +1000,8 @@ mt:f$
insertText = 'f(${1:a: any}, ${2:b: any}, ${3:c: any})',
},
}
+Cared['insertText'] = false
--- TODO
-do return end
TEST [[
local function f()
if a then
@@ -1011,39 +1010,32 @@ end
]]
{
{
- label = 'select',
- kind = CompletionItemKind.Function,
- detail = EXISTS,
+ label = 'else',
+ kind = CompletionItemKind.Keyword,
},
{
- label = 'select()',
+ label = 'elseif',
+ kind = CompletionItemKind.Keyword,
+ },
+ {
+ label = 'elseif .. then',
kind = CompletionItemKind.Snippet,
- detail = EXISTS,
- insertText = EXISTS,
},
{
- label = 'setmetatable',
+ label = 'select',
kind = CompletionItemKind.Function,
- detail = EXISTS,
},
{
- label = 'setmetatable()',
+ label = 'select()',
kind = CompletionItemKind.Snippet,
- detail = EXISTS,
- insertText = EXISTS,
- },
- {
- label = 'else',
- kind = CompletionItemKind.Keyword,
},
{
- label = 'elseif',
- kind = CompletionItemKind.Keyword,
+ label = 'setmetatable',
+ kind = CompletionItemKind.Function,
},
{
- label = 'elseif .. then',
+ label = 'setmetatable()',
kind = CompletionItemKind.Snippet,
- insertText = EXISTS,
},
}
@@ -1058,7 +1050,6 @@ t.$
{
label = 'a.b.c',
kind = CompletionItemKind.Field,
- detail = EXISTS,
textEdit = {
start = 37,
finish = 36,
@@ -1066,14 +1057,16 @@ t.$
},
additionalTextEdits = {
{
- start = 36,
- finish = 36,
+ start = 36,
+ finish = 36,
newText = '',
- }
- }
+ },
+ },
}
}
+-- TODO
+do return end
TEST [[
_ENV['z.b.c'] = {}