diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-03-01 17:57:08 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-03-01 17:57:08 +0800 |
commit | f6570295633065a319e695211c05cddc71c1c4a6 (patch) | |
tree | a9f36cc8cf3d2e2a52bf46cbdbf932c567b44a21 /server/test | |
parent | 1113d28c032be9ef216e23f35c10ed751296601f (diff) | |
download | lua-language-server-f6570295633065a319e695211c05cddc71c1c4a6.zip |
未定义全局变量
Diffstat (limited to 'server/test')
-rw-r--r-- | server/test/diagnostics/init.lua | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/server/test/diagnostics/init.lua b/server/test/diagnostics/init.lua index 9ab41aed..e8d483ed 100644 --- a/server/test/diagnostics/init.lua +++ b/server/test/diagnostics/init.lua @@ -1,4 +1,5 @@ local core = require 'core' +local buildVM = require 'vm' local parser = require 'parser' local service = require 'service' @@ -43,7 +44,7 @@ function TEST(script) local ast = parser:ast(new_script) assert(ast) local lines = parser:lines(new_script) - local vm = core.vm(ast, lsp) + local vm = buildVM(ast, lsp) assert(vm) local datas = core.diagnostics(vm, lines, 'test') local results = {} @@ -71,7 +72,7 @@ print(<!X!>) print(<!Log!>) print(_VERSION) print(<!y!>) -print(z) +print(<!z!>) z = 1 ]] @@ -154,6 +155,12 @@ end ]] TEST [[ +local mt = {} +function mt:f() +end +]] + +TEST [[ local function f(<!self!>) end f() |