From 29314871658728a702edb52d89e2499fb403f211 Mon Sep 17 00:00:00 2001 From: Stephan Lachnit Date: Tue, 26 Dec 2023 11:50:51 +0100 Subject: [PATCH] Use referenced type for inheritance if possible Signed-off-by: Stephan Lachnit --- src/hawkmoth/doccursor.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/hawkmoth/doccursor.py b/src/hawkmoth/doccursor.py index 5315299f..99647c2d 100644 --- a/src/hawkmoth/doccursor.py +++ b/src/hawkmoth/doccursor.py @@ -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