diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-08-18 16:19:06 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-08-18 16:19:06 +0800 |
commit | 69c0e4c50101ee29ac1459897495d4c1219bb8c8 (patch) | |
tree | a5d3ff6877e9aa5d86b27b10cb0451e8c46c50ac /script/workspace/workspace.lua | |
parent | aa8982b66537e59822d4717f446de3e5dd83e72b (diff) | |
download | lua-language-server-69c0e4c50101ee29ac1459897495d4c1219bb8c8.zip |
cleanup
Diffstat (limited to 'script/workspace/workspace.lua')
-rw-r--r-- | script/workspace/workspace.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua index 73b6138d..b79a678b 100644 --- a/script/workspace/workspace.lua +++ b/script/workspace/workspace.lua @@ -25,6 +25,7 @@ m.fileFound = 0 m.waitingReady = {} m.requireCache = {} m.cache = {} +m.watchers = {} m.matchOption = { ignoreCase = platform.OS == 'Windows', } @@ -297,6 +298,10 @@ function m.awaitPreload() m.fileLoaded = 0 m.fileFound = 0 m.cache = {} + for i, watchers in ipairs(m.watchers) do + watchers() + m.watchers[i] = nil + end local progressBar <close> = progress.create(lang.script.WORKSPACE_LOADING) local progressData = { max = 0, @@ -322,6 +327,7 @@ function m.awaitPreload() local libraryLoader = loadFileFactory(library.path, progressData, true) log.info('Scan library at:', library.path) library.matcher:scan(library.path, libraryLoader) + m.watchers[#m.watchers+1] = client.watchFiles(library.path) end local isLoadingFiles = false |