Skip to content

Commit

Permalink
Fix navigation on top-level generic subp instantiation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Roldak committed Apr 5, 2023
1 parent d1bd8d8 commit f41519e
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ada/ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -3179,7 +3179,7 @@ def basic_decl_next_part_for_decl():
b.is_a(
T.BasePackageDecl,
T.GenericPackageDecl,
T.GenericPackageInstantiation,
T.GenericInstantiation,
T.PackageRenamingDecl,
T.SubpRenamingDecl,
T.GenericRenamingDecl
Expand Down
8 changes: 8 additions & 0 deletions testsuite/tests/navigation/subp_inst_next_part/subp.ads
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
with Subp_G;

-- The result should be 'None' but should not raise an error saying
-- that file 'Subp.adb' is not found, since we don't expect to have a body
-- for this unit.

procedure Subp is new Subp_G;
--% node.p_next_part_for_decl()
4 changes: 4 additions & 0 deletions testsuite/tests/navigation/subp_inst_next_part/subp_g.adb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
procedure Subp_G is
begin
null;
end Subp_G;
2 changes: 2 additions & 0 deletions testsuite/tests/navigation/subp_inst_next_part/subp_g.ads
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
generic
procedure Subp_G;
5 changes: 5 additions & 0 deletions testsuite/tests/navigation/subp_inst_next_part/test.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Working on node <GenericSubpInstantiation ["Subp"] subp.ads:7:1-7:30>
=====================================================================

Eval 'node.p_next_part_for_decl()'
Result: None
2 changes: 2 additions & 0 deletions testsuite/tests/navigation/subp_inst_next_part/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
driver: inline-playground
input_sources: [subp.ads]

0 comments on commit f41519e

Please sign in to comment.