diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-06-16 20:07:03 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-06-16 20:07:03 +0800 |
commit | b1c58cdb05a906eb7e8c58d19288c5d83191a67b (patch) | |
tree | be5ec377df6dcccd4082fddda068533f6b6fe9e0 | |
parent | 9052464f0175619160d216c0671a77084cf3f046 (diff) | |
download | lua-language-server-b1c58cdb05a906eb7e8c58d19288c5d83191a67b.zip |
fix
-rw-r--r-- | script/core/searcher.lua | 5 | ||||
-rw-r--r-- | test/hover/init.lua | 11 |
2 files changed, 15 insertions, 1 deletions
diff --git a/script/core/searcher.lua b/script/core/searcher.lua index ad51a412..972350fd 100644 --- a/script/core/searcher.lua +++ b/script/core/searcher.lua @@ -641,7 +641,10 @@ end local function getField(status, source, mode) if source.type == 'table' then for _, field in ipairs(source) do - m.pushResult(status, mode, field) + if field.type == 'tablefield' + or field.type == 'tableindex' then + m.pushResult(status, mode, field) + end end return end diff --git a/test/hover/init.lua b/test/hover/init.lua index 2c68fef5..515c3422 100644 --- a/test/hover/init.lua +++ b/test/hover/init.lua @@ -831,6 +831,17 @@ global _G: _G { ]] TEST [[ +local <?t?> = { + 'aaa', + 'bbb', + 'ccc', +} +]] +[[ +local t: {} +]] + +TEST [[ local x x = 1 x = 1.0 |