summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/parser/guide.lua5
-rw-r--r--script/vm/guideInterface.lua16
-rw-r--r--test/references/init.lua6
3 files changed, 9 insertions, 18 deletions
diff --git a/script/parser/guide.lua b/script/parser/guide.lua
index 71be1a27..0ee5fb21 100644
--- a/script/parser/guide.lua
+++ b/script/parser/guide.lua
@@ -1565,8 +1565,9 @@ function m.checkSameSimpleByDoc(status, obj, start, queue, mode)
force = true,
}
end
- if mode == 'ref' then
- m.checkSameSimpleOfRefByDocSource(status, m.getDocState(obj), start, queue, mode)
+ local state = m.getDocState(obj)
+ if state.type == 'doc.type' and mode == 'ref' then
+ m.checkSameSimpleOfRefByDocSource(status, state, start, queue, mode)
end
return true
elseif obj.type == 'doc.field' then
diff --git a/script/vm/guideInterface.lua b/script/vm/guideInterface.lua
index eb809c30..e646def8 100644
--- a/script/vm/guideInterface.lua
+++ b/script/vm/guideInterface.lua
@@ -82,23 +82,7 @@ function vm.interface.global(name)
return vm.getGlobals(name)
end
-local basicTypes = {
- ['any'] = true,
- ['nil'] = true,
- ['boolean'] = true,
- ['number'] = true,
- ['integer'] = true,
- ['thread'] = true,
- ['table'] = true,
- ['string'] = true,
- ['userdata'] = true,
- ['lightuserdata'] = true,
- ['function'] = true,
-}
function vm.interface.docType(name)
- if basicTypes[name] then
- return vm.getDocClass(name)
- end
await.delay()
return vm.getDocTypes(name)
end
diff --git a/test/references/init.lua b/test/references/init.lua
index 835a0764..4673d2f8 100644
--- a/test/references/init.lua
+++ b/test/references/init.lua
@@ -296,3 +296,9 @@ local <!t!>
---@type Class
local <?x?>
]]
+
+-- BUG
+TEST [[
+---@return <?any?>
+function f() end
+]]