diff options
author | Jakob Lykke Andersen <Jakob@caput.dk> | 2021-01-11 10:16:06 +0300 |
---|---|---|
committer | Jakob Lykke Andersen <Jakob@caput.dk> | 2021-01-11 22:51:36 +0300 |
commit | 750e6ec431f88e80163efaf1aae3eaef8c070008 (patch) | |
tree | 908e3f19518118581c50decf1f8d33476a152a82 /sphinx/domains | |
parent | b372a99c0158f5799338a9a1b8611626ff1d114f (diff) |
C, fix object types for xrefs
Add 'identifer' to all and 'type' to types.
Fixes sphinx-doc/sphinx#8341
Diffstat (limited to 'sphinx/domains')
-rw-r--r-- | sphinx/domains/c.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/sphinx/domains/c.py b/sphinx/domains/c.py index fb4da502d..064318e08 100644 --- a/sphinx/domains/c.py +++ b/sphinx/domains/c.py @@ -3657,15 +3657,18 @@ class CDomain(Domain): name = 'c' label = 'C' object_types = { - 'function': ObjType(_('function'), 'func'), - 'member': ObjType(_('member'), 'member'), - 'macro': ObjType(_('macro'), 'macro'), - 'type': ObjType(_('type'), 'type'), - 'var': ObjType(_('variable'), 'data'), - 'enum': ObjType(_('enum'), 'enum'), - 'enumerator': ObjType(_('enumerator'), 'enumerator'), - 'struct': ObjType(_('struct'), 'struct'), - 'union': ObjType(_('union'), 'union'), + # 'identifier' is the one used for xrefs generated in signatures, not in roles + 'member': ObjType(_('member'), 'var', 'member', 'data', 'identifier'), + 'var': ObjType(_('variable'), 'var', 'member', 'data', 'identifier'), + 'function': ObjType(_('function'), 'func', 'identifier', 'type'), + 'macro': ObjType(_('macro'), 'macro', 'identifier'), + 'struct': ObjType(_('struct'), 'struct', 'identifier', 'type'), + 'union': ObjType(_('union'), 'union', 'identifier', 'type'), + 'enum': ObjType(_('enum'), 'enum', 'identifier', 'type'), + 'enumerator': ObjType(_('enumerator'), 'enumerator', 'identifier'), + 'type': ObjType(_('type'), 'identifier', 'type'), + # generated object types + 'functionParam': ObjType(_('function parameter'), 'identifier', 'var', 'member', 'data'), # noqa } directives = { |