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 /script/workspace | |
parent | 46069db446bd54fc3b3ee5d7e1a80d35ec3240b7 (diff) | |
download | lua-language-server-685dbe51d53733ca7b8d3d8c38477aa7e456e013.zip |
dont await request when preloading
Diffstat (limited to 'script/workspace')
-rw-r--r-- | script/workspace/workspace.lua | 31 |
1 files changed, 16 insertions, 15 deletions
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 |