Skip to content

Commit 993b4c3

Browse files
committed
fix toc_object_entries_show_parents = 'all' with global consts
1 parent 991e3f1 commit 993b4c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sphinxcontrib/phpdomain.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ def _toc_entry_name(self, sig_node: addnodes.desc_signature) -> str:
282282
if config.toc_object_entries_show_parents == 'hide':
283283
return name + parens
284284
if config.toc_object_entries_show_parents == 'all':
285-
if objtype in {'method', 'const', 'attr', 'staticmethod', 'case'}:
285+
if objtype in {'method', 'const', 'attr', 'staticmethod', 'case'} and len(parents) > 0:
286286
name = parents.pop() + '::' + name
287287
return '\\'.join(parents + [name + parens])
288288
return ''

0 commit comments

Comments
 (0)