mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-30 18:27:49 +08:00
safe_delete_refactoring.md: cleanup
This commit is contained in:
parent
530a7b74c1
commit
09d7dc950c
@ -3,18 +3,19 @@ title: Safe Delete Refactoring
|
||||
---
|
||||
|
||||
|
||||
The `Safe Delete` refactoring also builds on the same `Find Usages` framework as `Rename`.
|
||||
In addition to that, in order to support `Safe Delete`, a plugin needs to implement two things:
|
||||
The _Safe Delete_ refactoring also builds on the same [Find Usages](find_usages.md) framework as [Rename Refactoring](rename_refactoring.md).
|
||||
|
||||
In addition to that, to support _Safe Delete_, a plugin needs to implement two things:
|
||||
|
||||
* The
|
||||
[`RefactoringSupportProvider`](upsource:///platform/lang-api/src/com/intellij/lang/refactoring/RefactoringSupportProvider.java)
|
||||
interface, registered in the `com.intellij.lang.refactoringSupport` extension point, and the `isSafeDeleteAvailable()` method, which checks if the `Safe Delete` refactoring is available for a specific PSI element
|
||||
interface, registered in the `com.intellij.lang.refactoringSupport` extension point, and the `isSafeDeleteAvailable()` method, which checks if the _Safe Delete_ refactoring is available for a specific PSI element
|
||||
|
||||
* The
|
||||
[`PsiElement.delete()`](upsource:///platform/core-api/src/com/intellij/psi/PsiElement.java)<!--#L371-->
|
||||
method for the
|
||||
[`PsiElement`](upsource:///platform/core-api/src/com/intellij/psi/PsiElement.java)
|
||||
subclasses for which `Safe Delete` is available.
|
||||
subclasses for which _Safe Delete_ is available.
|
||||
Deleting PSI elements is implemented by deleting the underlying AST nodes from the AST tree (which, in turn, causes the text ranges corresponding to the AST nodes to be deleted from the document).
|
||||
|
||||
|
||||
@ -24,8 +25,8 @@ implementation for a Property in
|
||||
[Properties language plugin](upsource:///plugins/properties/)
|
||||
|
||||
|
||||
If needed, it's possible to further customize how Safe Delete is performed for a particular type of element (how references are searched, etc).
|
||||
This is done by implementing the `SafeDeleteProcessorDelegate` interface.
|
||||
If needed, it's possible to further customize how _Safe Delete_ is performed for a particular type of element (e.g., how references are searched)
|
||||
via [`SafeDeleteProcessorDelegate`](upsource:///platform/lang-impl/src/com/intellij/refactoring/safeDelete/SafeDeleteProcessorDelegate.java).
|
||||
|
||||
|
||||
**Example**:
|
||||
|
Loading…
x
Reference in New Issue
Block a user