Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
0773-docgen-Fix-signature-for-types.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0773-docgen-Fix-signature-for-types.patch of Package erlang
From 81b6d1e49bc1448789b7f95f1f28f49e3c2b3375 Mon Sep 17 00:00:00 2001 From: Lukas Larsson <lukas@erlang.org> Date: Fri, 29 Apr 2022 16:13:57 +0200 Subject: [PATCH] docgen: Fix signature for types If a type does not use the typespec notation in docs we should not include the AST signature in the chunks, otherwise the incorrect docs will be printed by shell_docs. --- lib/erl_docgen/src/docgen_xml_to_chunk.erl | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/lib/erl_docgen/src/docgen_xml_to_chunk.erl b/lib/erl_docgen/src/docgen_xml_to_chunk.erl index 0bdd197db9..8f433a80d9 100644 --- a/lib/erl_docgen/src/docgen_xml_to_chunk.erl +++ b/lib/erl_docgen/src/docgen_xml_to_chunk.erl @@ -712,15 +712,22 @@ to_chunk(Dom, Source, Module, AST) -> list_to_integer(Arity) end, TypeArgs = lists:join(",",[lists:concat(["Arg",I]) || I <- lists:seq(1,TypeArity)]), - PlaceholderSig = io_lib:format("-type ~p(~s) :: term().",[TypeName,TypeArgs]), - TypeSignature = proplists:get_value( - signature,Attr,[iolist_to_binary(PlaceholderSig)]), - MetaSig = - case maps:get({TypeName, TypeArity}, TypeMap, undefined) of + {TypeSignature, MetaSig} = + case proplists:get_value(signature,Attr) of undefined -> - #{}; - Sig -> - #{ signature => [Sig] } + PlaceholderSig = + iolist_to_binary( + io_lib:format("-type ~p(~s) :: term().", + [TypeName,TypeArgs])), + {[PlaceholderSig], + case maps:get({TypeName, TypeArity}, TypeMap, undefined) of + undefined -> + #{}; + Sig -> + #{ signature => [Sig] } + end}; + Signature -> + {Signature, #{}} end, MetaDepr -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor