summaryrefslogtreecommitdiff
path: root/script-beta
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-11-17 10:26:49 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-11-17 10:26:49 +0800
commita9bf4d58c069d06cc6b7f002e0347eb26b0451ab (patch)
tree6d30e8717eb6f784c4cce71d90c61e0d29479bd5 /script-beta
parent3d1b5fde86725f821f0936e3be8f57e01a8cd93c (diff)
downloadlua-language-server-a9bf4d58c069d06cc6b7f002e0347eb26b0451ab.zip
重载工作区时也要清空函数库
Diffstat (limited to 'script-beta')
-rw-r--r--script-beta/files.lua4
-rw-r--r--script-beta/workspace/workspace.lua1
2 files changed, 5 insertions, 0 deletions
diff --git a/script-beta/files.lua b/script-beta/files.lua
index 2d2f00da..681245e3 100644
--- a/script-beta/files.lua
+++ b/script-beta/files.lua
@@ -77,6 +77,10 @@ function m.getLibraryPath(uri)
return m.libraryMap[uri]
end
+function m.flushAllLibrary()
+ m.libraryMap = {}
+end
+
--- 是否存在
---@return boolean
function m.exists(uri)
diff --git a/script-beta/workspace/workspace.lua b/script-beta/workspace/workspace.lua
index ce8cf161..08402bdb 100644
--- a/script-beta/workspace/workspace.lua
+++ b/script-beta/workspace/workspace.lua
@@ -298,6 +298,7 @@ function m.getRelativePath(uri)
end
function m.reload()
+ files.flushAllLibrary()
files.removeAllClosed()
rpath.flush()
await.call(m.awaitPreload)