diff --git a/doc/refactoring_tools.md b/doc/refactoring_tools.md index b6f3e2faa..a2092311d 100644 --- a/doc/refactoring_tools.md +++ b/doc/refactoring_tools.md @@ -21,6 +21,8 @@ ## Named Parameters +**Command name:** `als-named-parameters` + * Adds the formal parameter name of each actual parameter in the subprogram call. [Source](https://github.com/AdaCore/ada_language_server/blob/master/source/ada/lsp-ada_handlers-named_parameters_commands.ads) @@ -32,6 +34,8 @@ ## Add Parameter +**Command name:** `als-refactor-add-parameters` + * Adds a new parameter to a subprogram. * All subprogram specs are updated. * Only parameters with correct syntax are accepted. @@ -46,6 +50,8 @@ ## Remove Parameter +**Command name:** `als-refactor-remove-parameters` + * Removes a parameter of a subprogram. * All subprogram specs are updated. * Actual parameter is removed from the subprogram calls. @@ -58,6 +64,8 @@ ## Move Parameter +**Command name:** `als-refactor-move-parameters` + * Moves a parameter backward and forward within a subprogram spec. * All subprogram specs are updated. * Actual parameter are moved in the subprogram calls when needed. @@ -70,6 +78,8 @@ ## Change Parameter Mode +**Command name:** `als-refactor-change-parameter-mode` + * Changes the parameter mode within a subprogram spec. * All subprogram specs are updated. @@ -81,6 +91,8 @@ ## Change Parameter Type +**Command name:** `als-refactor-change_parameters_type` + * Changes the parameter subtype indication within a subprogram spec. * Only subtype indications with correct syntax are accepted. * All subprogram specs are updated. @@ -93,6 +105,8 @@ ## Change Parameter Default Value +**Command name:** `als-refactor-change_parameters_default_value` + * Changes the parameter default value expression within a subprogram spec. * Only default value expressions with correct syntax are accepted. * All subprogram specs are updated. @@ -105,6 +119,8 @@ ## Extract Subprogram +**Command name:** `als-refactor-extract-subprogram` + * Extracts statements to a new subprogram. * The new subprogram is created in the nearest declarative part. * Local declarations of for loop and exception handlers are passed to the extracted subprogram as new parameters. @@ -118,6 +134,8 @@ ## Pull Up Declaration +**Command name:** `als-refactor-pull_up_declaration` + * Moves a declaration and its dependent declarations to their parent declarative part. * 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. @@ -129,6 +147,8 @@ ## Suppress Separate +**Command name:** `als-suppress-separate` + * Moves a separate subunit to it's stub in the parent package. * Use clauses in the separate subunit are moved to the subprogram's declarative part to avoid namespace collisions. * .bak is added to the separate subunit source filename. @@ -141,6 +161,8 @@ ## Introduce Parameter +**Command name:** `als-refactor-introduce-parameter` + * Introduces a formal parameter based on an object declaration or expression inside a subprogram. * All references of the object declaration or expression are replaced by the introduced parameter. * The user must mannually fix the calls to the subprogram that was refactored by addings the corresponding actual parameter. @@ -153,6 +175,8 @@ ## Replace Type +**Command name:** `als-refactor-replace-type` + * Replaces a type in the intire project by another type provided by the user. [Source](https://github.com/AdaCore/lal-refactor/blob/main/src/lal_refactor-replace_type.ads) @@ -163,9 +187,11 @@ ## Auto Import +**Command name:** `als-auto-import` + * For an unresolved name, suggests all packages that can be imported and prefix to be added so that that the name gets resolved. -[Source](https://github.com/AdaCore/lal-refactor/blob/main/src/lal_refactor-refactor_imports.ads) +[Source](https://github.com/AdaCore/lal-refactor/blob/edge/src/lal_refactor-auto_import.adb) [Demo Source](../integration/vscode/Code%20Samples/refactoring_demos/auto_import) @@ -173,6 +199,8 @@ ## Sort Dependencies +**Command name:** `als-refactor-sort_dependencies` + * Sorts all with and use clauses and their associated pragmas. [Source](https://github.com/AdaCore/lal-refactor/blob/main/src/lal_refactor-sort_dependencies.ads) diff --git a/testsuite/ada_lsp/refactoring_imports_commands/issue_1250/refactor_imports_commands.json b/testsuite/ada_lsp/refactoring_imports_commands/issue_1250/refactor_imports_commands.json index 058a8cef0..930e82e49 100644 --- a/testsuite/ada_lsp/refactoring_imports_commands/issue_1250/refactor_imports_commands.json +++ b/testsuite/ada_lsp/refactoring_imports_commands/issue_1250/refactor_imports_commands.json @@ -159,30 +159,6 @@ } ] } - }, - { - "title": "Qualify with E", - "kind": "quickfix", - "command": { - "title": "", - "command": "als-auto-import", - "arguments": [ - { - "context": "Default", - "where": { - "textDocument": { - "uri": "$URI{main.adb}" - }, - "position": { - "line": 2, - "character": 5 - } - }, - "import": "E", - "qualifier": "E" - } - ] - } } ] }