diff --git a/ada/ast.py b/ada/ast.py index 2ad37ebec..02c61b419 100644 --- a/ada/ast.py +++ b/ada/ast.py @@ -362,10 +362,16 @@ def complete(): return origin.bind( Self.origin_node, Entity.complete_items.filter( - # This property filters out `SyntheticSubpDecl` items - # because they are of no use for completion. Additional - # filtering can be done in `complete_items`. - lambda n: n.decl.cast(T.SyntheticSubpDecl).is_null + # This property filters out `SyntheticSubpDecl` and + # `SyntheticObjectDecl` items because they are of no use for + # completion. This is not entirely true for + # `SyntheticObjectDecl` since they can be useful in type + # predicate aspects (yet not implemented since no likely + # helpful). Additional filtering can be done in + # `complete_items`. + lambda n: Not( + n.decl.is_a(T.SyntheticSubpDecl, T.SyntheticObjectDecl) + ) ).to_iterator ) diff --git a/testsuite/tests/properties/complete/test.out b/testsuite/tests/properties/complete/test.out index 3ae2f594d..a3df2976f 100644 --- a/testsuite/tests/properties/complete/test.out +++ b/testsuite/tests/properties/complete/test.out @@ -316,8 +316,7 @@ Working on node ================================================================ Eval 'list(node.f_subtype.f_constraint.p_complete)' -Result: [ is_dot_call=False is_visible=True weight=0>, - is_dot_call=False is_visible=True weight=0>, +Result: [ is_dot_call=False is_visible=True weight=0>, is_dot_call=False is_visible=True weight=0>, is_dot_call=False is_visible=True weight=100>, is_dot_call=False is_visible=True weight=100>, @@ -688,8 +687,7 @@ Working on node =========================================================== Eval 'list(node.p_complete)' -Result: [ is_dot_call=False is_visible=True weight=0>, - is_dot_call=False is_visible=True weight=0>, +Result: [ is_dot_call=False is_visible=True weight=0>, is_dot_call=False is_visible=True weight=0>, is_dot_call=False is_visible=True weight=0>, is_dot_call=False is_visible=True weight=100>, @@ -1016,7 +1014,6 @@ Working on node Eval 'list(node.f_component_def.f_type_expr.f_name.p_complete)' Result: [ is_dot_call=False is_visible=True weight=0>, - is_dot_call=False is_visible=True weight=0>, is_dot_call=False is_visible=True weight=0>, is_dot_call=False is_visible=True weight=0>, is_dot_call=False is_visible=True weight=100>, @@ -1083,7 +1080,6 @@ Working on node Eval 'list(node.f_discriminants.f_discr_specs[0].f_type_expr.f_name.p_complete)' Result: [ is_dot_call=False is_visible=True weight=0>, - is_dot_call=False is_visible=True weight=0>, is_dot_call=False is_visible=True weight=0>, is_dot_call=False is_visible=True weight=0>, is_dot_call=False is_visible=True weight=100>, @@ -1149,12 +1145,10 @@ Working on node ======================================================= Eval 'list(node.p_complete)' -Result: [ is_dot_call=False is_visible=True weight=0>, - is_dot_call=True is_visible=True weight=75>, +Result: [ is_dot_call=True is_visible=True weight=75>, is_dot_call=True is_visible=True weight=75>, is_dot_call=True is_visible=True weight=75>, is_dot_call=True is_visible=True weight=75>, - is_dot_call=False is_visible=True weight=0>, is_dot_call=True is_visible=True weight=75>] Working on node @@ -1182,10 +1176,8 @@ Working on node ================================================= Eval 'list(node.f_call.p_complete)' -Result: [ is_dot_call=False is_visible=True weight=0>, - is_dot_call=True is_visible=True weight=75>, +Result: [ is_dot_call=True is_visible=True weight=75>, is_dot_call=True is_visible=True weight=75>, is_dot_call=True is_visible=True weight=75>, is_dot_call=True is_visible=True weight=75>, - is_dot_call=False is_visible=False weight=0>, is_dot_call=True is_visible=True weight=75>]