summaryrefslogtreecommitdiff
path: root/script-beta/workspace
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-09-18 17:07:11 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-09-18 17:07:11 +0800
commit32dd2af081a40813683ced02a82a129efb604174 (patch)
tree6134c900c7dd93680dd34d855bbae4815e6da4dd /script-beta/workspace
parent8dc4b5d3f8145e679ae27b2b7e8a85cc122f7044 (diff)
downloadlua-language-server-32dd2af081a40813683ced02a82a129efb604174.zip
重新设计await的任务中断
Diffstat (limited to 'script-beta/workspace')
-rw-r--r--script-beta/workspace/workspace.lua10
1 files changed, 2 insertions, 8 deletions
diff --git a/script-beta/workspace/workspace.lua b/script-beta/workspace/workspace.lua
index f837fe91..0552bf98 100644
--- a/script-beta/workspace/workspace.lua
+++ b/script-beta/workspace/workspace.lua
@@ -13,7 +13,6 @@ local m = {}
m.type = 'workspace'
m.ignoreVersion = -1
m.ignoreMatcher = nil
-m.preloadVersion = 0
m.uri = ''
m.path = ''
m.requireCache = {}
@@ -202,15 +201,10 @@ function m.getRelativePath(uri)
end
function m.reload()
- m.preloadVersion = m.preloadVersion + 1
files.removeAll()
rpath.flush()
- await.create(function ()
- await.setDelayer(function ()
- return m.preloadVersion
- end)
- m.awaitPreload()
- end)
+ await.close 'preload'
+ await.call(m.awaitPreload, 'preload')
end
return m