@@ -106,6 +106,10 @@ package body LSP.Ada_Completions.Parameters is
106
106
Params_Index : Natural := Sort_Index;
107
107
-- Index of the "Param of" completionItem, this is related
108
108
-- to Sort_Index
109
+
110
+ Is_Dotted_Name : constant Boolean :=
111
+ (Name_Node.Kind in Ada_Dotted_Name_Range
112
+ and then Name_Node.As_Dotted_Name.P_Is_Dot_Call (True));
109
113
begin
110
114
for N of Self.Context.Find_All_Env_Elements (Name_Node) loop
111
115
if N.Kind in Ada_Basic_Subp_Decl then
@@ -122,6 +126,8 @@ package body LSP.Ada_Completions.Parameters is
122
126
123
127
Spec : constant Libadalang.Analysis.Base_Subp_Spec
124
128
:= N.As_Basic_Decl.P_Subp_Spec_Or_Null;
129
+
130
+ Is_First_Param : Boolean := True;
125
131
begin
126
132
if Spec /= Libadalang.Analysis.No_Base_Subp_Spec
127
133
and then LSP.Lal_Utils.Match_Designators
@@ -135,7 +141,11 @@ package body LSP.Ada_Completions.Parameters is
135
141
Name : constant LSP_String :=
136
142
To_LSP_String (Name_Text);
137
143
begin
138
- if not Is_Present (Name_Text) then
144
+ if not Is_Present (Name_Text)
145
+ and then
146
+ not (Is_First_Param
147
+ and then Is_Dotted_Name)
148
+ then
139
149
if Token_Kind in Ada_Par_Open | Ada_Comma
140
150
or else
141
151
LSP.Types.Starts_With
@@ -171,6 +181,7 @@ package body LSP.Ada_Completions.Parameters is
171
181
Snippet_Index := Snippet_Index + 1 ;
172
182
end if ;
173
183
end ;
184
+ Is_First_Param := False;
174
185
end loop ;
175
186
end loop ;
176
187
0 commit comments