Review changes: revert compiler behaviour, add test, remove inner classes

This commit is contained in:
Nikolay Krasko
2019-03-11 15:45:12 +03:00
committed by Nikolay Krasko
parent 6ba134b1be
commit 213b98fefe
5 changed files with 83 additions and 55 deletions
@@ -34,6 +34,7 @@ import org.jetbrains.kotlin.resolve.scopes.DescriptorKindExclude
import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter
import org.jetbrains.kotlin.resolve.scopes.receivers.ExpressionReceiver
import org.jetbrains.kotlin.util.capitalizeDecapitalize.decapitalizeSmart
import org.jetbrains.kotlin.util.capitalizeDecapitalize.decapitalizeSmartForCompiler
import java.util.*
data class ReferenceVariants(val imported: Collection<DeclarationDescriptor>, val notImportedExtensions: Collection<CallableDescriptor>)
@@ -121,7 +122,7 @@ class ReferenceVariantsCollector(
val getOrSetPrefix = GET_SET_PREFIXES.firstOrNull { prefix.startsWith(it) }
val additionalPropertyNameFilter: ((String) -> Boolean)? = getOrSetPrefix
?.let { prefixMatcher.cloneWithPrefix(prefix.removePrefix(getOrSetPrefix).decapitalizeSmart()).asStringNameFilter() }
?.let { prefixMatcher.cloneWithPrefix(prefix.removePrefix(getOrSetPrefix).decapitalizeSmartForCompiler()).asStringNameFilter() }
val shadowedDeclarationsFilter = if (runtimeReceiver != null)
ShadowedDeclarationsFilter(bindingContext, resolutionFacade, nameExpression, runtimeReceiver)
@@ -0,0 +1,9 @@
fun a() {
val SOME_CONSTANT = 1
<selection>SOME_CONSTANT</selection>
}
/*
constant
i
someConstant
*/
@@ -38,6 +38,8 @@ class KotlinNameSuggesterTest : KotlinLightCodeInsightFixtureTestCase() {
fun testNameReferenceExpression() = doTest()
fun testNameReferenceExpressionForConstants() = doTest()
fun testNameString() = doTest()
fun testAnonymousObject() = doTest()