@@ -87,12 +87,9 @@ package body LSP.Ada_Hover is
8787 -- For the Hover request, we're only interested in the "best"
8888 -- response value, not in the list of values for all contexts
8989
90- Defining_Name_Node : constant Libadalang.Analysis.Defining_Name :=
91- Self.Parent.Context.Imprecise_Resolve_Name (Context.all , Value);
92- Decl : constant Libadalang.Analysis.Basic_Decl :=
93- (if Defining_Name_Node.Is_Null
94- then Libadalang.Analysis.No_Basic_Decl
95- else Defining_Name_Node.P_Basic_Decl);
90+ Defining_Name_Node : Libadalang.Analysis.Defining_Name;
91+ Origin_Node : Libadalang.Analysis.Ada_Node;
92+ Decl : Libadalang.Analysis.Basic_Decl;
9693 -- Associated basic declaration, if any
9794
9895 Decl_Text : VSS.Strings.Virtual_String;
@@ -104,6 +101,16 @@ package body LSP.Ada_Hover is
104101 begin
105102 Status := LSP.Server_Jobs.Done;
106103
104+ Self.Parent.Context.Imprecise_Resolve_Name
105+ (Context.all ,
106+ Value,
107+ Defining_Name_Node,
108+ Origin_Node);
109+ Decl :=
110+ (if Defining_Name_Node.Is_Null
111+ then Libadalang.Analysis.No_Basic_Decl
112+ else Defining_Name_Node.P_Basic_Decl);
113+
107114 if Decl.Is_Null then
108115
109116 -- There is no declaration for the hovered node: ask the predefined
@@ -127,6 +134,7 @@ package body LSP.Ada_Hover is
127134 -- the default tooltip provider, based on GNATdoc.
128135 LSP.Ada_Documentation.Get_Tooltip_Text
129136 (Name => Defining_Name_Node,
137+ Origin => Origin_Node,
130138 Style => Context.Get_Documentation_Style,
131139 Declaration_Text => Decl_Text,
132140 Qualifier_Text => Qualifier_Text,
0 commit comments