summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/src/service.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/server/src/service.lua b/server/src/service.lua
index 2d31ad9e..16c1f549 100644
--- a/server/src/service.lua
+++ b/server/src/service.lua
@@ -311,8 +311,15 @@ function mt:reCompile()
self.emmy:remove()
end
+ local compiled = {}
+ local needCompile = {}
+ for uri in self._files:eachFile() do
+ needCompile[uri] = true
+ end
+
self._files:clear()
+
for _, obj in pairs(listMgr.list) do
if obj.type == 'source' or obj.type == 'function' then
obj:kill()
@@ -325,9 +332,12 @@ function mt:reCompile()
self.globalValue = nil
self._compileTask:remove()
self._needCompile = {}
- local compiled = {}
for uri, buf in self._files:eachOpened() do
self:readText(uri, uric.decode(uri), buf, compiled)
+ self:needCompile(uri, compiled)
+ end
+ for uri in pairs(needCompile) do
+ self:needCompile(uri, compiled)
end
self:_testMemory('skip')