From d699968475417849b77497056a207d14c90dba1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Lepage=20Vall=C3=A9e?= Date: Sat, 22 Jun 2019 18:00:40 -0400 Subject: [PATCH] doc: Fix the "Returns" section for @staticfct. (#2801) It wasn't displayed. Another hack based on undocumented APIs, but whatever, ldoc is dead. --- docs/config.ld | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/config.ld b/docs/config.ld index 854a223e9..ca66ae967 100644 --- a/docs/config.ld +++ b/docs/config.ld @@ -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("%.([^.]+)$")