Skip to content

Commit

Permalink
Use referenced type for inheritance if possible
Browse files Browse the repository at this point in the history
Signed-off-by: Stephan Lachnit <[email protected]>
  • Loading branch information
stephanlachnit committed Feb 12, 2024
1 parent 73668d0 commit 2931487
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/hawkmoth/doccursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,12 @@ def _get_inheritance(self):
if child._cc.kind == CursorKind.CXX_BASE_SPECIFIER:
def pad(s): return s + ' ' if s else ''
access_spec = child._get_access_specifier()
inherited.append(f'{pad(access_spec)}{child._cc.type.spelling}')
if child._cc.referenced.kind == CursorKind.CLASS_DECL:
# use referenced type if possible for full namespace
spelling = child._cc.referenced.type.spelling
else:
spelling = child._cc.type.spelling
inherited.append(f'{pad(access_spec)}{spelling}')

return ': ' + ', '.join(inherited) if len(inherited) > 0 else None

Expand Down

0 comments on commit 2931487

Please sign in to comment.