summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-12-28 17:58:11 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-12-28 17:58:11 +0800
commit08ab0f45adb64f314b55f38ae69b7fee97e30e36 (patch)
tree8a0bc56db8d54fdba18856c46240d36e6c25aed6 /server
parent8c7f8eb408a3864f00be331bde09ce6986827881 (diff)
downloadlua-language-server-08ab0f45adb64f314b55f38ae69b7fee97e30e36.zip
记录每个chunk中的局部变量
Diffstat (limited to 'server')
-rw-r--r--server/src/core/vm.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/server/src/core/vm.lua b/server/src/core/vm.lua
index 5ccada8e..fc00b581 100644
--- a/server/src/core/vm.lua
+++ b/server/src/core/vm.lua
@@ -119,6 +119,7 @@ function mt:createLocal(key, source, value)
self.scope.locals[key] = loc
self.results.locals[#self.results.locals+1] = loc
+ self.chunk.locals[#self.chunk.locals+1] = loc
self:addInfo(loc, 'local', source)
self:setValue(loc, value, source)
@@ -1463,6 +1464,7 @@ local function compile(ast, lsp, uri)
},
chunk = env {
labels = {},
+ locals = {},
},
results = {
locals = {},