diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-12-09 21:19:25 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-12-09 21:19:25 +0800 |
commit | 329fffd8d658d2fdbf8484824cdd32fd4b3e186c (patch) | |
tree | 7ecb79d0f93d4918abbd1760c67487b2fe715b61 /script-beta/core | |
parent | 21214e6da8480c455df57ce9524cc73f0bf5ff13 (diff) | |
download | lua-language-server-329fffd8d658d2fdbf8484824cdd32fd4b3e186c.zip |
修正一些问题
Diffstat (limited to 'script-beta/core')
-rw-r--r-- | script-beta/core/completion.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/script-beta/core/completion.lua b/script-beta/core/completion.lua index 0532f1be..35e4e21f 100644 --- a/script-beta/core/completion.lua +++ b/script-beta/core/completion.lua @@ -85,18 +85,20 @@ local function checkField(ast, text, word, offset, results) return end end + local used = {} vm.eachField(parent, function (info) local key = info.key if key and key:sub(1, 1) == 's' and info.source.finish ~= offset then local name = key:sub(3) - if matchKey(word, name) then + if not used[name] and matchKey(word, name) then results[#results+1] = { label = name, kind = ckind.Field, } end + used[name] = true end end) end |