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:
parent
0857a8fef8
commit
d699968475
|
@ -265,6 +265,15 @@ local display_type = {
|
||||||
deprecatedproperty = true,
|
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)
|
custom_display_name_handler = function(item, default_handler)
|
||||||
local ret = default_handler(item)
|
local ret = default_handler(item)
|
||||||
|
|
||||||
|
@ -274,6 +283,12 @@ custom_display_name_handler = function(item, default_handler)
|
||||||
item.sanitize_type = sanitize_type
|
item.sanitize_type = sanitize_type
|
||||||
end
|
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
|
-- Remove the "namespace" from the signals and properties
|
||||||
if no_prefix[item.type] then
|
if no_prefix[item.type] then
|
||||||
local name = item.name:match("%.([^.]+)$")
|
local name = item.name:match("%.([^.]+)$")
|
||||||
|
|
Loading…
Reference in New Issue