@@ -112,7 +112,7 @@ package body LSP.Ada_Documents is
112
112
Sloc : Langkit_Support.Slocs.Source_Location;
113
113
From : Langkit_Support.Slocs.Source_Location;
114
114
Node : Libadalang.Analysis.Ada_Node;
115
- BD : Libadalang.Analysis.Basic_Decl ;
115
+ Name : Libadalang.Analysis.Defining_Name ;
116
116
Label : VSS.Strings.Virtual_String;
117
117
Use_Snippets : Boolean;
118
118
Compute_Doc_And_Details : Boolean;
@@ -189,7 +189,7 @@ package body LSP.Ada_Documents is
189
189
-- string if we are not completing a dotted name.
190
190
191
191
Missing_Unit_Root_Decl : constant Libadalang.Analysis.Basic_Decl :=
192
- BD .P_Enclosing_Compilation_Unit.P_Decl;
192
+ Name .P_Enclosing_Compilation_Unit.P_Decl;
193
193
-- The missing unit root declaration for this invisible symbol (e.g:
194
194
-- the "Ada.Text_IO" package declaration for the
195
195
-- "Ada.Text_IO.Put_Line" subprogram).
@@ -231,7 +231,9 @@ package body LSP.Ada_Documents is
231
231
-- the user selects "Ada.Text_IO" in the completion window, we do not
232
232
-- need to add any qualifier) or if he's completing a dotted name.
233
233
Missing_Qualifier :=
234
- (if Is_Dotted_Name or else BD = Missing_Unit_Root_Decl then
234
+ (if Is_Dotted_Name
235
+ or else Name.P_Basic_Decl = Missing_Unit_Root_Decl
236
+ then
235
237
VSS.Strings.Empty_Virtual_String
236
238
else
237
239
Missing_Unit_Name);
@@ -295,7 +297,9 @@ package body LSP.Ada_Documents is
295
297
296
298
begin
297
299
Item.label := Label;
298
- Item.kind := (True, To_Completion_Kind (LSP.Utils.Get_Decl_Kind (BD)));
300
+ Item.kind :=
301
+ (True,
302
+ To_Completion_Kind (LSP.Utils.Get_Decl_Kind (Name.P_Basic_Decl)));
299
303
300
304
if not Is_Visible then
301
305
Item.insertText := Label;
@@ -318,7 +322,7 @@ package body LSP.Ada_Documents is
318
322
Set_Completion_Item_Documentation
319
323
(Handler => Handler,
320
324
Context => Context,
321
- BD => BD ,
325
+ Name => Name ,
322
326
Item => Item,
323
327
Compute_Doc_And_Details => Compute_Doc_And_Details);
324
328
@@ -331,7 +335,7 @@ package body LSP.Ada_Documents is
331
335
-- Check if we are dealing with a subprogram and return a completion
332
336
-- snippet that lists all the formal parameters if it's the case.
333
337
334
- Subp_Spec_Node := BD .P_Subp_Spec_Or_Null;
338
+ Subp_Spec_Node := Name.P_Basic_Decl .P_Subp_Spec_Or_Null;
335
339
336
340
if Subp_Spec_Node.Is_Null then
337
341
return Item;
@@ -1360,7 +1364,7 @@ package body LSP.Ada_Documents is
1360
1364
procedure Set_Completion_Item_Documentation
1361
1365
(Handler : in out LSP.Ada_Handlers.Message_Handler;
1362
1366
Context : LSP.Ada_Contexts.Context;
1363
- BD : Libadalang.Analysis.Basic_Decl ;
1367
+ Name : Libadalang.Analysis.Defining_Name ;
1364
1368
Item : in out LSP.Structures.CompletionItem;
1365
1369
Compute_Doc_And_Details : Boolean)
1366
1370
is
@@ -1370,7 +1374,7 @@ package body LSP.Ada_Documents is
1370
1374
-- Compute the 'documentation' and 'detail' fields immediately if
1371
1375
-- requested (i.e: when the client does not support lazy computation
1372
1376
-- for these fields or if we are dealing with predefined types).
1373
- if Compute_Doc_And_Details or else LSP.Utils.Is_Synthetic (BD ) then
1377
+ if Compute_Doc_And_Details or else LSP.Utils.Is_Synthetic (Name ) then
1374
1378
declare
1375
1379
Qual_Text : VSS.Strings.Virtual_String;
1376
1380
Decl_Text : VSS.Strings.Virtual_String;
@@ -1380,7 +1384,8 @@ package body LSP.Ada_Documents is
1380
1384
1381
1385
begin
1382
1386
LSP.Ada_Documentation.Get_Tooltip_Text
1383
- (BD => BD,
1387
+ (Name => Name,
1388
+ Origin => Libadalang.Analysis.No_Ada_Node,
1384
1389
Style => Context.Get_Documentation_Style,
1385
1390
Declaration_Text => Decl_Text,
1386
1391
Qualifier_Text => Qual_Text,
@@ -1406,7 +1411,7 @@ package body LSP.Ada_Documents is
1406
1411
-- Set node's location to the 'data' field of the completion item, so
1407
1412
-- that we can retrieve it in the completionItem/resolve handler.
1408
1413
LSP.Structures.LSPAny_Vectors.To_Any
1409
- (LSP.Ada_Handlers.Locations.To_LSP_Location (Handler, BD ),
1414
+ (LSP.Ada_Handlers.Locations.To_LSP_Location (Handler, Name ),
1410
1415
Item.data);
1411
1416
end if ;
1412
1417
end Set_Completion_Item_Documentation ;
0 commit comments