diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-11-01 16:19:35 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-11-01 16:19:35 +0800 |
commit | 8baabad5f744f1a5a64a927218b66e16313377ba (patch) | |
tree | 360d8c4e8efe0c77150d5880eeaec9316a6c0edf /script/core/completion.lua | |
parent | 1cd09f757c47a682c493a2993b18fb9605396f85 (diff) | |
download | lua-language-server-8baabad5f744f1a5a64a927218b66e16313377ba.zip |
enable yield in completion
Diffstat (limited to 'script/core/completion.lua')
-rw-r--r-- | script/core/completion.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/script/core/completion.lua b/script/core/completion.lua index 8b31614d..d1224934 100644 --- a/script/core/completion.lua +++ b/script/core/completion.lua @@ -20,6 +20,7 @@ local lookBackward = require 'core.look-backward' local guide = require 'parser.guide' local infer = require 'core.infer' local noder = require 'core.noder' +local await = require 'await' local DiagnosticModes = { 'disable-next-line', @@ -571,6 +572,7 @@ local function checkFieldOfRefs(refs, state, word, startPos, position, parent, o for name, src in util.sortPairs(fields) do if src then checkFieldThen(name, src, word, startPos, position, parent, oop, results) + await.delay() end end end @@ -2065,12 +2067,14 @@ local function completion(uri, position, triggerCharacter) if results then return results end + await.delay() tracy.ZoneBeginN 'completion #1' local state = files.getState(uri) local text = files.getText(uri) results = {} clearStack() tracy.ZoneEnd() + await.delay() tracy.ZoneBeginN 'completion #2' if state then if getComment(state, position) then |