AdaCore / gnatstudio

GNAT Studio is a powerful and lightweight IDE for Ada and SPARK.
399 stars 52 forks source link

Improvement of mouse-over message for inherited subprogram call #161

Open zertovitch opened 1 year ago

zertovitch commented 1 year ago

When the mouse pointer is on a subprogram name, at a location where the subprogram is called, the mouse-over message could indicate that the subprogram is inherited, if it is inherited. The improved message could be useful especially regarding non-tagged types where a user might non be aware that an inheritance happened. An example:

package X is
   type T is new Integer;
   procedure do_it (p : in T);
end X;

with Ada.Text_IO;
package body X is
   procedure do_it (p : in T) is
   begin
     Ada.Text_IO.Put_Line ("X.do_it" & p'Image);
   end;
end X;

with X;
package Y is
  type T is new X.T;
end Y;

with Y;
procedure Test_XY is
begin
  Y.do_it (1);
end;

Project file:

project XY is
   for Source_Dirs use (".");
   for Object_Dir use "obj";
   for Main use ("test_xy.adb");   
end XY;

On putting the mouse pointer on the "do_it" part of "Y.do_it (1);" the message says "procedure do_it (p : in T); at x.ads (3:4)". Since do_it is declared in package X and only implicitly in Y, adding to the message something like ", inherited" or ", inherited (RM 3.4 23/2)" could be very helpful, especially in the case of simple types like type T is new Integer.

inherited_2

AnthonyLeonardoGracio commented 1 year ago

Hello,

I agree it would be great to have this info, We'll see if that can be done easily, without any performance impact while checking for this info.

Regards,