Skip to content

Commit

Permalink
await.delay
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Jun 24, 2021
1 parent 002ebe3 commit aaf13ce
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 2.0.3
* `CHG` improve memory usage
* `FIX` some dialog boxes block the initialization process
* `FIX` diagnostics `undefined-field`: blocks main thread
* `FIX` [#565](https://github.com/sumneko/lua-language-server/issues/565)

## 2.0.2
Expand Down
4 changes: 2 additions & 2 deletions script/core/diagnostics/deprecated.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ return function (uri, callback)
end
end

await.delay()

local id = noder.getID(src)
if not id then
return
Expand All @@ -46,6 +44,8 @@ return function (uri, callback)
return
end

await.delay()

if not vm.isDeprecated(src, true) then
cache[id] = true
return
Expand Down
4 changes: 4 additions & 0 deletions script/core/diagnostics/undefined-field.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ local vm = require 'vm'
local lang = require 'language'
local guide = require 'parser.guide'
local noder = require 'core.noder'
local await = require 'await'

local SkipCheckClass = {
['unknown'] = true,
Expand All @@ -27,6 +28,9 @@ return function (uri, callback)
if cache[id] then
return
end

await.delay()

if #vm.getDefs(src) > 0 then
cache[id] = true
return
Expand Down

0 comments on commit aaf13ce

Please sign in to comment.