diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-01-23 15:30:15 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-01-23 15:30:15 +0800 |
commit | a698d13407454735870b671bb270f0cf33daab31 (patch) | |
tree | ef8ae60f6a6e593a9b04a9756a075c2e163c80ca /server/src | |
parent | 069ff968341e81976c46fd6a260db429b99473f6 (diff) | |
download | lua-language-server-a698d13407454735870b671bb270f0cf33daab31.zip |
修正全局变量的一个bug
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/core/global.lua | 1 | ||||
-rw-r--r-- | server/src/service.lua | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/server/src/core/global.lua b/server/src/core/global.lua index 5704bfd4..ba4fdc47 100644 --- a/server/src/core/global.lua +++ b/server/src/core/global.lua @@ -25,7 +25,6 @@ function mt:markGet(uri, k) end function mt:compileVM(uri, vm) - self:clearGlobal(uri) local seted = {} for k, v in next, vm.env.child do local get, set diff --git a/server/src/service.lua b/server/src/service.lua index 57606d19..8e22c724 100644 --- a/server/src/service.lua +++ b/server/src/service.lua @@ -293,6 +293,7 @@ function mt:compileVM(uri) local ast = self:compileAst(obj) obj.astCost = os.clock() - clock self:_clearChainNode(obj, uri) + self._global:clearGlobal(uri) local clock = os.clock() obj.vm = core.vm(ast, self, uri) @@ -336,6 +337,8 @@ function mt:doDiagnostics(uri) uri = uri, diagnostics = res, }) + else + self:clearDiagnostics(uri) end end |