File tree Expand file tree Collapse file tree 2 files changed +13
-16
lines changed
testsuite/ada_lsp/completion.end_labels Expand file tree Collapse file tree 2 files changed +13
-16
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,18 @@ package body LSP.Ada_Completions.Names is
123
123
-- . When we are providing an actual parameter to a subprogram call
124
124
125
125
Use_Snippets := False;
126
+
127
+ -- If we are dealing with an end label, just return the corresponding
128
+ -- declaration's name: it's the only valid result in this case.
129
+ if Parent.Kind in Ada_End_Name and then not Parent.Is_Null then
130
+ Names.Include
131
+ (Parent.As_End_Name.P_Basic_Decl.P_Defining_Name,
132
+ (Is_Dot_Call => False,
133
+ Is_Visible => True,
134
+ Use_Snippets => Use_Snippets,
135
+ Pos => 1 ));
136
+ return ;
137
+ end if ;
126
138
end if ;
127
139
128
140
declare
Original file line number Diff line number Diff line change 242
242
"result" : {
243
243
"isIncomplete" : false ,
244
244
"items" : [
245
- {
246
- "label" : " A" ,
247
- "kind" : 6 ,
248
- "detail" : " A, B : Integer" ,
249
- "documentation" : " at main.adb (3:18)" ,
250
- "additionalTextEdits" : [
251
- ]
252
- },
253
- {
254
- "label" : " ASCII" ,
255
- "kind" : 9 ,
256
- "detail" : " package ASCII " ,
257
- "documentation" : " <ANY>" ,
258
- "additionalTextEdits" : [
259
- ]
260
- },
261
245
{
262
246
"label" : " Add" ,
263
247
"kind" : 3 ,
264
248
"detail" : " function Add (A, B : Integer) return Integer" ,
265
249
"documentation" : " at main.adb (3:4)" ,
250
+ "sortText" : " 1Add" ,
266
251
"additionalTextEdits" : [
267
252
]
268
253
}
You can’t perform that action at this time.
0 commit comments