Do not show "Convert to extension" intention for secondary constructors

#KT-6969 Fixed
This commit is contained in:
Denis Zharkov
2015-03-12 20:18:37 +03:00
committed by Alexey Sedunov
parent d1308ebf84
commit 4b564fcc51
3 changed files with 11 additions and 0 deletions
@@ -71,6 +71,7 @@ public class ConvertMemberToExtension extends BaseIntentionAction {
if (((JetProperty) declaration).hasInitializer()) return false;
}
return declaration != null
&& !(declaration instanceof JetSecondaryConstructor)
&& declaration.getParent() instanceof JetClassBody
&& declaration.getParent().getParent() instanceof JetClass
&& declaration.getReceiverTypeReference() == null;
@@ -0,0 +1,4 @@
// IS_APPLICABLE: false
class A {
<caret>constructor() {}
}
@@ -4014,6 +4014,12 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
doTest(fileName);
}
@TestMetadata("secondaryConstructor.kt")
public void testSecondaryConstructor() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/intentions/declarations/convertMemberToExtension/secondaryConstructor.kt");
doTest(fileName);
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/intentions/declarations/convertMemberToExtension/simple.kt");