Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
08011-Add-hidden-functions-to-chunks.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 08011-Add-hidden-functions-to-chunks.patch of Package erlang
From 087a816245ac052791a7cad5ff8bdb8599da0fa4 Mon Sep 17 00:00:00 2001 From: Lukas Larsson <lukas@erlang.org> Date: Mon, 27 Nov 2023 11:24:42 +0100 Subject: [PATCH] Add hidden functions to chunks --- lib/erl_docgen/src/docgen_xml_to_chunk.erl | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/lib/erl_docgen/src/docgen_xml_to_chunk.erl b/lib/erl_docgen/src/docgen_xml_to_chunk.erl index 32c500453b..348dd46b33 100644 --- a/lib/erl_docgen/src/docgen_xml_to_chunk.erl +++ b/lib/erl_docgen/src/docgen_xml_to_chunk.erl @@ -35,7 +35,7 @@ main([_Application, FromBeam, _Escript, ToChunk]) -> Anno = erl_anno:set_file(Name, erl_anno:new(0)), - EmptyDocs = add_hidden_docs( + EmptyDocs = add_hidden_functions( Exports, #docs_v1{ anno = Anno, module_doc = hidden, @@ -284,10 +284,11 @@ docs(Application, OTPXml, FromBEAM)-> put(application, Application), put(module, filename:basename(filename:rootname(FromBEAM))), NewDom = transform(Dom, []), - Chunk = add_hidden_docs( - proplists:get_value(exports, Chunks), - to_chunk(NewDom, OTPXml, Module, - proplists:get_value(abstract_code, Chunks))), + Chunk = add_hidden_types( + add_hidden_functions( + proplists:get_value(exports, Chunks), + to_chunk(NewDom, OTPXml, Module, + proplists:get_value(abstract_code, Chunks)))), verify_chunk(Module, proplists:get_value(exports, Chunks), Chunk), Chunk; _Else -> @@ -299,7 +300,7 @@ docs(Application, OTPXml, FromBEAM)-> %% Create hidden function entries for any exported functions that %% does not have any documentation. -add_hidden_docs(Exports, #docs_v1{ anno = Anno, docs = Docs } = Chunk) -> +add_hidden_functions(Exports, #docs_v1{ anno = Anno, docs = Docs } = Chunk) -> HiddenFuncs = [{{function, F, A}, Anno, [iolist_to_binary(io_lib:format("~p/~p", [F, A]))], @@ -307,6 +308,18 @@ add_hidden_docs(Exports, #docs_v1{ anno = Anno, docs = Docs } = Chunk) -> lists:keysearch({function, F, A}, 1, Docs) == false ], Chunk#docs_v1{ docs = HiddenFuncs ++ Docs }. +add_hidden_types(#docs_v1{ anno = Anno, docs = Docs, metadata = Meta } = Chunk) -> + Types = maps:get(types, Meta, []), + HiddenTypes = + lists:filtermap(fun(#{{F, A} := _}) -> + not lists:keyember({type, F, A}, 1, Docs) andalso + {true, + {{type, F, A}, Anno, [list_to_binary(io_lib:format("-type ~p/~p", [F, A]))], + hidden, #{}}} + (_) -> false + end, Types), + Chunk#docs_v1{ docs = HiddenTypes ++ Docs }. + verify_chunk(M, Exports, #docs_v1{ docs = Docs } = Doc) -> %% Make sure that each documented function actually is exported -- 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