@@ -44,29 +44,28 @@ impl DefaultElement {
4444 let mut entity = entity;
4545 let mut parts = vec ! [ ] ;
4646 while let Some ( parent) = entity. get_semantic_parent ( ) {
47- match parent. get_kind ( ) {
47+ let is_namespace_element = match parent. get_kind ( ) {
48+ EntityKind :: Namespace => !parent. is_inline_namespace ( ) ,
4849 EntityKind :: ClassDecl
49- | EntityKind :: Namespace
5050 | EntityKind :: StructDecl
5151 | EntityKind :: EnumDecl
5252 | EntityKind :: UnionDecl
5353 | EntityKind :: ClassTemplate
5454 | EntityKind :: ClassTemplatePartialSpecialization
5555 | EntityKind :: FunctionTemplate
5656 | EntityKind :: Method
57- | EntityKind :: FunctionDecl => {
58- // handle anonymous enums inside classes and anonymous namespaces
59- if let Some ( parent_name) = parent. get_name ( ) {
60- parts. push ( parent_name) ;
61- }
62- }
57+ | EntityKind :: FunctionDecl => true ,
6358 EntityKind :: TranslationUnit
6459 | EntityKind :: UnexposedDecl
6560 | EntityKind :: LinkageSpec
6661 | EntityKind :: NotImplemented
67- | EntityKind :: Constructor => { }
68- _ => {
69- unreachable ! ( "Can't get kind of parent for cpp namespace: {:#?}" , parent)
62+ | EntityKind :: Constructor => false ,
63+ _ => unreachable ! ( "Can't get kind of parent for cpp namespace: {:#?}" , parent) ,
64+ } ;
65+ if is_namespace_element {
66+ // handle anonymous enums inside classes and anonymous namespaces
67+ if let Some ( parent_name) = parent. get_name ( ) {
68+ parts. push ( parent_name) ;
7069 }
7170 }
7271 entity = parent;
0 commit comments