Skip to content

Commit 7cc4003

Browse files
author
automatic-merge
committed
Merge remote branch 'origin/master' into edge
2 parents e6afeaf + 6fe31de commit 7cc4003

File tree

11 files changed

+94
-21
lines changed

11 files changed

+94
-21
lines changed

source/gnatdoc-comments-extractor.adb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ package body GNATdoc.Comments.Extractor is
315315
| Ada_Generic_Subp_Decl
316316
| Ada_Package_Body
317317
| Ada_Package_Decl
318+
| Ada_Package_Renaming_Decl
318319
| Ada_Subp_Body
319320
| Ada_Subp_Decl
320321
| Ada_Null_Subp_Decl
@@ -2339,6 +2340,7 @@ package body GNATdoc.Comments.Extractor is
23392340
Is_Private : out Boolean;
23402341
Messages : in out GNATdoc.Messages.Message_Container)
23412342
is
2343+
Header_Section : Section_Access;
23422344
Leading_Section : Section_Access;
23432345
Trailing_Section : Section_Access;
23442346

@@ -2385,6 +2387,24 @@ package body GNATdoc.Comments.Extractor is
23852387
end if;
23862388
end case;
23872389

2390+
if Raw_Section = null and Node.P_Is_Compilation_Unit_Root then
2391+
-- It is case of the package renaming as compilation unit
2392+
--
2393+
-- Side effect: two `<<LEADING>>` sections are created, one for
2394+
-- leading comments of the declation and another one for leading
2395+
-- section of the compilation unit's header.
2396+
2397+
Extract_Compilation_Unit_Documentation
2398+
(Node, Options, Sections, Header_Section, Leading_Section, True);
2399+
2400+
if not Leading_Section.Text.Is_Empty then
2401+
Raw_Section := Leading_Section;
2402+
2403+
else
2404+
Raw_Section := Header_Section;
2405+
end if;
2406+
end if;
2407+
23882408
Parse_Raw_Section
23892409
(GNATdoc.Utilities.Location (Node),
23902410
Raw_Section,

source/gnatdoc-comments-helpers.adb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ package body GNATdoc.Comments.Helpers is
364364
| Ada_Null_Subp_Decl
365365
| Ada_Number_Decl
366366
| Ada_Object_Decl
367+
| Ada_Package_Body
367368
| Ada_Package_Decl
368369
| Ada_Package_Renaming_Decl
369370
| Ada_Protected_Type_Decl
@@ -500,6 +501,7 @@ package body GNATdoc.Comments.Helpers is
500501
| Ada_Object_Decl
501502
| Ada_Package_Body
502503
| Ada_Package_Decl
504+
| Ada_Package_Renaming_Decl
503505
| Ada_Param_Spec
504506
| Ada_Subtype_Decl
505507
=>

testsuite/als_helper/locations.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,27 @@
131131
{"file": "exceptions_package.adb", "line": 8, "column": 16},
132132
// reference of the exception
133133

134+
// LAL 20250922: issue with package name resolution in the body doesn't allow to write test
135+
// {"file": "packages.ads", "line": 5, "column": 9},
136+
// // specification of the package
137+
// // reference of the package from "end <>"
138+
// {"file": "packages.adb", "line": 5, "column": 14},
139+
// // body of the package
140+
// {"file": "packages.adb", "line": 9, "column": 7},
141+
// // reference of the package
142+
// // reference of the package from "end <>"
143+
// {"file": "packages_package.adb", "line": 1, "column": 6},
144+
// // reference of the package in with clause
145+
// {"file": "packages_package.adb", "line": 8, "column": 7},
146+
// // reference of the package in code
147+
148+
{"file": "packages_renaming.ads", "line": 7, "column": 9},
149+
// specification of the package renaming
150+
{"file": "packages_package.adb", "line": 2, "column": 6},
151+
// reference of the package renaming from `with` clause
152+
{"file": "packages_package.adb", "line": 2, "column": 6},
153+
// reference of the package renaming from code
154+
134155
{"file": "synthetics.adb", "line": 11, "column": 15},
135156
// reference of synthetic `"="` subprogram of `Implicit_Record`
136157
{"file": "synthetics.adb", "line": 15, "column": 15},

testsuite/als_helper/pkg1.adb renamed to testsuite/als_helper/packages.adb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
-- Description of the package body
44

5-
package body Pkg1 is
5+
package body Packages is
66

77
procedure Dummy is
88
begin
9-
Pkg1.Dummy;
9+
Packages.Dummy;
1010
end Dummy;
1111

12-
end Pkg1;
12+
end Packages;

testsuite/als_helper/pkg1.ads renamed to testsuite/als_helper/packages.ads

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
-- Description of the package specification
44

5-
package Pkg1 is
5+
package Packages is
66

77
procedure Dummy;
88

9-
end Pkg1;
9+
end Packages;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
with Packages;
2+
with Packages_Renaming;
3+
4+
package body Packages_Package is
5+
6+
procedure Dummy is
7+
begin
8+
Packages.Dummy;
9+
Packages_Renaming.Dummy;
10+
end Dummy;
11+
12+
end Packages_Package;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
package Packages_Package is
3+
4+
procedure Dummy;
5+
6+
end Packages_Package;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
-- Copyright header
2+
3+
-- Description of the package renaming
4+
5+
with Packages;
6+
7+
package Packages_Renaming renames Packages;

testsuite/als_helper/pkg2.adb

Lines changed: 0 additions & 9 deletions
This file was deleted.

testsuite/als_helper/pkg2.ads

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)