@@ -3255,9 +3255,11 @@ package body LSP.Ada_Handlers is
32553255
32563256 Defining_Name_Node : Defining_Name;
32573257 Decl : Basic_Decl;
3258+ Qualifier_Text : VSS.Strings.Virtual_String;
32583259 Decl_Text : VSS.Strings.Virtual_String;
32593260 Comments_Text : VSS.Strings.Virtual_String;
32603261 Location_Text : VSS.Strings.Virtual_String;
3262+ Aspects_Text : VSS.Strings.Virtual_String;
32613263
32623264 C : constant Context_Access :=
32633265 Self.Contexts.Get_Best_Context (Value.textDocument.uri);
@@ -3279,26 +3281,37 @@ package body LSP.Ada_Handlers is
32793281 end if ;
32803282
32813283 LSP.Ada_Documentation.Get_Tooltip_Text
3282- (BD => Decl,
3283- Trace => Self.Trace,
3284- Style => C.Get_Documentation_Style,
3285- Loc_Text => Location_Text,
3286- Doc_Text => Comments_Text,
3287- Decl_Text => Decl_Text);
3284+ (BD => Decl,
3285+ Style => C.Get_Documentation_Style,
3286+ Declaration_Text => Decl_Text,
3287+ Qualifier_Text => Qualifier_Text,
3288+ Location_Text => Location_Text,
3289+ Documentation_Text => Comments_Text,
3290+ Aspects_Text => Aspects_Text);
32883291
32893292 if Decl_Text.Is_Empty then
32903293 return Response;
32913294 end if ;
32923295
3293- -- Append the whole declaration text to the response
32943296 Response.result := (Is_Set => True, others => <>);
32953297
3298+ -- Append the whole declaration text to the response
3299+
32963300 Response.result.Value.contents.Vector.Append
32973301 (LSP.Messages.MarkedString'
32983302 (Is_String => False,
32993303 value => Decl_Text,
33003304 language => " ada" ));
33013305
3306+ -- Append qualifier text if any
3307+
3308+ if not Qualifier_Text.Is_Empty then
3309+ Response.result.Value.contents.Vector.Append
3310+ (LSP.Messages.MarkedString'
3311+ (Is_String => True,
3312+ value => Qualifier_Text));
3313+ end if ;
3314+
33023315 -- Append the declaration's location.
33033316 -- In addition, append the project's name if we are dealing with an
33043317 -- aggregate project.
@@ -3328,6 +3341,16 @@ package body LSP.Ada_Handlers is
33283341 value => Comments_Text));
33293342 end if ;
33303343
3344+ -- Append text of aspects
3345+
3346+ if not Aspects_Text.Is_Empty then
3347+ Response.result.Value.contents.Vector.Append
3348+ (LSP.Messages.MarkedString'
3349+ (Is_String => False,
3350+ value => Aspects_Text,
3351+ language => " ada" ));
3352+ end if ;
3353+
33313354 return Response;
33323355 end On_Hover_Request ;
33333356
@@ -5959,19 +5982,23 @@ package body LSP.Ada_Handlers is
59595982 -- Compute the completion item's details
59605983 if not Node.Is_Null then
59615984 declare
5962- BD : constant Libadalang.Analysis.Basic_Decl :=
5985+ BD : constant Libadalang.Analysis.Basic_Decl :=
59635986 Node.As_Basic_Decl;
5964- Loc_Text : VSS.Strings.Virtual_String;
5965- Doc_Text : VSS.Strings.Virtual_String;
5966- Decl_Text : VSS.Strings.Virtual_String;
5987+ Qual_Text : VSS.Strings.Virtual_String;
5988+ Loc_Text : VSS.Strings.Virtual_String;
5989+ Doc_Text : VSS.Strings.Virtual_String;
5990+ Decl_Text : VSS.Strings.Virtual_String;
5991+ Aspects_Text : VSS.Strings.Virtual_String;
5992+
59675993 begin
59685994 LSP.Ada_Documentation.Get_Tooltip_Text
5969- (BD => BD,
5970- Trace => C.Trace,
5971- Style => Self.Options.Documentation.Style,
5972- Loc_Text => Loc_Text,
5973- Doc_Text => Doc_Text,
5974- Decl_Text => Decl_Text);
5995+ (BD => BD,
5996+ Style => Self.Options.Documentation.Style,
5997+ Qualifier_Text => Qual_Text,
5998+ Location_Text => Loc_Text,
5999+ Documentation_Text => Doc_Text,
6000+ Declaration_Text => Decl_Text,
6001+ Aspects_Text => Aspects_Text);
59756002
59766003 Item.detail := (True, Decl_Text);
59776004
0 commit comments