summaryrefslogtreecommitdiff
path: root/script-beta/vm/getClass.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-10-27 10:36:32 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-10-27 10:36:32 +0800
commit10ed5c9e5946b36b7d75afb3855afa0cacc42543 (patch)
treee50a4ce88368f1dc5b4febe215a12dd3c01df966 /script-beta/vm/getClass.lua
parent95a6fd7121fab859249ac015f7bfa1e0fbb09e8e (diff)
downloadlua-language-server-10ed5c9e5946b36b7d75afb3855afa0cacc42543.zip
更新
Diffstat (limited to 'script-beta/vm/getClass.lua')
-rw-r--r--script-beta/vm/getClass.lua12
1 files changed, 5 insertions, 7 deletions
diff --git a/script-beta/vm/getClass.lua b/script-beta/vm/getClass.lua
index 0d6980a2..ec86e0cf 100644
--- a/script-beta/vm/getClass.lua
+++ b/script-beta/vm/getClass.lua
@@ -2,13 +2,11 @@ local vm = require 'vm.vm'
local guide = require 'parser.guide'
local function lookUpDocClass(source)
- local docs = source.bindDocs
- if not docs then
- return
- end
- for _, doc in ipairs(docs) do
- if doc.type == 'doc.class' then
- return guide.getName(doc)
+ local infers = vm.getInfers(source)
+ for _, infer in ipairs(infers) do
+ if infer.source.type == 'doc.class'
+ or infer.source.type == 'doc.type' then
+ return infer.type
end
end
end