From caaf2e7071417d118e630e74b62c31863f552950 Mon Sep 17 00:00:00 2001 From: Romain Beguet Date: Tue, 9 Jul 2024 15:24:13 +0200 Subject: [PATCH] Do not rely on parent_basic_decl to find stub completion. As rebindings should never be taken into account. Use syntactic_fully_qualified_name instead, which was written for this (not sure why it was not used so far). --- ada/nodes.lkt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ada/nodes.lkt b/ada/nodes.lkt index bc4c52338..506392cf9 100644 --- a/ada/nodes.lkt +++ b/ada/nodes.lkt @@ -8232,7 +8232,9 @@ class SubpRenamingDecl: BaseSubpBody { class BodyStub: Body { @with_dynvars(imprecise_fallback=false) fun next_part_for_decl(): Entity[BasicDecl] = node.get_unit_root_decl( - self.fully_qualified_name_array(), AnalysisUnitKind.unit_body, process_parents=false + self.syntactic_fully_qualified_name(), + AnalysisUnitKind.unit_body, + process_parents=false ).as_entity |" Return the syntactic fully qualified name to refer to this body. @@ -8259,7 +8261,11 @@ class BodyStub: Body { case b: TaskBody => b case _ => raise[Body] PropertyError("invalid body stub") }; - val cu = if top_body.parent is LibraryItem or top_body.parent is Subunit then top_body.parent.parent.as[CompilationUnit] else raise[CompilationUnit] PropertyError("invalid body stub"); + + val cu = if top_body.parent is LibraryItem | Subunit then + top_body.parent.parent.as[CompilationUnit] + else + raise[CompilationUnit] PropertyError("invalid body stub"); cu.syntactic_fully_qualified_name() & rel_name }