diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-11-17 15:44:43 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-11-17 15:44:43 +0800 |
commit | 54a97c8ebd12bee141eb5d0d0a3b92f9d411d0d5 (patch) | |
tree | ce37b2ee5583a576cf679f098003457aa726221d /script-beta | |
parent | 8ddc5f60a24adb1ef8ac578965190a3e23e180c3 (diff) | |
download | lua-language-server-54a97c8ebd12bee141eb5d0d0a3b92f9d411d0d5.zip |
lookup 要 deep
Diffstat (limited to 'script-beta')
-rw-r--r-- | script-beta/parser/guide.lua | 25 | ||||
-rw-r--r-- | script-beta/vm/getClass.lua | 2 |
2 files changed, 15 insertions, 12 deletions
diff --git a/script-beta/parser/guide.lua b/script-beta/parser/guide.lua index 9939dce6..8324cfd0 100644 --- a/script-beta/parser/guide.lua +++ b/script-beta/parser/guide.lua @@ -2575,11 +2575,12 @@ function m.viewInferType(infers) local hasDoc for i = 1, #infers do local infer = infers[i] - if infer.source.type == 'doc.class' - or infer.source.type == 'doc.class.name' - or infer.source.type == 'doc.type.name' - or infer.source.type == 'doc.type.array' - or infer.source.type == 'doc.type.generic' then + local src = infer.source + if src.type == 'doc.class' + or src.type == 'doc.class.name' + or src.type == 'doc.type.name' + or src.type == 'doc.type.array' + or src.type == 'doc.type.generic' then if infer.type ~= 'any' then hasDoc = true break @@ -2589,12 +2590,14 @@ function m.viewInferType(infers) if hasDoc then for i = 1, #infers do local infer = infers[i] - if infer.source.type == 'doc.class' - or infer.source.type == 'doc.class.name' - or infer.source.type == 'doc.type.name' - or infer.source.type == 'doc.type.array' - or infer.source.type == 'doc.type.generic' - or infer.source.type == 'doc.type.enum' then + local src = infer.source + if src.type == 'doc.class' + or src.type == 'doc.class.name' + or src.type == 'doc.type.name' + or src.type == 'doc.type.array' + or src.type == 'doc.type.generic' + or src.type == 'doc.type.enum' + or src.type == 'doc.resume' then local tp = infer.type or 'any' if not mark[tp] then types[#types+1] = tp diff --git a/script-beta/vm/getClass.lua b/script-beta/vm/getClass.lua index bd7f6f7c..1623090c 100644 --- a/script-beta/vm/getClass.lua +++ b/script-beta/vm/getClass.lua @@ -2,7 +2,7 @@ local vm = require 'vm.vm' local guide = require 'parser.guide' local function lookUpDocClass(source) - local infers = vm.getInfers(source) + local infers = vm.getInfers(source, 'deep') for _, infer in ipairs(infers) do if infer.source.type == 'doc.class' or infer.source.type == 'doc.type' then |