How to color Ada procedure/function calls in GNAT GPS

188 Views Asked by At

Is there a way to color the calling Ada procedures or functions in Gnat GPS IDE? Is there any custom solution to this? Check the comment in the following code to see what I mean:

package body Pkg is

   function Get_Amount (a : b) return Integer is
   begin
      return 0;
   end Get_Amount;

   procedure Print_Owing is
   begin
      Get_Amount (x); --This call here shall be colored if possible but its not.
   end Print_Owing;

end Pkg;
2

There are 2 best solutions below

1
On

The coloration of procedures and functions is not supported. Even for types, you'll notice that they are only colored when they appear in a declaration or a signature:

declare:
    a : Some_type; -- colored
    b : Some_Type; -- colored
begin
    a := Some_Type'("42"); -- not colored
    b := Sometype(a);      -- not colored
end

In order to be able to identify that something is a function or a procedure, you would have keep track of the whole project semantics in order to color any file.

2
On

Right-click the name, try "Name is called by" menu item.