diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-12-10 19:43:12 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-12-10 19:43:12 +0800 |
commit | e87c7b5567053de3d94f06c823a0d0962756b237 (patch) | |
tree | 52da8ca37f50b6b570864bb83a4d3141e4199524 /test-beta | |
parent | 244d00ba67e30d28b9c835fc04a09ca3e98e9a20 (diff) | |
download | lua-language-server-e87c7b5567053de3d94f06c823a0d0962756b237.zip |
支持 field
Diffstat (limited to 'test-beta')
-rw-r--r-- | test-beta/completion/init.lua | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/test-beta/completion/init.lua b/test-beta/completion/init.lua index 3a47f6db..bebe481b 100644 --- a/test-beta/completion/init.lua +++ b/test-beta/completion/init.lua @@ -15,22 +15,14 @@ local function eq(a, b) if tp1 == 'table' then local mark = {} for k in pairs(a) do - if type(k) == 'number' - or k == 'label' - or k == 'kind' then - if not eq(a[k], b[k]) then - return false - end - mark[k] = true + if not eq(a[k], b[k]) then + return false end + mark[k] = true end for k in pairs(b) do - if type(k) == 'number' - or k == 'label' - or k == 'kind' then - if not mark[k] then - return false - end + if not mark[k] then + return false end end return true @@ -48,6 +40,13 @@ function TEST(script) files.setText('', new_script) local result = core.completion('', pos) + for _, item in ipairs(result) do + for k in pairs(item) do + if k ~= 'label' and k ~= 'kind' then + item[k] = nil + end + end + end if expect then assert(result) assert(eq(expect, result)) @@ -167,13 +166,12 @@ TEST [[ local t = { abc = 1, } -t.a$ +t.ab$ ]] { { label = 'abc', kind = CompletionItemKind.Enum, - detail = '(number) = 1', } } |