doc: Fix the "Returns" section for @staticfct. (#2801)

It wasn't displayed. Another hack based on undocumented APIs, but
whatever, ldoc is dead.
This commit is contained in:
Emmanuel Lepage Vallée 2019-06-22 18:00:40 -04:00 committed by GitHub
parent 0857a8fef8
commit d699968475
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 0 deletions

View File

@ -265,6 +265,15 @@ local display_type = {
deprecatedproperty = true,
}
-- Show return values.
local show_return = {
["function"] = true,
constructorfct = true,
staticfct = true,
method = true,
deprecated = true,
}
custom_display_name_handler = function(item, default_handler)
local ret = default_handler(item)
@ -274,6 +283,12 @@ custom_display_name_handler = function(item, default_handler)
item.sanitize_type = sanitize_type
end
-- LDoc hardcode the "Returns" section for "function" only, fix that.
if show_return[item.type] and item.tags["return"] then
item.ret = item.tags["return"]
item:build_return_groups()
end
-- Remove the "namespace" from the signals and properties
if no_prefix[item.type] then
local name = item.name:match("%.([^.]+)$")