Skip to content

Commit

Permalink
Merge pull request #1294 from b4n/gendoc/local
Browse files Browse the repository at this point in the history
Fix handling of locals
  • Loading branch information
frlan authored Apr 14, 2024
2 parents a8f26ab + 3af0bf5 commit 95d4f6f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions geanygendoc/data/filetypes/c.conf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ doctypes = {
struct.prototype.policy = FORWARD;
member.policy = FORWARD;
enumval.policy = FORWARD;
# usually, locals are just not documented and get in the way
local.policy = FORWARD;

function = {
template = "/**\n * {symbol}:\n{for arg in argument_list} * @{arg}: {cursor}\n{end} * \n * {cursor}\n{if returns} * \n * Returns: \n{end}{if write_since}{if returns} * \n{end} * Since: \n{end} */\n";
Expand Down Expand Up @@ -73,6 +75,9 @@ doctypes = {
}

doxygen = {
# usually, locals are just not documented and get in the way
local.policy = FORWARD;

function.template = "/**\n * {doxygen_prefix}brief {cursor}\n{for a in argument_list} * {doxygen_prefix}param {a} \n{end}{if returns} * {doxygen_prefix}returns \n{end}{if write_since} * {doxygen_prefix}since \n{end} * \n * \n */\n";
macro.template = "/**\n * {doxygen_prefix}brief {cursor}\n{for a in argument_list} * {doxygen_prefix}param {a} \n{end}{if returns} * {doxygen_prefix}returns \n{end}{if write_since} * {doxygen_prefix}since \n{end} * \n * \n */\n";
struct.member = {
Expand Down
2 changes: 2 additions & 0 deletions geanygendoc/docs/manual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,8 @@ Known types
A function.
``interface``
An interface.
``local``
A local variable.
``member``
A member (of a structure for example).
``method``
Expand Down
1 change: 1 addition & 0 deletions geanygendoc/src/ggd-tag-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ static const struct {
{ tm_tag_field_t, "field" },
{ tm_tag_function_t, "function" },
{ tm_tag_interface_t, "interface" },
{ tm_tag_local_var_t, "local" },
{ tm_tag_member_t, "member" },
{ tm_tag_method_t, "method" },
{ tm_tag_namespace_t, "namespace" },
Expand Down
2 changes: 1 addition & 1 deletion geanygendoc/src/ggd.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ get_env_for_tag (GgdFileType *ft,
CtplValue *v;
GList *tmp = children;

if (el->type & setting->matches) {
if (type_name && el->type & setting->matches) {
v = g_hash_table_lookup (vars, type_name);
if (! v) {
v = ctpl_value_new_array (CTPL_VTYPE_STRING, 0, NULL);
Expand Down

0 comments on commit 95d4f6f

Please sign in to comment.