diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-04-05 21:01:20 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-04-05 21:01:20 +0800 |
commit | 0408b1a9e2b0281b8afbe931e8bc934ee6e0c775 (patch) | |
tree | 908e0cc7b090bd18521128539a85ab779e6ba052 /server/test/completion | |
parent | 243ffa67e5b3b094365c40b04a1a505a9e73da57 (diff) | |
download | lua-language-server-0408b1a9e2b0281b8afbe931e8bc934ee6e0c775.zip |
自动完成支持 *toclose
Diffstat (limited to 'server/test/completion')
-rw-r--r-- | server/test/completion/init.lua | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/server/test/completion/init.lua b/server/test/completion/init.lua index d17b4a83..ed68dec5 100644 --- a/server/test/completion/init.lua +++ b/server/test/completion/init.lua @@ -103,12 +103,12 @@ function TEST(script) return function (expect) local pos = script:find('@', 1, true) - 1 local new_script = script:gsub('@', ' ') - local ast = parser:ast(new_script, 'lua', 'Lua 5.3') + local ast = parser:ast(new_script, 'lua', 'Lua 5.4') local vm = buildVM(ast) assert(vm) local word = findWord(pos, new_script) local startPos = findStartPos(pos, new_script) - local result = core.completion(vm, startPos, word) + local result = core.completion(vm, new_script, startPos, word) if expect then assert(result) assert(eq(expect, result)) @@ -734,3 +734,24 @@ do end ]] (nil) + +require 'config' .config.runtime.version = 'Lua 5.4' +TEST [[ +local *@ +]] +{ + { + label = 'toclose', + kind = CompletionItemKind.Keyword, + } +} + +TEST [[ +local *tocl@ +]] +{ + { + label = 'toclose', + kind = CompletionItemKind.Keyword, + } +} |