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
123123 -- . When we are providing an actual parameter to a subprogram call
124124
125125 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 ;
126138 end if ;
127139
128140 declare
Original file line number Diff line number Diff line change 242242 "result" : {
243243 "isIncomplete" : false ,
244244 "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- },
261245 {
262246 "label" : " Add" ,
263247 "kind" : 3 ,
264248 "detail" : " function Add (A, B : Integer) return Integer" ,
265249 "documentation" : " at main.adb (3:4)" ,
250+ "sortText" : " 1Add" ,
266251 "additionalTextEdits" : [
267252 ]
268253 }
You can’t perform that action at this time.
0 commit comments