summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-03-19 16:28:23 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-03-19 16:28:23 +0800
commit01baacfd67d143d21f21f380eb55aa04b68167d6 (patch)
tree550b63c9674c90762caf62e79f5e4f4f2426ca65 /server
parentd7d69d8366f9d5404db6a0583672efd75b514700 (diff)
downloadlua-language-server-01baacfd67d143d21f21f380eb55aa04b68167d6.zip
更新检测
Diffstat (limited to 'server')
-rw-r--r--server/src/service.lua12
1 files changed, 9 insertions, 3 deletions
diff --git a/server/src/service.lua b/server/src/service.lua
index 74ff98e7..1c102bfa 100644
--- a/server/src/service.lua
+++ b/server/src/service.lua
@@ -333,20 +333,26 @@ function mt:compileVM(uri)
local clock = os.clock()
local vm = buildVM(ast, self, uri)
+ if vm then
+ CachedVM[vm] = true
+ end
if version ~= obj.version then
+ if vm then
+ vm:remove()
+ end
return nil
end
if self._needCompile[uri] then
self:_markCompiled(uri, compiled)
else
+ if vm then
+ vm:remove()
+ end
return nil
end
if obj.vm then
obj.vm:remove()
end
- if vm then
- CachedVM[vm] = true
- end
obj.vm = vm
obj.vmCost = os.clock() - clock
obj.vmVersion = version