mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-259050 refactor this: don't suggest Move Instance Method under constructor declaration
GitOrigin-RevId: f3fd88cdbc1ec8eb6cfd916673b4b22aea7e6f46
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6b0c0c462d
commit
db251eff72
+1
@@ -36,6 +36,7 @@ public class MoveInstanceMethodHandlerDelegate extends MoveHandlerDelegate {
|
||||
if (!(element instanceof PsiMethod)) return false;
|
||||
if (element instanceof SyntheticElement) return false;
|
||||
PsiMethod method = (PsiMethod) element;
|
||||
if (method.isConstructor()) return false;
|
||||
if (method.hasModifierProperty(PsiModifier.STATIC)) return false;
|
||||
return targetContainer == null || super.canMove(elements, targetContainer, reference);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
public class Test {
|
||||
Test<caret>() {}
|
||||
}
|
||||
@@ -103,6 +103,10 @@ class RefactorThisTest: LightJavaCodeInsightTestCase() {
|
||||
assertTrue(doActionExists<MoveAction>())
|
||||
}
|
||||
|
||||
fun testMoveOnClassDeclaration() {
|
||||
assertTrue(doActionExists<MoveAction>())
|
||||
}
|
||||
|
||||
private inline fun <reified A> doActionExists(): Boolean {
|
||||
configureByFile("$BASE_PATH/${getTestName(false)}.java")
|
||||
return findAvailableActions().any { action -> action is A }
|
||||
|
||||
Reference in New Issue
Block a user