LookupLocation.NO_LOCATION_FROM_TEST -> NoLookupLocation.FROM_TEST

This commit is contained in:
Zalim Bashorov
2015-08-17 23:15:09 +03:00
parent 595975a66e
commit 8e7786817d
9 changed files with 29 additions and 30 deletions
@@ -20,7 +20,7 @@ import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCa
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.idea.caches.resolve.resolveToDescriptor
import org.jetbrains.kotlin.idea.test.PluginTestCaseBase
import org.jetbrains.kotlin.incremental.components.LookupLocation
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.psi.JetFile
import org.junit.Assert
@@ -43,7 +43,7 @@ public class KDocFinderTest() : LightPlatformCodeInsightFixtureTestCase() {
myFixture.configureByFile(getTestName(false) + ".kt")
val declaration = (myFixture.getFile() as JetFile).getDeclarations().single { it.getName() == "Bar" }
val descriptor = declaration.resolveToDescriptor() as ClassDescriptor
val overriddenFunctionDescriptor = descriptor.defaultType.memberScope.getFunctions(Name.identifier("xyzzy"), LookupLocation.NO_LOCATION_FROM_TEST).single()
val overriddenFunctionDescriptor = descriptor.defaultType.memberScope.getFunctions(Name.identifier("xyzzy"), NoLookupLocation.FROM_TEST).single()
val doc = KDocFinder.findKDoc(overriddenFunctionDescriptor)
Assert.assertEquals("Doc for method xyzzy", doc!!.getContent())
}
@@ -52,7 +52,7 @@ public class KDocFinderTest() : LightPlatformCodeInsightFixtureTestCase() {
myFixture.configureByFile(getTestName(false) + ".kt")
val declaration = (myFixture.getFile() as JetFile).getDeclarations().single { it.getName() == "Bar" }
val descriptor = declaration.resolveToDescriptor() as ClassDescriptor
val overriddenFunctionDescriptor = descriptor.defaultType.memberScope.getFunctions(Name.identifier("xyzzy"), LookupLocation.NO_LOCATION_FROM_TEST).single()
val overriddenFunctionDescriptor = descriptor.defaultType.memberScope.getFunctions(Name.identifier("xyzzy"), NoLookupLocation.FROM_TEST).single()
val doc = KDocFinder.findKDoc(overriddenFunctionDescriptor)
Assert.assertEquals("Doc for method xyzzy", doc!!.getContent())
}
@@ -61,7 +61,7 @@ public class KDocFinderTest() : LightPlatformCodeInsightFixtureTestCase() {
myFixture.configureByFile(getTestName(false) + ".kt")
val declaration = (myFixture.getFile() as JetFile).getDeclarations().single { it.getName() == "Foo" }
val descriptor = declaration.resolveToDescriptor() as ClassDescriptor
val propertyDescriptor = descriptor.defaultType.memberScope.getProperties(Name.identifier("xyzzy"), LookupLocation.NO_LOCATION_FROM_TEST).single()
val propertyDescriptor = descriptor.defaultType.memberScope.getProperties(Name.identifier("xyzzy"), NoLookupLocation.FROM_TEST).single()
val doc = KDocFinder.findKDoc(propertyDescriptor)
Assert.assertEquals("Doc for property xyzzy", doc!!.getContent())
}
@@ -47,7 +47,7 @@ import org.jetbrains.kotlin.idea.search.allScope
import org.jetbrains.kotlin.idea.test.DirectiveBasedActionUtils
import org.jetbrains.kotlin.idea.test.KotlinMultiFileTestCase
import org.jetbrains.kotlin.idea.test.PluginTestCaseBase
import org.jetbrains.kotlin.incremental.components.LookupLocation
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
import org.jetbrains.kotlin.name.*
import org.jetbrains.kotlin.psi.JetFile
import org.jetbrains.kotlin.psi.psiUtil.getNonStrictParentOfType
@@ -186,13 +186,13 @@ public abstract class AbstractRenameTest : KotlinMultiFileTestCase() {
private fun renameKotlinFunctionTest(renameParamsObject: JsonObject, context: TestContext) {
val oldMethodName = Name.identifier(renameParamsObject.getString("oldName"))
doRenameInKotlinClassOrPackage(renameParamsObject, context) { it.getFunctions(oldMethodName, LookupLocation.NO_LOCATION_FROM_TEST).first() }
doRenameInKotlinClassOrPackage(renameParamsObject, context) { it.getFunctions(oldMethodName, NoLookupLocation.FROM_TEST).first() }
}
private fun renameKotlinPropertyTest(renameParamsObject: JsonObject, context: TestContext) {
val oldPropertyName = Name.identifier(renameParamsObject.getString("oldName"))
doRenameInKotlinClassOrPackage(renameParamsObject, context) { it.getProperties(oldPropertyName, LookupLocation.NO_LOCATION_FROM_TEST).first() }
doRenameInKotlinClassOrPackage(renameParamsObject, context) { it.getProperties(oldPropertyName, NoLookupLocation.FROM_TEST).first() }
}
private fun renameKotlinClassTest(renameParamsObject: JsonObject, context: TestContext) {