diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/src/async/loadfile.lua | 2 | ||||
-rw-r--r-- | server/src/files/files.lua | 1 | ||||
-rw-r--r-- | server/src/service.lua | 8 | ||||
-rw-r--r-- | server/src/workspace.lua | 2 |
4 files changed, 13 insertions, 0 deletions
diff --git a/server/src/async/loadfile.lua b/server/src/async/loadfile.lua index 33851f58..b9d0f41c 100644 --- a/server/src/async/loadfile.lua +++ b/server/src/async/loadfile.lua @@ -6,6 +6,8 @@ while true do local buf = io.load(fs.path(filename)) if buf then OUT:push(filename, mode, buf) + else + ERR:push('Load failed:' .. filename) end GC:push(ID, collectgarbage 'count') end diff --git a/server/src/files/files.lua b/server/src/files/files.lua index ed56483c..88ff7444 100644 --- a/server/src/files/files.lua +++ b/server/src/files/files.lua @@ -84,6 +84,7 @@ function mt:clear() end self._files = {} self._library = {} + self._fileCount = nil end function mt:clearVM() diff --git a/server/src/service.lua b/server/src/service.lua index 0eb5e625..fb8c3123 100644 --- a/server/src/service.lua +++ b/server/src/service.lua @@ -258,16 +258,20 @@ end ---@param compiled table function mt:readText(uri, path, buf, compiled) if self._files:get(uri) then + log.debug('Read failed due to duplicate:', uri) return end if not self:isLua(uri) then + log.debug('Read failed due to not lua:', uri) return end if not self._files:isOpen() and self:isIgnored(uri) then + log.debug('Read failed due to ignored:', uri) return end local text = buf or io.load(path) if not self._files:isOpen() and not self:checkReadFile(uri, path, text) then + log.debug('Read failed due to check failed:', uri) return end self._files:save(uri, text, 0) @@ -327,9 +331,12 @@ function mt:reCompile() self.globalValue = nil self._compileTask:remove() self._needCompile = {} + local n = 0 for uri in self._files:eachFile() do self:needCompile(uri, compiled) + n = n + 1 end + log.debug('reCompile:', n, self._files:count()) self:_testMemory('skip') end @@ -717,6 +724,7 @@ function mt:restartDueToMemoryLeak() end function mt:reScanFiles() + log.debug('reScanFiles') self:clearAllFiles() if self.workspace then self.workspace:scanFiles() diff --git a/server/src/workspace.lua b/server/src/workspace.lua index 18f9b15b..c5db8c5a 100644 --- a/server/src/workspace.lua +++ b/server/src/workspace.lua @@ -63,6 +63,8 @@ function mt:listenLoadFile() self.lsp:readText(uri, path, buf, self._currentScanCompiled) elseif mode == 'library' then self.lsp:readLibrary(uri, path, buf, self._currentScanCompiled) + else + error('Unknown mode:' .. tostring(mode)) end end) end |