Skip to content

Commit e65bebc

Browse files
committed
#437 plugin blocks first opened file
1 parent b397307 commit e65bebc

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

Diff for: changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# changelog
22

33
## 1.17.4
4+
* `FIX` [#437](https://github.com/sumneko/lua-language-server/issues/437) again
45
* `FIX` [#438](https://github.com/sumneko/lua-language-server/issues/438)
56

67
## 1.17.3

Diff for: script/plugin.lua

+9-5
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ end
4040
function m.init()
4141
local ws = require 'workspace'
4242
m.interface = {}
43+
44+
local _ <close> = function ()
45+
local waiting = m.waitingReady
46+
m.waitingReady = {}
47+
for _, waker in ipairs(waiting) do
48+
waker()
49+
end
50+
end
51+
4352
local pluginPath = fs.path(config.config.runtime.plugin)
4453
if pluginPath:is_relative() then
4554
if not ws.path then
@@ -58,11 +67,6 @@ function m.init()
5867
return
5968
end
6069
xpcall(f, log.error, f)
61-
local waiting = m.waitingReady
62-
m.waitingReady = {}
63-
for _, waker in ipairs(waiting) do
64-
waker()
65-
end
6670
end
6771

6872
return m

Diff for: script/provider/provider.lua

+2
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ proto.on('textDocument/didOpen', function (params)
243243
local doc = params.textDocument
244244
local uri = doc.uri
245245
local text = doc.text
246+
log.debug('didOpen', uri)
246247
files.open(uri)
247248
plugin.awaitReady()
248249
if not files.isOpen(uri) then
@@ -254,6 +255,7 @@ end)
254255
proto.on('textDocument/didClose', function (params)
255256
local doc = params.textDocument
256257
local uri = doc.uri
258+
log.debug('didClose', uri)
257259
files.close(uri)
258260
if not files.isLua(uri) then
259261
files.remove(uri)

0 commit comments

Comments
 (0)