text
stringlengths
0
234
Row := 0;
Col := Col + 1;
else
Row := Row + 1;
end if;
Function Definition: -- procedure register_Usage (package_Name : in AdaM.Text;
Function Body: -- the_Package : in AdaM.a_Package.view)
-- is
-- use package_Usage_Sets;
--
-- the_type_Usage : package_Usage := (the_Package, package_Name, others => <>);
-- Current : constant package_Usage_Sets.Cursor := the_usage_Stats.find (the_type_Usage);
-- begin
-- if Current /= No_Element
-- then
-- the_type_Usage.Count := Element (Current).Count + 1;
-- the_usage_Stats.replace_Element (Current, the_type_Usage);
-- else
-- the_type_Usage.Count := 1;
-- the_usage_Stats.insert (the_type_Usage);
-- end if;
-- end register_Usage;
procedure register_Usage (the_Package : in AdaM.a_Package.view)
is
use package_Usage_Sets;
the_type_Usage : package_Usage := (the_Package, others => <>);
Current : constant package_Usage_Sets.Cursor := the_usage_Stats.find (the_type_Usage);
begin
if Current /= No_Element
then
the_type_Usage.Count := Element (Current).Count + 1;
the_usage_Stats.replace_Element (Current, the_type_Usage);
else
the_type_Usage.Count := 1;
the_usage_Stats.insert (the_type_Usage);
end if;
end register_Usage;
function fetch return AdaM.a_Package.vector
is
use package_Usage_Sets,
ada.Containers;
-- the_Lines : AdaM.text_Lines;
the_Packages : AdaM.a_Package.vector;
package type_Usage_Vectors is new ada.Containers.Vectors (Positive, package_Usage);
use type_Usage_Vectors;
the_usage_List : type_Usage_Vectors.Vector;
begin
declare
Cursor : package_Usage_Sets.Cursor := the_usage_Stats.First;
begin
while has_Element (Cursor)
loop
if Element (Cursor).Count > 0 then
the_usage_List.append (Element (Cursor));
end if;
exit when the_Packages.Length = 25; -- Limit results to 25 entries.
next (Cursor);
end loop;
Function Definition: procedure choice_is (Self : in out Item; package_Name : in String;
Function Body: the_Package : in AdaM.a_Package.view)
is
use AdaM,
AdaM.Assist;
use type AdaM.context_Line.view,
AdaM.a_Package.view;
full_Name : constant String := package_Name;
begin
-- recent_Packages.register_Usage (+full_Name, the_Package);
recent_Packages.register_Usage (the_Package);
Self.build_recent_List;
if Self.Invoked_by /= null
then
-- Self.Invoked_by.set_Label (full_Name);
Self.Invoked_by.set_Label (String (identifier_Suffix (the_Package.full_Name, 2)));
Self.Invoked_by.set_Tooltip_Text (String (the_Package.full_Name));
end if;
if Self.Target /= null and Self.Target_2 /= null
then
raise program_Error with "Self.Target /= null and Self.Target_2 /= null";
end if;
if Self.Target /= null