Skip to content

Commit bbd045a

Browse files
committed
Remove code to extract declaration text for package declarations
... it is done by GNATdoc.
1 parent c94c1b4 commit bbd045a

File tree

1 file changed

+1
-39
lines changed

1 file changed

+1
-39
lines changed

source/ada/lsp-ada_documentation.adb

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,6 @@ package body LSP.Ada_Documentation is
218218
procedure Get_Subp_Spec_Hover_Text;
219219
-- Create the hover text for subprogram declarations
220220

221-
procedure Get_Package_Decl_Hover_Text;
222-
-- Create the hover text for package declarations
223-
224221
procedure Get_Loop_Var_Hover_Text;
225222
-- Create the hover text for loop variable declarations
226223

@@ -397,41 +394,6 @@ package body LSP.Ada_Documentation is
397394
end if;
398395
end Get_Subp_Spec_Hover_Text;
399396

400-
---------------------------------
401-
-- Get_Package_Decl_Hover_Text --
402-
---------------------------------
403-
404-
procedure Get_Package_Decl_Hover_Text is
405-
Text : VSS.Strings.Virtual_String;
406-
Decl : constant Base_Package_Decl := Node.As_Base_Package_Decl;
407-
Aspect : constant Aspect_Spec := Decl.F_Aspects;
408-
Name : constant Defining_Name := Decl.F_Package_Name;
409-
To : Token_Reference := -- token before `IS`
410-
(if not Aspect.Is_Null then
411-
Aspect.Token_End
412-
elsif not Name.Is_Null then
413-
Name.Token_End
414-
else -- just-in-case fallback
415-
Decl.Token_End);
416-
begin
417-
-- Return the first line of the package declaration and its
418-
-- generic parameters if any.
419-
To := Next (To, Exclude_Trivia => True); -- Jump to IS
420-
To := Previous (To, Exclude_Trivia => False); -- Jump before IS
421-
422-
if Node.Parent.Kind in Ada_Generic_Decl then
423-
Text := LSP.Lal_Utils.To_Virtual_String
424-
(Node.Parent.As_Generic_Decl.F_Formal_Part.Text);
425-
426-
Result.Append (Text);
427-
end if;
428-
429-
Text := LSP.Lal_Utils.To_Virtual_String
430-
(Libadalang.Common.Text (Node.Token_Start, To));
431-
432-
Result.Append (Text);
433-
end Get_Package_Decl_Hover_Text;
434-
435397
-----------------------------
436398
-- Get_Loop_Var_Hover_Text --
437399
-----------------------------
@@ -526,7 +488,7 @@ package body LSP.Ada_Documentation is
526488
null;
527489

528490
when Ada_Base_Package_Decl =>
529-
Get_Package_Decl_Hover_Text;
491+
null;
530492

531493
when Ada_For_Loop_Var_Decl =>
532494
Get_Loop_Var_Hover_Text;

0 commit comments

Comments
 (0)