Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/rename.rs')
-rw-r--r--crates/ide/src/rename.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/crates/ide/src/rename.rs b/crates/ide/src/rename.rs
index d1eac86867..185815fa73 100644
--- a/crates/ide/src/rename.rs
+++ b/crates/ide/src/rename.rs
@@ -121,6 +121,17 @@ pub(crate) fn prepare_rename(
// | VS Code | <kbd>F2</kbd> |
//
// ![Rename](https://user-images.githubusercontent.com/48062697/113065582-055aae80-91b1-11eb-8ade-2b58e6d81883.gif)
+//
+// #### Magic Renames
+//
+// rust-analyzer supports some special renames that do additional magic:
+//
+// - **Anonymous lifetime renames**. You can rename `'_` to any lifetime name (the new name must start with `'`),
+// and rust-analyzer will automatically add the new lifetime to the list of generic parameters.
+// - **`self` renames**. You can rename parameters to/from `self`. Renaming `self` into another name will update
+// all callers using method syntax to call the function like an associated function. Renaming to `self` is only
+// supported for the first parameter inside an `impl` and when the `Self` type matches the type of the parameter,
+// and will update callers to use method call syntax.
pub(crate) fn rename(
db: &RootDatabase,
position: FilePosition,