diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-12-13 10:40:37 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-12-13 10:40:37 +0800 |
commit | 9db050598e3df70063fb697dbe19cdb90295c1e1 (patch) | |
tree | 3663bf2bae37ae83a70831bb9181e785a77c6de1 /script-beta | |
parent | de103324e510e4d8e7964064d32708273cbf2e4a (diff) | |
download | lua-language-server-9db050598e3df70063fb697dbe19cdb90295c1e1.zip |
修正 tablefield 会重复显示的bug
Diffstat (limited to 'script-beta')
-rw-r--r-- | script-beta/core/completion.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/script-beta/core/completion.lua b/script-beta/core/completion.lua index b69e19a6..f14ec495 100644 --- a/script-beta/core/completion.lua +++ b/script-beta/core/completion.lua @@ -285,10 +285,13 @@ local function checkTableField(ast, word, start, results) if not source then return end + local used = {} guide.eachSourceType(ast.ast, 'tablefield', function (src) local key = src.field[1] - if matchKey(word, key) + if not used[key] + and matchKey(word, key) and src ~= source then + used[key] = true results[#results+1] = { label = key, kind = ckind.Property, |