summaryrefslogtreecommitdiff
path: root/script/provider/diagnostic.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-05-26 14:28:19 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-05-26 14:28:19 +0800
commit130a69fe959f5894fab362919f7f8aa8a08aebcc (patch)
tree08377942f0b3a9d5bb86825b4acf8a59e6e0e329 /script/provider/diagnostic.lua
parent16c576dfe3390a208d1a5439eb90c1e985797dda (diff)
downloadlua-language-server-130a69fe959f5894fab362919f7f8aa8a08aebcc.zip
use preview
Diffstat (limited to 'script/provider/diagnostic.lua')
-rw-r--r--script/provider/diagnostic.lua20
1 files changed, 11 insertions, 9 deletions
diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua
index 4978f412..d7051d7f 100644
--- a/script/provider/diagnostic.lua
+++ b/script/provider/diagnostic.lua
@@ -489,8 +489,7 @@ function m.diagnosticsScope(uri, force)
end
---@async
-function m.pullDiagnosticScope()
- local results = {}
+function m.pullDiagnosticScope(callback)
local processing = 0
for _, scp in ipairs(scope.folders) do
@@ -515,7 +514,7 @@ function m.pullDiagnosticScope()
m.awaitDiagnosticsScope(scp.uri, function (fileUri)
local suc, result, unchanged = xpcall(m.pullDiagnostic, log.error, fileUri, true)
if suc then
- results[#results+1] = {
+ callback {
uri = fileUri,
result = result,
unchanged = unchanged,
@@ -527,18 +526,21 @@ function m.pullDiagnosticScope()
end
end
- while processing > 0 do
- await.sleep(0.1)
+ -- sleep for ever
+ while true do
+ await.sleep(1.0)
end
-
- return results
end
---@param uri uri
---@return 'server' | 'client'
function m.getOwner(uri)
- --TODO
- return 'client'
+ -- TODO
+ if PREVIEW then
+ return 'client'
+ else
+ return 'server'
+ end
end
function m.refreshClient()