Author Topic: Types used in Ada record colored as unknown ...  (Read 394 times)

rgloden

  • Senior Community Member
  • Posts: 160
  • Hero Points: 5
Types used in Ada record colored as unknown ...
« on: February 25, 2018, 11:24:46 pm »
SlickEdit Pro 2016 (v21.0.3.0 64-bit)
Emulation: CUA
OS: Windows 10 x64
Project Type: Cpp
Language: .ada (Ada)

Problem #1: The parser doesn't seem capture the types of elements in an Ada record.
 In the example below, the types myTimeType and myTimeSrc are
  • colored as "Symbol not found"
  • don't show up as references

Note: I noticed in my code that types in a record declaration from external packages are colored as known ... so the coloring might be a problem just with locally defined types.

Problem #2:  The elements (time1, time2, state) in the Representation Clause, e.g. the "for timeMessageType use", are also colored as "Symbol not found".

Problem #3: The record element names (time1, time2, state) in the assignment statement, e.g. "msg := ...", are:
  • colored as "Symbol not found"
  • don't show up as references

Problem #4:  If the code contains variable names with the same names as record element names, SE presumes they are the same.  For instance, adding package variables named "time1" and "state" changes the "No symbol found" color to indicate found (though incorrectly referencing the variable) and Find References seems to presume the record components with that same name and the variables are the same.  This is probably a really hard fix ... but I thought I would mention it any way.

Code: [Select]
package body myTime is

   type myTimeType is range -(2 ** 63) .. +(2 ** 63 - 1);

   type myTimeSrc is
   (
      Invalid,
      Backup,
      Primary
   );

   type timeMessageType is
      record
         time1 : myTimeType;
         time2 : myTimeType;
         state : myTimeSrc;
      end record;

   for timeMessageType use
      record
            time1 at 0 range 0 .. 63;
            time2 at 2 range 0 .. 63;
            state at 4 range 0 .. 31;
      end record;

   procedure test is

      msg : timeMessageType;

   begin -- test

      msg := (time1 => 0,
              time2 => 1,
              state => Primary);

   end test;

end myTime;

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2445
  • Hero Points: 351
Re: Types used in Ada record colored as unknown ...
« Reply #1 on: February 26, 2018, 09:36:43 pm »
This will be fixed in SlickEdit 2018.

rgloden

  • Senior Community Member
  • Posts: 160
  • Hero Points: 5
Re: Types used in Ada record colored as unknown ...
« Reply #2 on: March 14, 2018, 05:49:41 am »
Some more examples / test cases which exhibit similar but potentially different root causes of symbols being colored as Unknown but where SE seems to know the symbol type (e.g. based on cursoring over the symbol) can be found in the GNAT / GCC release (e.g. source code for the included Ada libraries).

Example File which contains several instances of "Unknown" symbols:
   package Ada.Containers.Hash_Tables
   https://github.com/autc04/Retro68/blob/master/gcc/gcc/ada/a-cohata.ads