diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-03-08 18:08:01 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-03-08 18:08:01 +0800 |
commit | 685dbe51d53733ca7b8d3d8c38477aa7e456e013 (patch) | |
tree | 6d7a8914df56c9234d5f6b4cd4b89f57fa178961 | |
parent | 46069db446bd54fc3b3ee5d7e1a80d35ec3240b7 (diff) | |
download | lua-language-server-685dbe51d53733ca7b8d3d8c38477aa7e456e013.zip |
dont await request when preloading
-rw-r--r-- | changelog.md | 1 | ||||
-rw-r--r-- | script/workspace/workspace.lua | 31 |
2 files changed, 17 insertions, 15 deletions
diff --git a/changelog.md b/changelog.md index ee96e079..2a7b44af 100644 --- a/changelog.md +++ b/changelog.md @@ -5,6 +5,7 @@ * `CHG` `Windows`: dose not provide `ucrt` any more * `CHG` `Lua.workspace.library`: use `path[]` instead of `<path, true>` * `FIX` missed syntax error `local a <const>= 1` +* `FIX` workspace: preload blocked when hitting `Lua.workspace.maxPreload` * `FIX` [#443](https://github.com/sumneko/lua-language-server/issues/443) ## 1.17.4 diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua index 231c638e..2934f0ba 100644 --- a/script/workspace/workspace.lua +++ b/script/workspace/workspace.lua @@ -187,7 +187,7 @@ local function loadFileFactory(root, progressData, isLibrary) if not isLibrary and progressData.preload >= config.config.workspace.maxPreload then if not m.hasHitMaxPreload then m.hasHitMaxPreload = true - local item = proto.awaitRequest('window/showMessageRequest', { + proto.request('window/showMessageRequest', { type = define.MessageType.Info, message = lang.script('MWS_MAX_PRELOAD', config.config.workspace.maxPreload), actions = { @@ -198,20 +198,21 @@ local function loadFileFactory(root, progressData, isLibrary) title = lang.script.WINDOW_CLOSE, } } - }) - if not item then - return - end - if item.title == lang.script.WINDOW_INCREASE_UPPER_LIMIT then - proto.notify('$/command', { - command = 'lua.config', - data = { - key = 'Lua.workspace.maxPreload', - action = 'set', - value = config.config.workspace.maxPreload + math.max(1000, config.config.workspace.maxPreload), - } - }) - end + }, function (item) + if not item then + return + end + if item.title == lang.script.WINDOW_INCREASE_UPPER_LIMIT then + proto.notify('$/command', { + command = 'lua.config', + data = { + key = 'Lua.workspace.maxPreload', + action = 'set', + value = config.config.workspace.maxPreload + math.max(1000, config.config.workspace.maxPreload), + } + }) + end + end) end return end |