diff options
author | sumneko <sumneko@hotmail.com> | 2019-04-03 18:54:02 +0800 |
---|---|---|
committer | sumneko <sumneko@hotmail.com> | 2019-04-03 18:54:02 +0800 |
commit | 7dfd2016c66e6ad161445cb93d953365fa57d54e (patch) | |
tree | 3c7ed6466a139ed9e9490932a1a92949d02be51b /server/src/service.lua | |
parent | b468e3bda20b5178faa0bc26b7afd433505cbbb6 (diff) | |
download | lua-language-server-7dfd2016c66e6ad161445cb93d953365fa57d54e.zip |
不管有没有重新编译,都要重新诊断,以更新全局变量
Diffstat (limited to 'server/src/service.lua')
-rw-r--r-- | server/src/service.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/server/src/service.lua b/server/src/service.lua index 869159be..bbac7b6d 100644 --- a/server/src/service.lua +++ b/server/src/service.lua @@ -125,6 +125,7 @@ function mt:read(mode) end function mt:needCompile(uri, compiled, mode) + self._needDiagnostics[uri] = true if self._needCompile[uri] then return end @@ -270,8 +271,13 @@ end function mt:reDiagnostic() for uri in pairs(self._file) do - self._needDiagnostics[uri] = true + self:clearDiagnostics(uri) end + ac.wait(0.5, function () + for uri in pairs(self._file) do + self._needDiagnostics[uri] = true + end + end) end function mt:clearAllFiles() @@ -437,8 +443,6 @@ function mt:compileVM(uri) obj.lines = parser:lines(obj.text, 'utf8') obj.lineCost = os.clock() - clock - self._needDiagnostics[uri] = true - if obj.vmCost > 0.2 then log.debug(('Compile VM[%s] takes: %.3f sec'):format(uri, obj.vmCost)) end |