Skip to content

Commit 7cc30d3

Browse files
author
mergerepo
committed
Merge remote branch 'origin/master' into edge
(no-precommit-check no-tn-check)
2 parents 64038a5 + e8f3df0 commit 7cc30d3

File tree

9 files changed

+868
-1
lines changed

9 files changed

+868
-1
lines changed

source/ada/lsp-ada_completions-parameters.adb

+12-1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ package body LSP.Ada_Completions.Parameters is
106106
Params_Index : Natural := Sort_Index;
107107
-- Index of the "Param of" completionItem, this is related
108108
-- 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));
109113
begin
110114
for N of Self.Context.Find_All_Env_Elements (Name_Node) loop
111115
if N.Kind in Ada_Basic_Subp_Decl then
@@ -122,6 +126,8 @@ package body LSP.Ada_Completions.Parameters is
122126

123127
Spec : constant Libadalang.Analysis.Base_Subp_Spec
124128
:= N.As_Basic_Decl.P_Subp_Spec_Or_Null;
129+
130+
Is_First_Param : Boolean := True;
125131
begin
126132
if Spec /= Libadalang.Analysis.No_Base_Subp_Spec
127133
and then LSP.Lal_Utils.Match_Designators
@@ -135,7 +141,11 @@ package body LSP.Ada_Completions.Parameters is
135141
Name : constant LSP_String :=
136142
To_LSP_String (Name_Text);
137143
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
139149
if Token_Kind in Ada_Par_Open | Ada_Comma
140150
or else
141151
LSP.Types.Starts_With
@@ -171,6 +181,7 @@ package body LSP.Ada_Completions.Parameters is
171181
Snippet_Index := Snippet_Index + 1;
172182
end if;
173183
end;
184+
Is_First_Param := False;
174185
end loop;
175186
end loop;
176187

source/protocol/lsp-generic_vectors.ads

+5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ package LSP.Generic_Vectors is
3131

3232
type Vector is new Element_Vectors.Vector with null record;
3333

34+
overriding function "=" (Left, Right : Vector) return Boolean is
35+
(Element_Vectors."="
36+
(Element_Vectors.Vector (Left),
37+
Element_Vectors.Vector (Right)));
38+
3439
procedure Read_Vector
3540
(S : access Ada.Streams.Root_Stream_Type'Class;
3641
V : out Vector);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package body Bar is
2+
3+
-----------
4+
-- Hello --
5+
-----------
6+
7+
procedure Hello (A : Integer; B : Float) is
8+
begin
9+
null;
10+
end Hello;
11+
12+
-----------
13+
-- Hello --
14+
-----------
15+
16+
procedure Hello (M : access My_Type; A : Integer; B : Float) is
17+
begin
18+
null;
19+
end Hello;
20+
21+
end Bar;
22+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package Bar is
2+
3+
procedure Hello (A : Integer; B : Float);
4+
5+
type My_Type is tagged
6+
record
7+
B : Boolean;
8+
end record;
9+
type My_Access is access all My_Type;
10+
11+
procedure Hello (M : access My_Type; A : Integer; B : Float);
12+
13+
end Bar;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
project Default is
2+
for Main use ("foo.adb");
3+
end Default;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
with Bar; use Bar;
2+
3+
procedure Foo is
4+
M : My_Access := null;
5+
begin
6+
Hello (M => , A => , B => )
7+
8+
Bar.Hello (M => , A => , B => )
9+
10+
M.Hello (A => , B => )
11+
end Foo;

0 commit comments

Comments
 (0)