diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/BindingContextUtils.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/BindingContextUtils.kt index c031d077976..33d2178daf2 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/BindingContextUtils.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/BindingContextUtils.kt @@ -17,18 +17,19 @@ package org.jetbrains.kotlin.resolve.bindingContextUtil import org.jetbrains.kotlin.descriptors.DeclarationDescriptor -import org.jetbrains.kotlin.resolve.BindingContext import org.jetbrains.kotlin.descriptors.FunctionDescriptor -import org.jetbrains.kotlin.resolve.BindingContext.LABEL_TARGET -import org.jetbrains.kotlin.resolve.BindingContext.FUNCTION -import org.jetbrains.kotlin.resolve.BindingContext.DECLARATION_TO_DESCRIPTOR -import org.jetbrains.kotlin.psi.psiUtil.getNonStrictParentOfType -import org.jetbrains.kotlin.resolve.DescriptorUtils import org.jetbrains.kotlin.descriptors.impl.AnonymousFunctionDescriptor import org.jetbrains.kotlin.psi.* +import org.jetbrains.kotlin.psi.psiUtil.getNonStrictParentOfType +import org.jetbrains.kotlin.resolve.BindingContext +import org.jetbrains.kotlin.resolve.BindingContext.DECLARATION_TO_DESCRIPTOR +import org.jetbrains.kotlin.resolve.BindingContext.FUNCTION +import org.jetbrains.kotlin.resolve.BindingContext.LABEL_TARGET import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils -import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowInfo +import org.jetbrains.kotlin.resolve.DescriptorUtils import org.jetbrains.kotlin.resolve.calls.context.ResolutionContext +import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowInfo +import org.jetbrains.kotlin.resolve.scopes.WritableScope import org.jetbrains.kotlin.types.expressions.typeInfoFactory.noTypeInfo public fun JetReturnExpression.getTargetFunctionDescriptor(context: BindingContext): FunctionDescriptor? { @@ -55,7 +56,9 @@ public fun JetExpression.isUsedAsStatement(context: BindingContext): Boolean = ! public fun > ResolutionContext.recordScopeAndDataFlowInfo(expression: JetExpression?) { if (expression == null) return - trace.record(BindingContext.RESOLUTION_SCOPE, expression, scope) + val scopeToRecord = if (scope is WritableScope) scope.takeSnapshot() else scope + trace.record(BindingContext.RESOLUTION_SCOPE, expression, scopeToRecord) + val typeInfo = trace.get(BindingContext.EXPRESSION_TYPE_INFO, expression) if (typeInfo != null) { trace.record(BindingContext.EXPRESSION_TYPE_INFO, expression, typeInfo.replaceDataFlowInfo(dataFlowInfo)) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/scopes/WritableScope.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/scopes/WritableScope.kt index 78aba76d8da..37d0220cc0b 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/scopes/WritableScope.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/scopes/WritableScope.kt @@ -27,6 +27,8 @@ public trait WritableScope : JetScope { READING } + public fun takeSnapshot(): JetScope + public fun changeLockLevel(lockLevel: LockLevel): WritableScope public fun addLabeledDeclaration(descriptor: DeclarationDescriptor) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/scopes/WritableScopeImpl.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/scopes/WritableScopeImpl.kt index 353cf05e404..ec0ad5257a7 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/scopes/WritableScopeImpl.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/scopes/WritableScopeImpl.kt @@ -32,7 +32,7 @@ import org.jetbrains.kotlin.util.collectionUtils.concatInOrder // Writes to: maps -public class WritableScopeImpl(override val workerScope: JetScope, +public class WritableScopeImpl(outerScope: JetScope, private val ownerDeclarationDescriptor: DeclarationDescriptor, protected val redeclarationHandler: RedeclarationHandler, private val debugName: String) @@ -40,9 +40,9 @@ public class WritableScopeImpl(override val workerScope: JetScope, private val explicitlyAddedDescriptors = SmartList() - private var functionGroups: MutableMap>? = null + private var functionGroups: MutableMap>? = null - private var variableOrClassDescriptors: MutableMap? = null + private var variableOrClassDescriptors: MutableMap>? = null //TODO: implement SmartIntList private var labelsToDescriptors: MutableMap>? = null @@ -52,8 +52,12 @@ public class WritableScopeImpl(override val workerScope: JetScope, override fun getContainingDeclaration(): DeclarationDescriptor = ownerDeclarationDescriptor + private var lastSnapshot: Snapshot? = null + private var lockLevel: WritableScope.LockLevel = WritableScope.LockLevel.WRITING + override val workerScope: JetScope = if (outerScope is WritableScope) outerScope.takeSnapshot() else outerScope + override fun changeLockLevel(lockLevel: WritableScope.LockLevel): WritableScope { if (lockLevel.ordinal() < this.lockLevel.ordinal()) { throw IllegalStateException("cannot lower lock level from " + this.lockLevel + " to " + lockLevel + " at " + toString()) @@ -74,6 +78,14 @@ public class WritableScopeImpl(override val workerScope: JetScope, } } + override fun takeSnapshot(): JetScope { + checkMayRead() + if (lastSnapshot == null || lastSnapshot!!.descriptorLimit != explicitlyAddedDescriptors.size()) { + lastSnapshot = Snapshot(explicitlyAddedDescriptors.size()) + } + return lastSnapshot!! + } + override fun getDescriptors(kindFilter: DescriptorKindFilter, nameFilter: (Name) -> Boolean): Collection { checkMayRead() @@ -108,17 +120,18 @@ public class WritableScopeImpl(override val workerScope: JetScope, val name = descriptor.getName() - val originalDescriptor = variableOrClassDescriptors?.get(name) + val originalDescriptor = variableOrClassDescriptorByName(name) if (originalDescriptor != null) { redeclarationHandler.handleRedeclaration(originalDescriptor, descriptor) } + val descriptorIndex = addDescriptor(descriptor) + if (variableOrClassDescriptors == null) { variableOrClassDescriptors = HashMap() } - variableOrClassDescriptors!!.put(name, descriptor) + variableOrClassDescriptors!!.getOrPut(descriptor.getName()) { SmartList() }.add(descriptorIndex) - explicitlyAddedDescriptors.add(descriptor) } override fun addVariableDescriptor(variableDescriptor: VariableDescriptor) { @@ -128,7 +141,7 @@ public class WritableScopeImpl(override val workerScope: JetScope, override fun getLocalVariable(name: Name): VariableDescriptor? { checkMayRead() - val descriptor = variableOrClassDescriptors?.get(name) + val descriptor = variableOrClassDescriptorByName(name) if (descriptor is VariableDescriptor) { return descriptor } @@ -139,18 +152,18 @@ public class WritableScopeImpl(override val workerScope: JetScope, override fun addFunctionDescriptor(functionDescriptor: FunctionDescriptor) { checkMayWrite() + val descriptorIndex = addDescriptor(functionDescriptor) + if (functionGroups == null) { functionGroups = HashMap(1) } - functionGroups!!.getOrPut(functionDescriptor.getName()) { SmartList() }.add(functionDescriptor) - explicitlyAddedDescriptors.add(functionDescriptor) + functionGroups!!.getOrPut(functionDescriptor.getName()) { SmartList() }.add(descriptorIndex) } override fun getFunctions(name: Name): Collection { checkMayRead() - val functionGroupByName = functionGroups?.get(name) - return concatInOrder(functionGroupByName, workerScope.getFunctions(name)) + return concatInOrder(functionsByName(name), workerScope.getFunctions(name)) } override fun addClassifierDescriptor(classifierDescriptor: ClassifierDescriptor) { @@ -160,7 +173,7 @@ public class WritableScopeImpl(override val workerScope: JetScope, override fun getClassifier(name: Name): ClassifierDescriptor? { checkMayRead() - return variableOrClassDescriptors?.get(name) as? ClassifierDescriptor + return variableOrClassDescriptorByName(name) as? ClassifierDescriptor ?: workerScope.getClassifier(name) } @@ -191,6 +204,35 @@ public class WritableScopeImpl(override val workerScope: JetScope, override fun getOwnDeclaredDescriptors(): Collection = explicitlyAddedDescriptors + private fun variableOrClassDescriptorByName(name: Name, descriptorLimit: Int = explicitlyAddedDescriptors.size()): DeclarationDescriptor? { + val descriptorIndices = variableOrClassDescriptors?.get(name) ?: return null + for (i in descriptorIndices.indices.reversed()) { + val descriptorIndex = descriptorIndices[i] + if (descriptorIndex < descriptorLimit) { + return descriptorIndex.descriptorByIndex() + } + } + return null + } + + private fun functionsByName(name: Name, descriptorLimit: Int = explicitlyAddedDescriptors.size()): List? { + val descriptorIndices = functionGroups?.get(name) ?: return null + for (i in descriptorIndices.indices.reversed()) { + val descriptorIndex = descriptorIndices[i] + if (descriptorIndex < descriptorLimit) { + return descriptorIndices.truncated(descriptorIndex + 1).map { it.descriptorByIndex() as FunctionDescriptor } + } + } + return null + } + + private fun addDescriptor(descriptor: DeclarationDescriptor): Int { + explicitlyAddedDescriptors.add(descriptor) + return explicitlyAddedDescriptors.size() - 1 + } + + private fun Int.descriptorByIndex() = explicitlyAddedDescriptors[this] + override fun toString(): String { return javaClass.getSimpleName() + "@" + Integer.toHexString(System.identityHashCode(this)) + " " + debugName + " for " + getContainingDeclaration() } @@ -207,4 +249,65 @@ public class WritableScopeImpl(override val workerScope: JetScope, p.popIndent() p.println("}") } + + + private fun List.truncated(newSize: Int) = if (newSize == size()) this else subList(0, newSize) + + private inner class Snapshot(val descriptorLimit: Int) : JetScope by this@WritableScopeImpl { + override fun getDescriptors(kindFilter: DescriptorKindFilter, + nameFilter: (Name) -> Boolean): Collection { + checkMayRead() + changeLockLevel(WritableScope.LockLevel.READING) + + val workerResult = workerScope.getDescriptors(kindFilter, nameFilter) + + if (descriptorLimit == 0) return workerResult + + val result = ArrayList(workerResult.size() + descriptorLimit) + for (i in 0..descriptorLimit-1) { + result.add(explicitlyAddedDescriptors[i]) + } + result.addAll(workerResult) + return result + } + + override fun getLocalVariable(name: Name): VariableDescriptor? { + checkMayRead() + + val descriptor = variableOrClassDescriptorByName(name, descriptorLimit) + if (descriptor is VariableDescriptor) { + return descriptor + } + + return workerScope.getLocalVariable(name) + } + + override fun getFunctions(name: Name): Collection { + checkMayRead() + + return concatInOrder(functionsByName(name, descriptorLimit), workerScope.getFunctions(name)) + } + + override fun getClassifier(name: Name): ClassifierDescriptor? { + checkMayRead() + + return variableOrClassDescriptorByName(name, descriptorLimit) as? ClassifierDescriptor + ?: workerScope.getClassifier(name) + } + + override fun getOwnDeclaredDescriptors(): Collection = explicitlyAddedDescriptors.truncated(descriptorLimit) + + override fun printScopeStructure(p: Printer) { + p.println(javaClass.getSimpleName(), " {") + p.pushIndent() + + p.println("descriptorLimit = ", descriptorLimit) + + p.print("WritableScope = ") + this@WritableScopeImpl.printScopeStructure(p.withholdIndentOnce()) + + p.popIndent() + p.println("}") + } + } } diff --git a/idea/ide-common/src/org/jetbrains/kotlin/idea/codeInsight/ReferenceVariantsHelper.kt b/idea/ide-common/src/org/jetbrains/kotlin/idea/codeInsight/ReferenceVariantsHelper.kt index 836d369011a..83fbe3443b2 100644 --- a/idea/ide-common/src/org/jetbrains/kotlin/idea/codeInsight/ReferenceVariantsHelper.kt +++ b/idea/ide-common/src/org/jetbrains/kotlin/idea/codeInsight/ReferenceVariantsHelper.kt @@ -75,7 +75,7 @@ public class ReferenceVariantsHelper( nameFilter: (Name) -> Boolean ): Collection { val parent = expression.getParent() - val resolutionScope = context.correctedResolutionScope(expression) ?: return listOf() + val resolutionScope = context[BindingContext.RESOLUTION_SCOPE, expression] ?: return listOf() val containingDeclaration = resolutionScope.getContainingDeclaration() if (parent is JetImportDirective || parent is JetPackageDirective) { diff --git a/idea/ide-common/src/org/jetbrains/kotlin/idea/util/ShadowedDeclarationsFilter.kt b/idea/ide-common/src/org/jetbrains/kotlin/idea/util/ShadowedDeclarationsFilter.kt index df64dc590a0..1efb156fb67 100644 --- a/idea/ide-common/src/org/jetbrains/kotlin/idea/util/ShadowedDeclarationsFilter.kt +++ b/idea/ide-common/src/org/jetbrains/kotlin/idea/util/ShadowedDeclarationsFilter.kt @@ -156,7 +156,7 @@ public class ShadowedDeclarationsFilter( } val calleeExpression = call.getCalleeExpression() ?: return descriptors - var resolutionScope = bindingContext.correctedResolutionScope(calleeExpression) ?: return descriptors + var resolutionScope = bindingContext[BindingContext.RESOLUTION_SCOPE, calleeExpression] ?: return descriptors if (descriptorsToImport.isNotEmpty()) { resolutionScope = ChainedScope(resolutionScope.getContainingDeclaration(), "Scope with explicitly imported descriptors", diff --git a/idea/ide-common/src/org/jetbrains/kotlin/idea/util/Utils.kt b/idea/ide-common/src/org/jetbrains/kotlin/idea/util/Utils.kt index 31ee368c5af..8bd0518e496 100644 --- a/idea/ide-common/src/org/jetbrains/kotlin/idea/util/Utils.kt +++ b/idea/ide-common/src/org/jetbrains/kotlin/idea/util/Utils.kt @@ -16,15 +16,8 @@ package org.jetbrains.kotlin.idea.util -import org.jetbrains.kotlin.descriptors.DeclarationDescriptor -import org.jetbrains.kotlin.descriptors.VariableDescriptor import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.psi.* -import org.jetbrains.kotlin.psi.psiUtil.parentsWithSelf -import org.jetbrains.kotlin.resolve.BindingContext -import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter -import org.jetbrains.kotlin.resolve.scopes.JetScope -import org.jetbrains.kotlin.utils.addIfNotNull public fun JetFunctionLiteral.findLabelAndCall(): Pair { val literalParent = (this.getParent() as JetFunctionLiteralExpression).getParent() @@ -51,34 +44,3 @@ public fun JetFunctionLiteral.findLabelAndCall(): Pair() - for (element in expression.parentsWithSelf) { - if (element is JetExpression) { - val declaration = element.getParent() as? JetVariableDeclaration ?: continue - if (element == declaration.getInitializer()) { - variablesToExclude.addIfNotNull(get(BindingContext.VARIABLE, declaration)) - } - } - } - - if (variablesToExclude.isEmpty()) return scope - - return object : JetScope by scope { - override fun getDescriptors(kindFilter: DescriptorKindFilter, nameFilter: (Name) -> Boolean) - = scope.getDescriptors(kindFilter, nameFilter).filter { it !in variablesToExclude } - - //TODO: it's not correct! - override fun getLocalVariable(name: Name): VariableDescriptor? { - val variable = scope.getLocalVariable(name) ?: return null - return if (variable in variablesToExclude) null else variable - } - - override fun getProperties(name: Name) = scope.getProperties(name).filter { it !in variablesToExclude } - } -} \ No newline at end of file diff --git a/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/CompletionSession.kt b/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/CompletionSession.kt index 426398ffd06..4ab60af5a1e 100644 --- a/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/CompletionSession.kt +++ b/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/CompletionSession.kt @@ -198,13 +198,28 @@ abstract class CompletionSessionBase(protected val configuration: CompletionSess // set is used only for completion in code fragments protected val referenceVariants: Collection by Delegates.lazy { if (descriptorKindFilter != null) { - referenceVariantsHelper.getReferenceVariants(reference!!.expression, descriptorKindFilter!!, false, prefixMatcher.asNameFilter()) + val expression = reference!!.expression + referenceVariantsHelper.getReferenceVariants(expression, descriptorKindFilter!!, false, prefixMatcher.asNameFilter()) + .excludeNonInitializedVariable(expression) } else { emptyList() } } + // filters out variable inside its initializer + private fun Collection.excludeNonInitializedVariable(expression: JetExpression): Collection { + for (element in expression.parentsWithSelf) { + val parent = element.getParent() + if (parent is JetVariableDeclaration && element == parent.getInitializer()) { + val descriptor = bindingContext[BindingContext.DECLARATION_TO_DESCRIPTOR, parent] + return this.filter { it != descriptor } + } + if (element is JetDeclaration) break // we can use variable inside lambda or anonymous object located in its initializer + } + return this + } + protected fun getRuntimeReceiverTypeReferenceVariants(): Collection { val descriptors = referenceVariantsHelper.getReferenceVariants(reference!!.expression, descriptorKindFilter!!, true, prefixMatcher.asNameFilter()) return descriptors.filter { descriptor -> diff --git a/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/smart/MultipleArgumentsItemProvider.kt b/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/smart/MultipleArgumentsItemProvider.kt index ff3eb94709a..9aed5a60b5e 100644 --- a/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/smart/MultipleArgumentsItemProvider.kt +++ b/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/smart/MultipleArgumentsItemProvider.kt @@ -25,7 +25,6 @@ import org.jetbrains.kotlin.descriptors.VariableDescriptor import org.jetbrains.kotlin.idea.JetDescriptorIconProvider import org.jetbrains.kotlin.idea.completion.* import org.jetbrains.kotlin.idea.util.IdeDescriptorRenderers -import org.jetbrains.kotlin.idea.util.correctedResolutionScope import org.jetbrains.kotlin.psi.JetExpression import org.jetbrains.kotlin.renderer.render import org.jetbrains.kotlin.resolve.BindingContext @@ -41,7 +40,7 @@ class MultipleArgumentsItemProvider(val bindingContext: BindingContext, public fun addToCollection(collection: MutableCollection, expectedInfos: Collection, context: JetExpression) { - val resolutionScope = bindingContext.correctedResolutionScope(context) ?: return + val resolutionScope = bindingContext[BindingContext.RESOLUTION_SCOPE, context] ?: return val added = HashSet() for (expectedInfo in expectedInfos) { diff --git a/idea/idea-completion/testData/basic/common/NoLocalsDeclaredAhead.kt b/idea/idea-completion/testData/basic/common/NoLocalsDeclaredAhead.kt new file mode 100644 index 00000000000..54b08b5b50b --- /dev/null +++ b/idea/idea-completion/testData/basic/common/NoLocalsDeclaredAhead.kt @@ -0,0 +1,8 @@ +fun foo() { + val v = { + + val hello = 1 + hello + } +} +// ABSENT: hello \ No newline at end of file diff --git a/idea/idea-completion/testData/basic/common/shadowing/InInitializer4.kt b/idea/idea-completion/testData/basic/common/shadowing/InInitializer4.kt new file mode 100644 index 00000000000..d577c202bd7 --- /dev/null +++ b/idea/idea-completion/testData/basic/common/shadowing/InInitializer4.kt @@ -0,0 +1,18 @@ +val xxx = 3 + +fun foo(xxx: Int) { + val xxx = 1.0 + + if (true) { + val xxx = 'c' + + if (true) { + val xxx: Any = run { + val xxx: String = xx + } + } + } +} + +// EXIST: { lookupString: "xxx", itemText: "xxx", typeText: "Char" } +// NOTHING_ELSE diff --git a/idea/idea-completion/testData/basic/common/shadowing/InInitializer5.kt b/idea/idea-completion/testData/basic/common/shadowing/InInitializer5.kt new file mode 100644 index 00000000000..4698409c170 --- /dev/null +++ b/idea/idea-completion/testData/basic/common/shadowing/InInitializer5.kt @@ -0,0 +1,3 @@ +val xxx: String = + +// ABSENT: xxx diff --git a/idea/idea-completion/testData/basic/common/shadowing/InInitializer6.kt b/idea/idea-completion/testData/basic/common/shadowing/InInitializer6.kt new file mode 100644 index 00000000000..9222b5dfcae --- /dev/null +++ b/idea/idea-completion/testData/basic/common/shadowing/InInitializer6.kt @@ -0,0 +1,5 @@ +fun foo(p: () -> Unit): String = "" + +val xxx: String = foo { } + +// EXIST: xxx diff --git a/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/JSBasicCompletionTestGenerated.java b/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/JSBasicCompletionTestGenerated.java index 169b861bf69..46d5a5f1d4f 100644 --- a/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/JSBasicCompletionTestGenerated.java +++ b/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/JSBasicCompletionTestGenerated.java @@ -823,6 +823,12 @@ public class JSBasicCompletionTestGenerated extends AbstractJSBasicCompletionTes doTest(fileName); } + @TestMetadata("NoLocalsDeclaredAhead.kt") + public void testNoLocalsDeclaredAhead() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/NoLocalsDeclaredAhead.kt"); + doTest(fileName); + } + @TestMetadata("NoNestedClassAfterReceiver.kt") public void testNoNestedClassAfterReceiver() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/NoNestedClassAfterReceiver.kt"); @@ -1422,6 +1428,24 @@ public class JSBasicCompletionTestGenerated extends AbstractJSBasicCompletionTes doTest(fileName); } + @TestMetadata("InInitializer4.kt") + public void testInInitializer4() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/InInitializer4.kt"); + doTest(fileName); + } + + @TestMetadata("InInitializer5.kt") + public void testInInitializer5() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/InInitializer5.kt"); + doTest(fileName); + } + + @TestMetadata("InInitializer6.kt") + public void testInInitializer6() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/InInitializer6.kt"); + doTest(fileName); + } + @TestMetadata("Locals1.kt") public void testLocals1() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/Locals1.kt"); diff --git a/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/JvmBasicCompletionTestGenerated.java b/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/JvmBasicCompletionTestGenerated.java index e9aaf98e02d..7bc7a1b7797 100644 --- a/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/JvmBasicCompletionTestGenerated.java +++ b/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/JvmBasicCompletionTestGenerated.java @@ -823,6 +823,12 @@ public class JvmBasicCompletionTestGenerated extends AbstractJvmBasicCompletionT doTest(fileName); } + @TestMetadata("NoLocalsDeclaredAhead.kt") + public void testNoLocalsDeclaredAhead() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/NoLocalsDeclaredAhead.kt"); + doTest(fileName); + } + @TestMetadata("NoNestedClassAfterReceiver.kt") public void testNoNestedClassAfterReceiver() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/NoNestedClassAfterReceiver.kt"); @@ -1422,6 +1428,24 @@ public class JvmBasicCompletionTestGenerated extends AbstractJvmBasicCompletionT doTest(fileName); } + @TestMetadata("InInitializer4.kt") + public void testInInitializer4() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/InInitializer4.kt"); + doTest(fileName); + } + + @TestMetadata("InInitializer5.kt") + public void testInInitializer5() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/InInitializer5.kt"); + doTest(fileName); + } + + @TestMetadata("InInitializer6.kt") + public void testInInitializer6() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/InInitializer6.kt"); + doTest(fileName); + } + @TestMetadata("Locals1.kt") public void testLocals1() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/Locals1.kt");