@@ -39,17 +39,31 @@ generic
39
39
with function Get_Designators
40
40
(E : Element;
41
41
Sloc : Langkit_Support.Slocs.Source_Location;
42
+ Prefixed : out Boolean;
42
43
Unnamed_Params : out Natural)
43
44
return Laltools.Common.Node_Vectors.Vector;
44
- -- Return the current list of Designators for E.
45
- -- Unnamed_Params correspond to the number of parameters without
46
- -- designators before Sloc.
45
+ -- Compute the list of parameters in E, they are separated in 4 categories:
46
+ -- - Prefixed indicates if we are prefixed by a parameter
47
+ -- - Unnamed_Params corresponds to all the params without designators
48
+ -- at the start of the function
49
+ -- - The Result starts with the list of all the designators
50
+ -- - The Result finishes with X No_Ada_Node, one for each params without
51
+ -- designator after the first named param.
52
+ --
53
+ -- Example: Obj.Foo (1, 2, 3, X => 4, Y => 5, 7, 8
54
+ -- Prefixed = Is_Param (Obj)
55
+ -- Unnamed_Params = 3
56
+ -- Result = [X, Y, No_Ada_Node, No_Ada_Node]
47
57
48
58
with function Get_Spec_Designators
49
- (E : Element;
50
- Context : not null LSP.Ada_Handlers.Context_Access)
59
+ (E : Element;
60
+ Context : not null LSP.Ada_Handlers.Context_Access;
61
+ For_Signature : Boolean)
51
62
return LSP.Ada_Completions.Generic_Assoc_Utils.Assoc_Data_Lists.List;
52
63
-- Return all the specs matching E
64
+ -- When For_Signature, modify the data for signature
65
+ -- For example: completion requires the missing parameters but signature
66
+ -- requires all parameters
53
67
54
68
Pretty_Print_Rule : Libadalang.Common.Grammar_Rule;
55
69
-- Rule used to pretty print the completion item
@@ -60,6 +74,10 @@ generic
60
74
return Libadalang.Analysis.Ada_Node'Class;
61
75
-- Get the node needed to match Pretty_Print_Rule
62
76
-- Column represent the block indentation level
77
+
78
+ with function To_Node
79
+ (E : Element) return Libadalang.Analysis.Ada_Node'Class;
80
+
63
81
package LSP.Ada_Completions.Generic_Assoc is
64
82
procedure Propose_Completion
65
83
(Self :
@@ -71,4 +89,14 @@ package LSP.Ada_Completions.Generic_Assoc is
71
89
Filter : in out LSP.Ada_Completions.Filters.Filter;
72
90
Names : in out Ada_Completions.Completion_Maps.Map;
73
91
Unsorted_Res : in out LSP.Messages.CompletionItem_Vector);
92
+
93
+ procedure Propose_Signatures
94
+ (Context : not null LSP.Ada_Handlers.Context_Access;
95
+ Node : Libadalang.Analysis.Ada_Node;
96
+ Cursor : Langkit_Support.Slocs.Source_Location;
97
+ Prev_Signatures : LSP.Messages.Optional_SignatureHelpContext;
98
+ Res : in out LSP.Messages.SignatureHelp;
99
+ Lazy : Boolean := False);
100
+ -- If Lazy, give up on trying to highlight the parameters when multiple
101
+ -- signature are possible.
74
102
end LSP.Ada_Completions.Generic_Assoc ;
0 commit comments