Create From Usage: Generalize function builder for both functions and properties

This commit is contained in:
Alexey Sedunov
2014-09-29 15:02:14 +04:00
parent 9032a6166e
commit be211d7cda
15 changed files with 130 additions and 87 deletions
@@ -216,9 +216,8 @@ public class JetPsiFactory(private val project: Project) {
return createClass("class A(){}").getBody()!!
}
public fun createParameter(name: String, `type`: String): JetParameter {
val function = createFunction("fun foo(" + name + " : " + `type` + ") {}")
return function.getValueParameters().first()
public fun createParameter(text : String): JetParameter {
return createClass("class A($text)").getPrimaryConstructorParameters().first()
}
public fun createParameterList(text: String): JetParameterList {