Skip to content

Commit 23a61ea

Browse files
V818-002: Add minimal doc for parameter completion
We now display the text that will be inserted for each individual parameter listed when opening a parenthesis. This is useful to distinguish parameter completion from other variables that might have the same name.
1 parent 39d703c commit 23a61ea

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

source/ada/lsp-ada_completions-generic_assoc.adb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ package body LSP.Ada_Completions.Generic_Assoc is
136136
then VSS.Strings.To_Virtual_String
137137
(Param_Types (Desg).Node.Text)
138138
else "");
139+
Doc : VSS.Strings.Virtual_String;
139140
begin
140141
-- Check if Desg is already present
141142
if not In_Parent (Desg, Designators) then
@@ -157,12 +158,21 @@ package body LSP.Ada_Completions.Generic_Assoc is
157158
Item.insertText.Value.Append (Name);
158159
Item.insertText.Value.Append (" => ");
159160
Item.kind := (True, LSP.Messages.Field);
161+
Doc := Item.insertText.Value;
162+
160163
if Param_Types (Desg).Is_Value then
161164
Item.insertText.Value.Append (Type_Text);
162165
Item.label.Append (" => ");
163166
Item.label.Append (Type_Text);
164167
end if;
168+
169+
Item.documentation :=
170+
(Is_Set => True,
171+
Value => LSP.Messages.String_Or_MarkupContent'
172+
(Is_String => True,
173+
String => Doc));
165174
Unsorted_Res.Append (Item);
175+
166176
end if;
167177

168178
if Use_Named_Notation then

0 commit comments

Comments
 (0)