diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-03-13 10:44:49 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-03-13 10:44:49 +0800 |
commit | ace1606ad0829e4b4b322f32eb02ca3a4b7ede7d (patch) | |
tree | d64334a7070cd51164d4a32f154ce6e2e8733a79 | |
parent | 1716e334b260396da460148560045bc55894c322 (diff) | |
download | lua-language-server-ace1606ad0829e4b4b322f32eb02ca3a4b7ede7d.zip |
修改诊断策略
-rw-r--r-- | server/src/service.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/server/src/service.lua b/server/src/service.lua index cd3d24ed..7350ed95 100644 --- a/server/src/service.lua +++ b/server/src/service.lua @@ -220,6 +220,9 @@ function mt:loadVM(uri) return nil end self:compileVM(uri) + if obj.vm then + self._lastLoadedVM = uri + end return obj.vm, obj.lines, obj.text end @@ -472,17 +475,14 @@ function mt:_createCompileTask() return end self._compileTask = coroutine.create(function () + self:doDiagnostics(self._lastLoadedVM) local uri = self._needCompile[1] if uri then self:compileVM(uri) end - if self._needDiagnostics[uri] then + uri = next(self._needDiagnostics) + if uri then self:doDiagnostics(uri) - else - uri = next(self._needDiagnostics) - if uri then - self:doDiagnostics(uri) - end end end) end |