Skip to content

Commit

Permalink
Do not rely on parent_basic_decl to find stub completion.
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
Roldak committed Jul 10, 2024
1 parent 9574683 commit caaf2e7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ada/nodes.lkt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
}
Expand Down

0 comments on commit caaf2e7

Please sign in to comment.