AdaCore / AdaCore/gnatstudio

Improvement of mouse-over message for inherited subprogram call

Open
#161 1 comment 0 reactions 1 assignee View on GitHub

@AnthonyLeonardoGracio is already working on this.

Since Jun 27, 2023.

enhancement
Dominant language
Ada
Stars
531
Forks
65
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.