summaryrefslogtreecommitdiff
path: root/script/workspace
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-02-03 16:28:52 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-02-03 16:28:52 +0800
commit42bad3f48c65b3a0f99174e07d69c12d12bee5af (patch)
tree128fd6dc4b5bceb816388c2151653265f93b14bc /script/workspace
parent5f5295eecdd9f7f0ca099fa37e3dc92b13d39131 (diff)
downloadlua-language-server-42bad3f48c65b3a0f99174e07d69c12d12bee5af.zip
add more logs
#1872
Diffstat (limited to 'script/workspace')
-rw-r--r--script/workspace/workspace.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua
index fd2e8f31..3890044e 100644
--- a/script/workspace/workspace.lua
+++ b/script/workspace/workspace.lua
@@ -307,11 +307,13 @@ function m.awaitPreload(scp)
if scp.uri and not scp:get('bad root') then
log.info('Scan files at:', scp:getName())
+ ---@async
scp:gc(fw.watch(m.normalize(furi.decode(scp.uri)), true, function (path)
local uri = furi.encode(path)
if m.isIgnored(uri) and not files.isLibrary(uri) then
return false
end
+ await.delay()
return true
end))
local count = 0
@@ -331,11 +333,13 @@ function m.awaitPreload(scp)
for _, libMatcher in ipairs(librarys) do
log.info('Scan library at:', libMatcher.uri)
local count = 0
+ ---@async
scp:gc(fw.watch(furi.decode(libMatcher.uri), true, function (path)
local uri = furi.encode(path)
if m.isIgnored(uri) and not files.isLibrary(uri) then
return false
end
+ await.delay()
return true
end))
scp:addLink(libMatcher.uri)