diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-03-04 15:40:10 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-03-04 15:40:10 +0800 |
commit | e65bebccf61f04a057be3c632d22fc642dbdb674 (patch) | |
tree | b8f4de2d8d7b8cff1fe53e258503ebc9b9919150 /script/plugin.lua | |
parent | b3973077759549aaedecc02d2443bdfdf029b329 (diff) | |
download | lua-language-server-e65bebccf61f04a057be3c632d22fc642dbdb674.zip |
#437 plugin blocks first opened file
Diffstat (limited to 'script/plugin.lua')
-rw-r--r-- | script/plugin.lua | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/script/plugin.lua b/script/plugin.lua index 40f7c21d..369afd66 100644 --- a/script/plugin.lua +++ b/script/plugin.lua @@ -40,6 +40,15 @@ end function m.init() local ws = require 'workspace' m.interface = {} + + local _ <close> = function () + local waiting = m.waitingReady + m.waitingReady = {} + for _, waker in ipairs(waiting) do + waker() + end + end + local pluginPath = fs.path(config.config.runtime.plugin) if pluginPath:is_relative() then if not ws.path then @@ -58,11 +67,6 @@ function m.init() return end xpcall(f, log.error, f) - local waiting = m.waitingReady - m.waitingReady = {} - for _, waker in ipairs(waiting) do - waker() - end end return m |