mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-intentions] Edit Contract, Edit Range: remove on references, keep on declarations only
Also fixes EA-945090 - T: PsiSearchHelperImpl.processFilesConcurrentlyDespiteWriteActions GitOrigin-RevId: 94cca91f42d6595a33edc1e8b2ba89ac38ee65bc
This commit is contained in:
committed by
intellij-monorepo-bot
parent
465109fe09
commit
832a845510
+1
-1
@@ -39,7 +39,7 @@ public final class EditContractIntention extends BaseIntentionAction implements
|
||||
}
|
||||
|
||||
private static @Nullable PsiMethod getTargetMethod(Editor editor, PsiFile file) {
|
||||
final PsiModifierListOwner owner = AddAnnotationPsiFix.getContainer(file, editor.getCaretModel().getOffset(), true);
|
||||
final PsiModifierListOwner owner = AddAnnotationPsiFix.getContainer(file, editor.getCaretModel().getOffset());
|
||||
if (owner instanceof PsiMethod && ExternalAnnotationsManagerImpl.areExternalAnnotationsApplicable(owner)) {
|
||||
PsiElement original = owner.getOriginalElement();
|
||||
return original instanceof PsiMethod ? (PsiMethod)original : (PsiMethod)owner;
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ public final class EditRangeIntention extends BaseIntentionAction implements Low
|
||||
|
||||
@Nullable
|
||||
private static PsiModifierListOwner getTarget(Editor editor, PsiFile file) {
|
||||
final PsiModifierListOwner owner = AddAnnotationPsiFix.getContainer(file, editor.getCaretModel().getOffset(), true);
|
||||
final PsiModifierListOwner owner = AddAnnotationPsiFix.getContainer(file, editor.getCaretModel().getOffset());
|
||||
LongRangeSet rangeFromType = rangeFromType(owner);
|
||||
if (rangeFromType == null || !ExternalAnnotationsManagerImpl.areExternalAnnotationsApplicable(owner)) return null;
|
||||
PsiElement original = owner.getOriginalElement();
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// "Replace with 'declaringJavaClass'" "true"
|
||||
// ACTION: Add method contract to 'getDeclaringClass()'...
|
||||
// ACTION: Introduce local variable
|
||||
// ACTION: Put calls on separate lines
|
||||
// ACTION: Replace with 'declaringJavaClass'
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// "Replace with 'declaringJavaClass'" "true"
|
||||
// ACTION: Add method contract to 'getDeclaringClass()'...
|
||||
// ACTION: Introduce local variable
|
||||
// ACTION: Put calls on separate lines
|
||||
// ACTION: Replace with 'declaringJavaClass'
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
// ACTION: Add full qualifier
|
||||
// ACTION: Change parameter 'block' type of function 'str' to 'Object'
|
||||
// ACTION: Create function 'str'
|
||||
// ACTION: Edit method contract of 'Object()'...
|
||||
// ACTION: Introduce import alias
|
||||
fun fn() {
|
||||
str(<caret>Object())
|
||||
|
||||
Reference in New Issue
Block a user