summaryrefslogtreecommitdiff
path: root/server/src/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-01-29 18:08:32 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-01-29 18:08:32 +0800
commite155e1462e613d347195f950696c4ad511358123 (patch)
tree2036a9eaa8a473539650253c3f8f87738495df9d /server/src/core
parentbbdd2711dec66a90d712673acf1ff453581d1c51 (diff)
downloadlua-language-server-e155e1462e613d347195f950696c4ad511358123.zip
修正函数内定义的局部变量可能会失效的BUG
Diffstat (limited to 'server/src/core')
-rw-r--r--server/src/core/completion.lua3
-rw-r--r--server/src/core/vm.lua1
2 files changed, 4 insertions, 0 deletions
diff --git a/server/src/core/completion.lua b/server/src/core/completion.lua
index 685aa8d3..4d735d9d 100644
--- a/server/src/core/completion.lua
+++ b/server/src/core/completion.lua
@@ -103,6 +103,9 @@ local function searchLocals(vm, pos, name, callback)
if loc.source.start == 0 then
goto CONTINUE
end
+ if not loc.close then
+ log.debug('Miss loc close', table.dump(loc))
+ end
if loc.source.start <= pos and loc.close >= pos then
if matchKey(name, loc.key) then
callback(loc)
diff --git a/server/src/core/vm.lua b/server/src/core/vm.lua
index a0c8df26..b88ae1ab 100644
--- a/server/src/core/vm.lua
+++ b/server/src/core/vm.lua
@@ -102,6 +102,7 @@ end
function mt:createLocal(key, source, value)
if source and source.bind then
+ self.scope.locals[key] = source.bind
return source.bind
end
local loc = {