Skip to content

Commit 215bb5a

Browse files
Update refactroing tools documentation
To mention command names. Eases integration with other LSP clients. For #1039 (no-issue-check)
1 parent 8b5e143 commit 215bb5a

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

Diff for: doc/refactoring_tools.md

+29-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
## Named Parameters
2323

24+
**Command name:** `als-named-parameters`
25+
2426
* Adds the formal parameter name of each actual parameter in the subprogram call.
2527

2628
[Source](https://github.com/AdaCore/ada_language_server/blob/master/source/ada/lsp-ada_handlers-named_parameters_commands.ads)
@@ -32,6 +34,8 @@
3234

3335
## Add Parameter
3436

37+
**Command name:** `als-refactor-add-parameters`
38+
3539
* Adds a new parameter to a subprogram.
3640
* All subprogram specs are updated.
3741
* Only parameters with correct syntax are accepted.
@@ -46,6 +50,8 @@
4650

4751
## Remove Parameter
4852

53+
**Command name:** `als-refactor-remove-parameters`
54+
4955
* Removes a parameter of a subprogram.
5056
* All subprogram specs are updated.
5157
* Actual parameter is removed from the subprogram calls.
@@ -58,6 +64,8 @@
5864

5965
## Move Parameter
6066

67+
**Command name:** `als-refactor-move-parameters`
68+
6169
* Moves a parameter backward and forward within a subprogram spec.
6270
* All subprogram specs are updated.
6371
* Actual parameter are moved in the subprogram calls when needed.
@@ -70,6 +78,8 @@
7078

7179
## Change Parameter Mode
7280

81+
**Command name:** `als-refactor-change-parameter-mode`
82+
7383
* Changes the parameter mode within a subprogram spec.
7484
* All subprogram specs are updated.
7585

@@ -81,6 +91,8 @@
8191

8292
## Change Parameter Type
8393

94+
**Command name:** `als-refactor-change_parameters_type`
95+
8496
* Changes the parameter subtype indication within a subprogram spec.
8597
* Only subtype indications with correct syntax are accepted.
8698
* All subprogram specs are updated.
@@ -93,6 +105,8 @@
93105

94106
## Change Parameter Default Value
95107

108+
**Command name:** `als-refactor-change_parameters_default_value`
109+
96110
* Changes the parameter default value expression within a subprogram spec.
97111
* Only default value expressions with correct syntax are accepted.
98112
* All subprogram specs are updated.
@@ -105,6 +119,8 @@
105119

106120
## Extract Subprogram
107121

122+
**Command name:** `als-refactor-extract-subprogram`
123+
108124
* Extracts statements to a new subprogram.
109125
* The new subprogram is created in the nearest declarative part.
110126
* Local declarations of for loop and exception handlers are passed to the extracted subprogram as new parameters.
@@ -118,6 +134,8 @@
118134

119135
## Pull Up Declaration
120136

137+
**Command name:** `als-refactor-pull_up_declaration`
138+
121139
* Moves a declaration and its dependent declarations to their parent declarative part.
122140
* When pulling up a subprogram, object declaration are not pulled up. Instead, they're added as formal parameters to the subprogram specification and as actual parameters to the subprogram calls.
123141

@@ -129,6 +147,8 @@
129147

130148
## Suppress Separate
131149

150+
**Command name:** `als-suppress-separate`
151+
132152
* Moves a separate subunit to it's stub in the parent package.
133153
* Use clauses in the separate subunit are moved to the subprogram's declarative part to avoid namespace collisions.
134154
* .bak is added to the separate subunit source filename.
@@ -141,6 +161,8 @@
141161

142162
## Introduce Parameter
143163

164+
**Command name:** `als-refactor-introduce-parameter`
165+
144166
* Introduces a formal parameter based on an object declaration or expression inside a subprogram.
145167
* All references of the object declaration or expression are replaced by the introduced parameter.
146168
* The user must mannually fix the calls to the subprogram that was refactored by addings the corresponding actual parameter.
@@ -153,6 +175,8 @@
153175

154176
## Replace Type
155177

178+
**Command name:** `als-refactor-replace-type`
179+
156180
* Replaces a type in the intire project by another type provided by the user.
157181

158182
[Source](https://github.com/AdaCore/lal-refactor/blob/main/src/lal_refactor-replace_type.ads)
@@ -163,16 +187,20 @@
163187

164188
## Auto Import
165189

190+
**Command name:** `als-auto-import`
191+
166192
* For an unresolved name, suggests all packages that can be imported and prefix to be added so that that the name gets resolved.
167193

168-
[Source](https://github.com/AdaCore/lal-refactor/blob/main/src/lal_refactor-refactor_imports.ads)
194+
[Source](https://github.com/AdaCore/lal-refactor/blob/edge/src/lal_refactor-auto_import.adb)
169195

170196
[Demo Source](../integration/vscode/Code%20Samples/refactoring_demos/auto_import)
171197

172198
![auto import](https://user-images.githubusercontent.com/22893717/217804710-e686ef22-227b-4e81-8bb1-1f218e5709df.gif)
173199

174200
## Sort Dependencies
175201

202+
**Command name:** `als-refactor-sort_dependencies`
203+
176204
* Sorts all with and use clauses and their associated pragmas.
177205

178206
[Source](https://github.com/AdaCore/lal-refactor/blob/main/src/lal_refactor-sort_dependencies.ads)

0 commit comments

Comments
 (0)