Skip to content

Commit f3eab06

Browse files
author
automatic-merge
committed
Merge remote branch 'origin/master' into edge
2 parents a593ef6 + 950b5a9 commit f3eab06

File tree

16 files changed

+179
-0
lines changed

16 files changed

+179
-0
lines changed

doc/refactoring_tools.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
* [Pull Up Declaration](#pull-up-declaration)
1616
* [Suppress Separate](#suppress-separate)
1717
* [Introduce Parameter](#introduce-parameter)
18+
* [Replace Type](#replace-type)
19+
* [Auto Import](#auto-import)
20+
* [Sort Dependencies](#sort-dependencies)
1821

1922
## Named Parameters
2023

@@ -148,3 +151,32 @@
148151

149152
![introduce parameter](https://user-images.githubusercontent.com/22893717/181477996-564a1365-33df-4227-bb82-e9ed802b4ed0.gif)
150153

154+
## Replace Type
155+
156+
* Replaces a type in the intire project by another type provided by the user.
157+
158+
[Source](https://github.com/AdaCore/libadalang-tools/blob/master/src/laltools-refactor-replace_type.ads)
159+
160+
[Demo Source](../integration/vscode/Code%20Samples/refactoring_demos/replace_type)
161+
162+
![replace type](https://user-images.githubusercontent.com/22893717/217803466-ae5500fe-a071-4fe9-a669-24cd9c82917a.gif)
163+
164+
## Auto Import
165+
166+
* For an unresolved name, suggests all packages that can be imported and prefix to be added so that that the name gets resolved.
167+
168+
[Source](https://github.com/AdaCore/libadalang-tools/blob/master/src/laltools-refactor_imports.ads)
169+
170+
[Demo Source](../integration/vscode/Code%20Samples/refactoring_demos/auto_import)
171+
172+
![auto import](https://user-images.githubusercontent.com/22893717/217804710-e686ef22-227b-4e81-8bb1-1f218e5709df.gif)
173+
174+
## Sort Dependencies
175+
176+
* Sorts all with and use clauses and their associated pragmas.
177+
178+
[Source](https://github.com/AdaCore/libadalang-tools/blob/master/src/laltools-refactor-sort_dependencies.ads)
179+
180+
[Demo Source](../integration/vscode/Code%20Samples/refactoring_demos/sort_dependencies)
181+
182+
![replace type](https://user-images.githubusercontent.com/22893717/217805066-ee69e6d6-4c9e-4075-8eb6-1fca7793c428.gif)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package body A is
2+
3+
procedure Subprogram is
4+
begin
5+
null;
6+
end Subprogram;
7+
8+
end A;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
with Ada.Containers.Indefinite_Hashed_Maps;
2+
with Ada.Strings.Hash;
3+
4+
package A is
5+
6+
package Integer_Hashed_Maps is new
7+
Ada.Containers.Indefinite_Hashed_Maps
8+
(Key_Type => String,
9+
Element_Type => Integer,
10+
Hash => Ada.Strings.Hash,
11+
Equivalent_Keys => "=");
12+
13+
package IHM renames Integer_Hashed_Maps;
14+
15+
procedure Subprogram;
16+
17+
end A;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
project Default is
2+
end Default;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
procedure Main is
2+
M : Map;
3+
begin
4+
Subprogram;
5+
end Main;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
project Default is
2+
end Default;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
with Test;
2+
3+
procedure Main is
4+
F : constant Test.Foo := 1;
5+
B : constant Test.Bar := 1;
6+
begin
7+
null;
8+
end Main;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package Test is
2+
3+
type Foo;
4+
5+
type Foo is new Integer;
6+
7+
type Baz is new Integer;
8+
9+
type Bar is new Foo;
10+
11+
F : constant Foo := 1;
12+
13+
B : constant Bar := 1;
14+
15+
end Test;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package Bar is
2+
3+
4+
5+
end Bar;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package Corge is
2+
3+
4+
5+
end Corge;

0 commit comments

Comments
 (0)