diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-08-18 16:28:14 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-08-18 16:28:14 +0800 |
commit | f8ca20e2227c2d1bbb2b7875c411ad36aab9f83e (patch) | |
tree | 82a201fbdf24db284de76cefd84ba9489fc21367 /script-beta/parser/guide.lua | |
parent | 9a573f53de4a041cca4125b5e54cb27c2f097a9d (diff) | |
download | lua-language-server-f8ca20e2227c2d1bbb2b7875c411ad36aab9f83e.zip |
支持 select 的推断
Diffstat (limited to 'script-beta/parser/guide.lua')
-rw-r--r-- | script-beta/parser/guide.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/script-beta/parser/guide.lua b/script-beta/parser/guide.lua index daa648d6..7a649738 100644 --- a/script-beta/parser/guide.lua +++ b/script-beta/parser/guide.lua @@ -602,6 +602,8 @@ function m.getSimpleName(obj) return m.getKeyName(key) elseif obj.type == 'table' then return ('t|%p'):format(obj) + elseif obj.type == 'select' then + return ('v|%p'):format(obj) end return m.getKeyName(obj) end @@ -893,6 +895,9 @@ local function buildSimpleList(obj, max) or cur.type == 'getglobal' then list[i] = cur break + elseif cur.type == 'select' then + list[i] = cur + break elseif cur.type == 'function' or cur.type == 'main' then break @@ -916,7 +921,8 @@ function m.getSimple(obj, max) or obj.type == 'setlocal' or obj.type == 'setglobal' or obj.type == 'getglobal' - or obj.type == 'tableindex' then + or obj.type == 'tableindex' + or obj.type == 'select' then simpleList = buildSimpleList(obj, max) elseif obj.type == 'field' or obj.type == 'method' then |