@@ -112,7 +112,7 @@ package body LSP.Ada_Documents is
112112 Sloc : Langkit_Support.Slocs.Source_Location;
113113 From : Langkit_Support.Slocs.Source_Location;
114114 Node : Libadalang.Analysis.Ada_Node;
115- BD : Libadalang.Analysis.Basic_Decl ;
115+ Name : Libadalang.Analysis.Defining_Name ;
116116 Label : VSS.Strings.Virtual_String;
117117 Use_Snippets : Boolean;
118118 Compute_Doc_And_Details : Boolean;
@@ -189,7 +189,7 @@ package body LSP.Ada_Documents is
189189 -- string if we are not completing a dotted name.
190190
191191 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;
193193 -- The missing unit root declaration for this invisible symbol (e.g:
194194 -- the "Ada.Text_IO" package declaration for the
195195 -- "Ada.Text_IO.Put_Line" subprogram).
@@ -231,7 +231,9 @@ package body LSP.Ada_Documents is
231231 -- the user selects "Ada.Text_IO" in the completion window, we do not
232232 -- need to add any qualifier) or if he's completing a dotted name.
233233 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
235237 VSS.Strings.Empty_Virtual_String
236238 else
237239 Missing_Unit_Name);
@@ -295,7 +297,9 @@ package body LSP.Ada_Documents is
295297
296298 begin
297299 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)));
299303
300304 if not Is_Visible then
301305 Item.insertText := Label;
@@ -318,7 +322,7 @@ package body LSP.Ada_Documents is
318322 Set_Completion_Item_Documentation
319323 (Handler => Handler,
320324 Context => Context,
321- BD => BD ,
325+ Name => Name ,
322326 Item => Item,
323327 Compute_Doc_And_Details => Compute_Doc_And_Details);
324328
@@ -331,7 +335,7 @@ package body LSP.Ada_Documents is
331335 -- Check if we are dealing with a subprogram and return a completion
332336 -- snippet that lists all the formal parameters if it's the case.
333337
334- Subp_Spec_Node := BD .P_Subp_Spec_Or_Null;
338+ Subp_Spec_Node := Name.P_Basic_Decl .P_Subp_Spec_Or_Null;
335339
336340 if Subp_Spec_Node.Is_Null then
337341 return Item;
@@ -1360,7 +1364,7 @@ package body LSP.Ada_Documents is
13601364 procedure Set_Completion_Item_Documentation
13611365 (Handler : in out LSP.Ada_Handlers.Message_Handler;
13621366 Context : LSP.Ada_Contexts.Context;
1363- BD : Libadalang.Analysis.Basic_Decl ;
1367+ Name : Libadalang.Analysis.Defining_Name ;
13641368 Item : in out LSP.Structures.CompletionItem;
13651369 Compute_Doc_And_Details : Boolean)
13661370 is
@@ -1370,7 +1374,7 @@ package body LSP.Ada_Documents is
13701374 -- Compute the 'documentation' and 'detail' fields immediately if
13711375 -- requested (i.e: when the client does not support lazy computation
13721376 -- 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
13741378 declare
13751379 Qual_Text : VSS.Strings.Virtual_String;
13761380 Decl_Text : VSS.Strings.Virtual_String;
@@ -1380,7 +1384,8 @@ package body LSP.Ada_Documents is
13801384
13811385 begin
13821386 LSP.Ada_Documentation.Get_Tooltip_Text
1383- (BD => BD,
1387+ (Name => Name,
1388+ Origin => Libadalang.Analysis.No_Ada_Node,
13841389 Style => Context.Get_Documentation_Style,
13851390 Declaration_Text => Decl_Text,
13861391 Qualifier_Text => Qual_Text,
@@ -1406,7 +1411,7 @@ package body LSP.Ada_Documents is
14061411 -- Set node's location to the 'data' field of the completion item, so
14071412 -- that we can retrieve it in the completionItem/resolve handler.
14081413 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 ),
14101415 Item.data);
14111416 end if ;
14121417 end Set_Completion_Item_Documentation ;
0 commit comments