|
1 | 1 | /*
|
2 |
| - * Copyright 2010-2016 JetBrains s.r.o. |
| 2 | + * Copyright 2010-2017 JetBrains s.r.o. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -181,7 +181,7 @@ class KtPsiFactory(private val project: Project) {
|
181 | 181 | }
|
182 | 182 |
|
183 | 183 | fun createCompanionObject(): KtObjectDeclaration {
|
184 |
| - return createClass("class A {\n companion object{\n}\n}").getCompanionObjects().first() |
| 184 | + return createClass("class A {\n companion object{\n}\n}").companionObjects.first() |
185 | 185 | }
|
186 | 186 |
|
187 | 187 | fun createFileAnnotation(annotationText: String): KtAnnotationEntry {
|
@@ -293,7 +293,7 @@ class KtPsiFactory(private val project: Project) {
|
293 | 293 | fun createCallableReferenceExpression(text: String) = createExpression(text) as? KtCallableReferenceExpression
|
294 | 294 |
|
295 | 295 | fun createSecondaryConstructor(decl: String): KtSecondaryConstructor {
|
296 |
| - return createClass("class Foo {\n $decl \n}").getSecondaryConstructors().first() |
| 296 | + return createClass("class Foo {\n $decl \n}").secondaryConstructors.first() |
297 | 297 | }
|
298 | 298 |
|
299 | 299 | fun createModifierList(modifier: KtModifierKeywordToken): KtModifierList {
|
@@ -326,7 +326,7 @@ class KtPsiFactory(private val project: Project) {
|
326 | 326 | }
|
327 | 327 |
|
328 | 328 | fun createParameter(text : String): KtParameter {
|
329 |
| - return createClass("class A($text)").getPrimaryConstructorParameters().first() |
| 329 | + return createClass("class A($text)").primaryConstructorParameters.first() |
330 | 330 | }
|
331 | 331 |
|
332 | 332 | fun createParameterList(text: String): KtParameterList {
|
@@ -401,15 +401,15 @@ class KtPsiFactory(private val project: Project) {
|
401 | 401 | }
|
402 | 402 |
|
403 | 403 | fun createPrimaryConstructor(): KtPrimaryConstructor {
|
404 |
| - return createClass("class A()").getPrimaryConstructor()!! |
| 404 | + return createClass("class A()").primaryConstructor!! |
405 | 405 | }
|
406 | 406 |
|
407 | 407 | fun createPrimaryConstructor(modifiers: String?): KtPrimaryConstructor {
|
408 |
| - return modifiers?.let { createClass("class A $modifiers constructor()").getPrimaryConstructor() } ?: createPrimaryConstructor() |
| 408 | + return modifiers?.let { createClass("class A $modifiers constructor()").primaryConstructor } ?: createPrimaryConstructor() |
409 | 409 | }
|
410 | 410 |
|
411 | 411 | fun createConstructorKeyword(): PsiElement =
|
412 |
| - createClass("class A constructor()").getPrimaryConstructor()!!.getConstructorKeyword()!! |
| 412 | + createClass("class A constructor()").primaryConstructor!!.getConstructorKeyword()!! |
413 | 413 |
|
414 | 414 | fun createLabeledExpression(labelName: String): KtLabeledExpression
|
415 | 415 | = createExpression("$labelName@ 1") as KtLabeledExpression
|
@@ -456,16 +456,16 @@ class KtPsiFactory(private val project: Project) {
|
456 | 456 | fun createArgument(text: String) = createCallArguments("($text)").arguments.first()!!
|
457 | 457 |
|
458 | 458 | fun createSuperTypeCallEntry(text: String): KtSuperTypeCallEntry {
|
459 |
| - return createClass("class A: $text").getSuperTypeListEntries().first() as KtSuperTypeCallEntry |
| 459 | + return createClass("class A: $text").superTypeListEntries.first() as KtSuperTypeCallEntry |
460 | 460 | }
|
461 | 461 |
|
462 | 462 | fun createSuperTypeEntry(text: String): KtSuperTypeEntry {
|
463 |
| - return createClass("class A: $text").getSuperTypeListEntries().first() as KtSuperTypeEntry |
| 463 | + return createClass("class A: $text").superTypeListEntries.first() as KtSuperTypeEntry |
464 | 464 | }
|
465 | 465 |
|
466 | 466 | fun creareDelegatedSuperTypeEntry(text: String): KtConstructorDelegationCall {
|
467 | 467 | val colonOrEmpty = if (text.isEmpty()) "" else ": "
|
468 |
| - return createClass("class A { constructor()$colonOrEmpty$text {}").getSecondaryConstructors().first().getDelegationCall() |
| 468 | + return createClass("class A { constructor()$colonOrEmpty$text {}").secondaryConstructors.first().getDelegationCall() |
469 | 469 | }
|
470 | 470 |
|
471 | 471 | class ClassHeaderBuilder {
|
|
0 commit comments