Skip to content

Commit

Permalink
special handling builtin types
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Feb 20, 2021
1 parent 4beee0e commit 28f066e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions script/parser/guide.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,20 @@ local function stepRefOfDocType(status, obj, mode)
if not name or not status.interface.docType then
return results
end
if name == 'nil'
or name == 'any'
or name == 'boolean'
or name == 'string'
or name == 'table'
or name == 'number'
or name == 'integer'
or name == 'function'
or name == 'table'
or name == 'thread'
or name == 'userdata'
or name == 'lightuserdata' then
mode = 'def'
end
local docs = status.interface.docType(name)
for i = 1, #docs do
local doc = docs[i]
Expand Down
2 changes: 1 addition & 1 deletion test/references/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ local <?x?>

-- BUG
TEST [[
---@return <?string?>
---@return <?xxx?>
function f() end
]]

Expand Down

0 comments on commit 28f066e

Please sign in to comment.