summaryrefslogtreecommitdiff
path: root/script/workspace/workspace.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-01-04 20:27:39 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-01-04 20:27:39 +0800
commite9e1964ba182671fa4f89b931dd5b6db627ef544 (patch)
tree98ab999a328b05bbce2d8428db33801fd6bb251f /script/workspace/workspace.lua
parent61fa71d28000257ce8c676a4f66313cc55572318 (diff)
downloadlua-language-server-e9e1964ba182671fa4f89b931dd5b6db627ef544.zip
fix
Diffstat (limited to 'script/workspace/workspace.lua')
-rw-r--r--script/workspace/workspace.lua14
1 files changed, 9 insertions, 5 deletions
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua
index ebffee9d..9160657a 100644
--- a/script/workspace/workspace.lua
+++ b/script/workspace/workspace.lua
@@ -244,8 +244,8 @@ end
---@async
---@param scp scope
function m.awaitPreload(scp)
- await.close 'preload'
- await.setID 'preload'
+ await.close('preload:' .. scp.uri)
+ await.setID('preload:' .. scp.uri)
await.sleep(0.1)
local watchers = scp:get 'watchers'
@@ -282,9 +282,9 @@ function m.awaitPreload(scp)
watchers[#watchers+1] = fw.watch(furi.decode(libMatcher.uri))
end
- log.info(('Found %d files.'):format(ld.max))
+ log.info(('Found %d files at:'):format(ld.max), scp.uri)
ld:loadAll()
- log.info('Preload finish.')
+ log.info('Preload finish at:', scp.uri)
end
--- 查找符合指定file path的所有uri
@@ -479,7 +479,11 @@ function m.getLoadingProcess(uri)
local scp = m.getScope(uri)
---@type workspace.loading
local ld = scp:get 'loading'
- return ld.read, ld.max
+ if ld then
+ return ld.read, ld.max
+ else
+ return 0, 0
+ end
end
files.watch(function (ev, uri) ---@async