summaryrefslogtreecommitdiff
path: root/script-beta/core/completion.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-08-15 18:57:58 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-08-15 18:57:58 +0800
commit674892abc53ad6752326135c8aaf60073f80b632 (patch)
treec9376e1f76975834ad49f785f7f31b33e7661059 /script-beta/core/completion.lua
parent67eae45b182fc8a7302970d71af4e76eafab0a2e (diff)
downloadlua-language-server-674892abc53ad6752326135c8aaf60073f80b632.zip
先保证自动完成的速度
Diffstat (limited to 'script-beta/core/completion.lua')
-rw-r--r--script-beta/core/completion.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/script-beta/core/completion.lua b/script-beta/core/completion.lua
index ba4119fb..5f7e153e 100644
--- a/script-beta/core/completion.lua
+++ b/script-beta/core/completion.lua
@@ -13,6 +13,7 @@ local config = require 'config'
local util = require 'utility'
local markdown = require 'provider.markdown'
local findSource = require 'core.find-source'
+local await = require 'await'
local stackID = 0
local stacks = {}
@@ -234,8 +235,8 @@ local function checkFieldThen(src, used, word, start, parent, oop, results)
if used[name] then
return
end
+ used[name] = true
if not matchKey(word, name) then
- used[name] = true
return
end
local kind = ckind.Field
@@ -245,7 +246,6 @@ local function checkFieldThen(src, used, word, start, parent, oop, results)
else
kind = ckind.Function
end
- used[name] = true
buildFunction(results, src, oop, {
label = name,
kind = kind,
@@ -260,7 +260,6 @@ local function checkFieldThen(src, used, word, start, parent, oop, results)
if oop then
return
end
- used[name] = true
local literal = vm.getLiteral(src)
if literal ~= nil then
kind = ckind.Enum