summaryrefslogtreecommitdiff
path: root/script/core/diagnostics
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-06-24 21:07:59 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-06-24 21:07:59 +0800
commitaaf13ce9badaa123e0d67acde5f96deba893f06f (patch)
tree2d332196becf4aa592cb8c941be3245590ce9a9b /script/core/diagnostics
parent002ebe37bdc749b527dc6040a4512a3714334862 (diff)
downloadlua-language-server-aaf13ce9badaa123e0d67acde5f96deba893f06f.zip
await.delay
Diffstat (limited to 'script/core/diagnostics')
-rw-r--r--script/core/diagnostics/deprecated.lua4
-rw-r--r--script/core/diagnostics/undefined-field.lua4
2 files changed, 6 insertions, 2 deletions
diff --git a/script/core/diagnostics/deprecated.lua b/script/core/diagnostics/deprecated.lua
index 28205845..d6265f64 100644
--- a/script/core/diagnostics/deprecated.lua
+++ b/script/core/diagnostics/deprecated.lua
@@ -35,8 +35,6 @@ return function (uri, callback)
end
end
- await.delay()
-
local id = noder.getID(src)
if not id then
return
@@ -46,6 +44,8 @@ return function (uri, callback)
return
end
+ await.delay()
+
if not vm.isDeprecated(src, true) then
cache[id] = true
return
diff --git a/script/core/diagnostics/undefined-field.lua b/script/core/diagnostics/undefined-field.lua
index fd1fdbd9..8dad36eb 100644
--- a/script/core/diagnostics/undefined-field.lua
+++ b/script/core/diagnostics/undefined-field.lua
@@ -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,
@@ -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