summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-01-07 10:39:54 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-01-07 10:39:54 +0800
commit3c4b2f65e2d2cd39461211c640246cb04d9f53ad (patch)
tree315afe64a8c708c140b0332af8bf1d277730769a /server/src
parentde63af45054e742806f6f4cc78e2819b12c364e6 (diff)
downloadlua-language-server-3c4b2f65e2d2cd39461211c640246cb04d9f53ad.zip
改成直接覆盖吧
Diffstat (limited to 'server/src')
-rw-r--r--server/src/core/vm.lua4
-rw-r--r--server/src/parser/ast.lua1
2 files changed, 4 insertions, 1 deletions
diff --git a/server/src/core/vm.lua b/server/src/core/vm.lua
index a17727d6..549fdc80 100644
--- a/server/src/core/vm.lua
+++ b/server/src/core/vm.lua
@@ -332,8 +332,10 @@ function mt:setValue(var, value, source)
if var.value then
if value.type == 'any' then
self:mergeChild(var.value, value)
- else
+ elseif value.type == 'nil' then
self:mergeValue(var.value, value)
+ elseif var.value.uri == self.uri then
+ var.value = value
end
value = var.value
else
diff --git a/server/src/parser/ast.lua b/server/src/parser/ast.lua
index 993a4914..e807c46a 100644
--- a/server/src/parser/ast.lua
+++ b/server/src/parser/ast.lua
@@ -695,6 +695,7 @@ local defs = {
}
return function (self, lua, mode)
+
Errs = {}
local suc, res, err = pcall(self.grammar, lua, mode, defs)
if not suc then