summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelog.md1
-rw-r--r--script/workspace/workspace.lua31
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