Support secondary constructors and delegation calls in Change Signature.

Initial support of Find Usages
This commit is contained in:
Denis Zharkov
2015-03-17 11:18:47 +03:00
committed by Alexey Sedunov
parent 488754de7d
commit e05cbf5e9f
13 changed files with 264 additions and 82 deletions
@@ -359,6 +359,11 @@ public class JetPsiFactory(private val project: Project) {
return createClass("class A: $text").getDelegationSpecifiers().first() as JetDelegatorToSuperCall
}
public fun createConstructorDelegationCall(text: String): JetConstructorDelegationCall {
val colonOrEmpty = if (text.isEmpty()) "" else ": "
return createClass("class A { constructor()$colonOrEmpty$text {}").getSecondaryConstructors().first().getDelegationCall()!!
}
public inner class IfChainBuilder() {
private val sb = StringBuilder()
private var first = true
@@ -83,7 +83,7 @@ public class JetSecondaryConstructor extends JetDeclarationStub<KotlinPlaceHolde
@Nullable
@Override
public PsiElement getColon() {
return null;
return findChildByType(JetTokens.COLON);
}
@Nullable