<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi,</p>
<p>I need to (ab)use the including of header files in order to
define a fixed set of (accessor-like) functions that shall be
available from within a group of modules, so that these functions
can be used in such modules directly (locally, i.e. without adding
any module prefix when calling them from these modules).</p>
<p>The code works great but I would like the @doc documentation of
these functions to appear in the generated API and, more
importantly, through the Erlang Language Server [<a class="moz-txt-link-freetext" href="https://erlang-ls.github.io/">https://erlang-ls.github.io/</a>],
which would be very useful when editing these modules.</p>
<p>edoc detects these functions and generates HTML entries for them
(iff adding the {preprocess, true} option), but I never managed to
have their @doc comments show up there; and the LS server does not
seem to take them into account either.</p>
<p>Following minimal test with OTP 24 was done:</p>
<p>* in mytest.erl:</p>
<p><font face="Courier New, Courier, monospace">%% @doc Simple test.<br>
-module(mytest).<br>
<br>
-export([f/0, foobar/0]).<br>
<br>
-include("mytest.hrl").</font><br>
<br>
<font face="Courier New, Courier, monospace">%% @doc Doc for f.<br>
f() -><br>
ok.<br>
</font></p>
<p>* in mytest.hrl:</p>
<p><font face="Courier New, Courier, monospace">%% @doc Doc for
foobar.<br>
foobar() -><br>
ok.</font><br>
</p>
<p>* command line to generate HTML: <font face="Courier New,
Courier, monospace">erl -noshell -run edoc_run file
'"mytest.erl"' '[{dir,"."},{preprocess, true}]'</font><br>
</p>
<p>No amount of: <font face="Courier New, Courier, monospace">%%
@headerfile "mytest.hrl" </font>seems to be of help either:
that header file is parsed, foobar/0 is listed in the HTML but its
@doc is lacking.</p>
<p>Is there a way to have at least the LS server be aware of these
@doc tags?</p>
<p>Thanks in advance for any hint!</p>
<p>Best regards,</p>
<p>Olivier.<br>
</p>
<br>
<pre class="moz-signature" cols="72">--
Olivier Boudeville
</pre>
</body>
</html>