diff options
Diffstat (limited to 'server/src/service.lua')
-rw-r--r-- | server/src/service.lua | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/server/src/service.lua b/server/src/service.lua index 1c8d55b4..869159be 100644 --- a/server/src/service.lua +++ b/server/src/service.lua @@ -255,6 +255,9 @@ function mt:getCachedFileCount() end function mt:reCompile() + self.global = core.global(self) + self.chain = chainMgr() + self.globalValue = nil local compiled = {} local n = 0 for uri in pairs(self._file) do @@ -633,6 +636,25 @@ function mt:restartDueToMemoryLeak() end) end +function mt:onUpdateConfig(updated) + local oldConfig = table.deepCopy(config.config) + config:setConfig(updated) + local newConfig = config.config + if not table.equal(oldConfig.runtime, newConfig.runtime) then + local library = require 'core.library' + library.reload() + self:reCompile() + end + if not table.equal(oldConfig.diagnostics, newConfig.diagnostics) then + log.debug('reDiagnostic') + self:reDiagnostic() + end + if not table.equal(oldConfig.workspace, newConfig.workspace) then + self:clearAllFiles() + self.workspace:scanFiles() + end +end + function mt:_testMemory() local clock = os.clock() collectgarbage() |