Skip to content

Commit f56205c

Browse files
committed
Use GNATdoc based subprogram to obtain declaration and documentation
1 parent 2a479c4 commit f56205c

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

source/ada/lsp-ada_completions-generic_assoc.adb

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
with GNATCOLL.Utils;
1919
with GNATCOLL.Traces;
2020
with Laltools.Common;
21-
with Libadalang.Doc_Utils;
2221
with LSP.Ada_Documents;
2322
with LSP.Ada_Documentation;
2423
with LSP.Lal_Utils;
@@ -497,15 +496,7 @@ package body LSP.Ada_Completions.Generic_Assoc is
497496

498497
procedure Add_Signature (Spec : Assoc_Data) is
499498
Signature : LSP.Messages.SignatureInformation :=
500-
(label => LSP.Ada_Documentation.Get_Hover_Text (Spec.Decl),
501-
documentation =>
502-
(Is_Set => True,
503-
Value =>
504-
(Is_String => True,
505-
String =>
506-
VSS.Strings.To_Virtual_String
507-
(Libadalang.Doc_Utils.Get_Documentation
508-
(Spec.Decl).Doc.To_String))),
499+
(label => <>,
509500
activeParameter =>
510501
(Is_Set => True,
511502
Value =>
@@ -515,7 +506,24 @@ package body LSP.Ada_Completions.Generic_Assoc is
515506
Cursor_Position => Cursor_Position)),
516507
others => <>
517508
);
509+
Location_Text : VSS.Strings.Virtual_String;
510+
Documentation_Text : VSS.Strings.Virtual_String;
511+
Declaration_Text : VSS.Strings.Virtual_String;
512+
518513
begin
514+
LSP.Ada_Documentation.Get_Tooltip_Text
515+
(Spec.Decl,
516+
Me_Debug,
517+
Context.Get_Documentation_Style,
518+
Location_Text,
519+
Documentation_Text,
520+
Declaration_Text);
521+
522+
Signature.label := Declaration_Text;
523+
Signature.documentation :=
524+
(Is_Set => True,
525+
Value => (Is_String => True, String => Documentation_Text));
526+
519527
for Param of Spec.Param_Vector loop
520528
declare
521529
P : constant LSP.Messages.ParameterInformation :=

0 commit comments

Comments
 (0)