summaryrefslogtreecommitdiff
path: root/script/workspace/workspace.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-01-04 16:39:49 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-01-04 16:39:49 +0800
commit8d4cdc453a89077d7f5ed7ec96f1dacce4bc4f4d (patch)
tree370e62a43e8beba9517e7480d1d6cbc0cfe9ad15 /script/workspace/workspace.lua
parentd5433249e920969365f7cc16f1fffb6b42383d29 (diff)
downloadlua-language-server-8d4cdc453a89077d7f5ed7ec96f1dacce4bc4f4d.zip
fix
Diffstat (limited to 'script/workspace/workspace.lua')
-rw-r--r--script/workspace/workspace.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua
index 1d20593f..92aca131 100644
--- a/script/workspace/workspace.lua
+++ b/script/workspace/workspace.lua
@@ -138,8 +138,8 @@ end
--- 创建代码库筛选器
---@param scp scope
function m.getLibraryMatchers(scp)
- if scp:get 'nativeMatcher' then
- return scp:get 'nativeMatcher'
+ if scp:get 'libraryMatcher' then
+ return scp:get 'libraryMatcher'
end
local librarys = {}
@@ -169,7 +169,7 @@ function m.getLibraryMatchers(scp)
end
end
- scp:set('nativeMatcher', matchers)
+ scp:set('libraryMatcher', matchers)
return matchers
end
@@ -418,7 +418,11 @@ end
---@async
---@param scp scope
function m.awaitReload(scp)
+ scp:set('ready', false)
+ scp:set('nativeMatcher', nil)
+ scp:set('libraryMatcher', nil)
m.flushFiles(scp)
+ files.flushAllLibrary(scp)
plugin.init(scp)
m.awaitPreload(scp)
scp:set('ready', true)