summaryrefslogtreecommitdiff
path: root/script/core/diagnostics
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-01-05 17:01:55 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-01-05 17:01:55 +0800
commit32301f8de3d832d428bf75fe44269ed121f4ab4f (patch)
treedacab9a50a96a1332d10dc2b355173a8770bc9ae /script/core/diagnostics
parente6c9cf88693235171cf38581d8e1cf3334744a9c (diff)
downloadlua-language-server-32301f8de3d832d428bf75fe44269ed121f4ab4f.zip
workspaceRate
Diffstat (limited to 'script/core/diagnostics')
-rw-r--r--script/core/diagnostics/init.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/script/core/diagnostics/init.lua b/script/core/diagnostics/init.lua
index 50233559..4f5510c7 100644
--- a/script/core/diagnostics/init.lua
+++ b/script/core/diagnostics/init.lua
@@ -19,6 +19,9 @@ table.sort(diagList, function (a, b)
return (diagSort[a] or 0) < (diagSort[b] or 0)
end)
+---@param uri uri
+---@param name string
+---@param response async fun(result: any)
local function check(uri, name, response)
if config.get(uri, 'Lua.diagnostics.disable')[name] then
return
@@ -40,6 +43,7 @@ local function check(uri, name, response)
local severity = define.DiagnosticSeverity[level]
local clock = os.clock()
local mark = {}
+ ---@async
require('core.diagnostics.' .. name)(uri, function (result)
if vm.isDiagDisabledAt(uri, result.start, name) then
return
@@ -65,6 +69,8 @@ local function check(uri, name, response)
end
---@async
+---@param uri uri
+---@param response async fun(result: any)
return function (uri, response)
local ast = files.getState(uri)
if not ast then