Skip to content

Commit 4b6b7ec

Browse files
committed
Merge branch '1110-some-refactoring-tools-are-not-documented' into 'master'
Resolve "Some refactoring tools are not documented" Closes #1110 See merge request eng/ide/ada_language_server!1140
2 parents 215548f + a34bed8 commit 4b6b7ec

File tree

16 files changed

+176
-0
lines changed

16 files changed

+176
-0
lines changed

doc/refactoring_tools.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,32 @@
148148

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

151+
## Replace Type
152+
153+
* Replaces a type in the intire project by another type provided by the user.
154+
155+
[Source](https://github.com/AdaCore/libadalang-tools/blob/master/src/laltools-refactor-replace_type.ads)
156+
157+
[Demo Source](../integration/vscode/Code%20Samples/refactoring_demos/replace_type)
158+
159+
![replace type](https://user-images.githubusercontent.com/22893717/217803466-ae5500fe-a071-4fe9-a669-24cd9c82917a.gif)
160+
161+
## Auto Import
162+
163+
* For an unresolved name, suggests all packages that can be imported and prefix to be added so that that the name gets resolved.
164+
165+
[Source](https://github.com/AdaCore/libadalang-tools/blob/master/src/laltools-refactor_imports.ads)
166+
167+
[Demo Source](../integration/vscode/Code%20Samples/refactoring_demos/auto_import)
168+
169+
![auto import](https://user-images.githubusercontent.com/22893717/217804710-e686ef22-227b-4e81-8bb1-1f218e5709df.gif)
170+
171+
## Sort Dependencies
172+
173+
* Sorts all with and use clauses and their associated pragmas.
174+
175+
[Source](https://github.com/AdaCore/libadalang-tools/blob/master/src/laltools-refactor-sort_dependencies.ads)
176+
177+
[Demo Source](../integration/vscode/Code%20Samples/refactoring_demos/sort_dependencies)
178+
179+
![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)