KT-4893 Code completion should not show multiple functions with the same signature
#KT-4893 Fixed
This commit is contained in:
@@ -39,6 +39,7 @@ import org.jetbrains.kotlin.idea.core.comparePossiblyOverridingDescriptors
|
||||
import org.jetbrains.kotlin.idea.core.isVisible
|
||||
import org.jetbrains.kotlin.idea.references.JetSimpleNameReference
|
||||
import org.jetbrains.kotlin.idea.util.CallType
|
||||
import org.jetbrains.kotlin.idea.util.ShadowedDeclarationsFilter
|
||||
import org.jetbrains.kotlin.idea.util.makeNotNullable
|
||||
import org.jetbrains.kotlin.lexer.JetTokens
|
||||
import org.jetbrains.kotlin.load.java.descriptors.SamConstructorDescriptorKindExclude
|
||||
@@ -74,6 +75,7 @@ abstract class CompletionSessionBase(protected val configuration: CompletionSess
|
||||
private val file = position.getContainingFile() as JetFile
|
||||
protected val resolutionFacade: ResolutionFacade = file.getResolutionFacade()
|
||||
protected val moduleDescriptor: ModuleDescriptor = resolutionFacade.findModuleDescriptor(file)
|
||||
protected val project: Project = position.getProject()
|
||||
|
||||
protected val reference: JetSimpleNameReference?
|
||||
protected val expression: JetExpression?
|
||||
@@ -126,7 +128,7 @@ abstract class CompletionSessionBase(protected val configuration: CompletionSess
|
||||
|
||||
protected val prefixMatcher: PrefixMatcher = this.resultSet.getPrefixMatcher()
|
||||
|
||||
protected val referenceVariantsHelper: ReferenceVariantsHelper = ReferenceVariantsHelper(bindingContext) { isVisibleDescriptor(it) }
|
||||
protected val referenceVariantsHelper: ReferenceVariantsHelper = ReferenceVariantsHelper(bindingContext, moduleDescriptor, project) { isVisibleDescriptor(it) }
|
||||
|
||||
protected val receiversData: ReferenceVariantsHelper.ReceiversData? = reference?.let { referenceVariantsHelper.getReferenceVariantsReceivers(it.expression) }
|
||||
|
||||
@@ -158,8 +160,6 @@ abstract class CompletionSessionBase(protected val configuration: CompletionSess
|
||||
|
||||
protected val collector: LookupElementsCollector = LookupElementsCollector(prefixMatcher, parameters, resolutionFacade, lookupElementFactory, inDescriptor, collectorContext)
|
||||
|
||||
protected val project: Project = position.getProject()
|
||||
|
||||
protected val originalSearchScope: GlobalSearchScope = ResolutionFacade.getResolveScope(parameters.getOriginalFile() as JetFile)
|
||||
|
||||
// we need to exclude the original file from scope because our resolve session is built with this file replaced by synthetic one
|
||||
@@ -224,8 +224,12 @@ abstract class CompletionSessionBase(protected val configuration: CompletionSess
|
||||
protected fun getTopLevelCallables(): Collection<DeclarationDescriptor>
|
||||
= indicesHelper.getTopLevelCallables({ prefixMatcher.prefixMatches(it) })
|
||||
|
||||
protected fun getTopLevelExtensions(): Collection<CallableDescriptor>
|
||||
= indicesHelper.getCallableTopLevelExtensions({ prefixMatcher.prefixMatches(it) }, reference!!.expression)
|
||||
protected fun getTopLevelExtensions(): Collection<CallableDescriptor> {
|
||||
val extensions = indicesHelper.getCallableTopLevelExtensions({ prefixMatcher.prefixMatches(it) }, reference!!.expression)
|
||||
//TODO: it filters out too much
|
||||
//TODO: not filtered out dominated by members
|
||||
return ShadowedDeclarationsFilter(bindingContext, moduleDescriptor, project, importDeclarations = true).filter(extensions, reference.expression)
|
||||
}
|
||||
|
||||
protected fun addAllClasses(kindFilter: (ClassKind) -> Boolean) {
|
||||
AllClassesCompletion(
|
||||
@@ -451,7 +455,7 @@ class SmartCompletionSession(configuration: CompletionSessionConfiguration, para
|
||||
val dummyArgument = object : FunctionLiteralArgument {
|
||||
override fun getFunctionLiteral() = throw UnsupportedOperationException()
|
||||
override fun getArgumentExpression() = throw UnsupportedOperationException()
|
||||
override fun getArgumentName(): JetValueArgumentName? = null
|
||||
override fun getArgumentName(): ValueArgumentName? = null
|
||||
override fun isNamed() = false
|
||||
override fun asElement() = throw UnsupportedOperationException()
|
||||
override fun getSpreadElement(): LeafPsiElement? = null
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.jetbrains.kotlin.idea.completion.smart.toList
|
||||
import org.jetbrains.kotlin.idea.core.mapArgumentsToParameters
|
||||
import org.jetbrains.kotlin.idea.util.makeNotNullable
|
||||
import org.jetbrains.kotlin.lexer.JetTokens
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.psi.*
|
||||
import org.jetbrains.kotlin.resolve.BindingContext
|
||||
import org.jetbrains.kotlin.resolve.DelegatingBindingTrace
|
||||
@@ -63,9 +64,9 @@ data class ItemOptions(val starPrefix: Boolean) {
|
||||
|
||||
open data class ExpectedInfo(val type: JetType, val expectedName: String?, val tail: Tail?, val itemOptions: ItemOptions = ItemOptions.DEFAULT)
|
||||
|
||||
data class ArgumentPosition(val argumentIndex: Int, val argumentName: String?, val isFunctionLiteralArgument: Boolean) {
|
||||
data class ArgumentPosition(val argumentIndex: Int, val argumentName: Name?, val isFunctionLiteralArgument: Boolean) {
|
||||
constructor(argumentIndex: Int, isFunctionLiteralArgument: Boolean = false) : this(argumentIndex, null, isFunctionLiteralArgument)
|
||||
constructor(argumentIndex: Int, argumentName: String?) : this(argumentIndex, argumentName, false)
|
||||
constructor(argumentIndex: Int, argumentName: Name?) : this(argumentIndex, argumentName, false)
|
||||
}
|
||||
|
||||
class ArgumentExpectedInfo(type: JetType, name: String?, tail: Tail?, val function: FunctionDescriptor, val position: ArgumentPosition, itemOptions: ItemOptions = ItemOptions.DEFAULT)
|
||||
@@ -133,7 +134,7 @@ class ExpectedInfos(
|
||||
assert(argumentIndex >= 0) {
|
||||
"Could not find argument '$argument' among arguments of call: $call"
|
||||
}
|
||||
val argumentName = argument.getArgumentName()?.getReferenceExpression()?.getReferencedName()
|
||||
val argumentName = argument.getArgumentName()?.asName
|
||||
val isFunctionLiteralArgument = argument is FunctionLiteralArgument
|
||||
val argumentPosition = ArgumentPosition(argumentIndex, argumentName, isFunctionLiteralArgument)
|
||||
|
||||
@@ -243,9 +244,9 @@ class ExpectedInfos(
|
||||
return expectedInfos
|
||||
}
|
||||
|
||||
private fun namedArgumentTail(argumentToParameter: Map<ValueArgument, ValueParameterDescriptor>, argumentName: String, descriptor: FunctionDescriptor): Tail? {
|
||||
val usedParameterNames = (argumentToParameter.values().map { it.getName().asString() } + listOf(argumentName)).toSet()
|
||||
val notUsedParameters = descriptor.getValueParameters().filter { it.getName().asString() !in usedParameterNames }
|
||||
private fun namedArgumentTail(argumentToParameter: Map<ValueArgument, ValueParameterDescriptor>, argumentName: Name, descriptor: FunctionDescriptor): Tail? {
|
||||
val usedParameterNames = (argumentToParameter.values().map { it.getName() } + listOf(argumentName)).toSet()
|
||||
val notUsedParameters = descriptor.getValueParameters().filter { it.getName() !in usedParameterNames }
|
||||
return if (notUsedParameters.isEmpty())
|
||||
Tail.RPARENTH
|
||||
else if (notUsedParameters.all { it.hasDefaultValue() })
|
||||
|
||||
+2
-1
@@ -51,8 +51,9 @@ object PackageDirectiveCompletion {
|
||||
|
||||
val resolutionFacade = ref.expression.getResolutionFacade()
|
||||
val bindingContext = resolutionFacade.analyze(ref.expression)
|
||||
val moduleDescriptor = resolutionFacade.findModuleDescriptor(file)
|
||||
|
||||
val variants = ReferenceVariantsHelper(bindingContext, { true }).getPackageReferenceVariants(ref.expression, prefixMatcher.asNameFilter())
|
||||
val variants = ReferenceVariantsHelper(bindingContext, moduleDescriptor, file.getProject(), { true }).getPackageReferenceVariants(ref.expression, prefixMatcher.asNameFilter())
|
||||
for (variant in variants) {
|
||||
val lookupElement = LookupElementFactory(resolutionFacade, listOf()).createLookupElement(variant, false)
|
||||
if (!lookupElement.getLookupString().contains(DUMMY_IDENTIFIER)) {
|
||||
|
||||
+2
-1
@@ -25,6 +25,7 @@ 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
|
||||
@@ -40,7 +41,7 @@ class MultipleArgumentsItemProvider(val bindingContext: BindingContext,
|
||||
public fun addToCollection(collection: MutableCollection<LookupElement>,
|
||||
expectedInfos: Collection<ExpectedInfo>,
|
||||
context: JetExpression) {
|
||||
val resolutionScope = bindingContext[BindingContext.RESOLUTION_SCOPE, context] ?: return
|
||||
val resolutionScope = bindingContext.correctedResolutionScope(context) ?: return
|
||||
|
||||
val added = HashSet<String>()
|
||||
for (expectedInfo in expectedInfos) {
|
||||
|
||||
@@ -264,13 +264,6 @@ class SmartCompletion(
|
||||
private fun calcItemsToSkip(expression: JetExpression): Set<DeclarationDescriptor> {
|
||||
val parent = expression.getParent()
|
||||
when(parent) {
|
||||
is JetProperty -> {
|
||||
//TODO: this can be filtered out by ordinary completion
|
||||
if (expression == parent.getInitializer()) {
|
||||
return bindingContext[BindingContext.DECLARATION_TO_DESCRIPTOR, parent].toSet()
|
||||
}
|
||||
}
|
||||
|
||||
is JetBinaryExpression -> {
|
||||
if (parent.getRight() == expression) {
|
||||
val operationToken = parent.getOperationToken()
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
fun foo(xxx: String) {
|
||||
var xxx = xx<caret>
|
||||
}
|
||||
|
||||
// EXIST: { lookupString: "xxx", itemText: "xxx", typeText: "String" }
|
||||
// NOTHING_ELSE
|
||||
@@ -0,0 +1,5 @@
|
||||
fun foo() {
|
||||
var xxx = <caret>
|
||||
}
|
||||
|
||||
// ABSENT: xxx
|
||||
@@ -0,0 +1,8 @@
|
||||
fun foo(xxx: Int) {
|
||||
val xxx: Any = run {
|
||||
xx<caret>
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: { lookupString: "xxx", itemText: "xxx", typeText: "Int" }
|
||||
// NOTHING_ELSE
|
||||
@@ -0,0 +1,15 @@
|
||||
class C {
|
||||
val xxx = 1
|
||||
|
||||
fun foo(xxx: String) {
|
||||
val xxx = 'x'
|
||||
|
||||
if (true) {
|
||||
val xxx = true
|
||||
xx<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: { lookupString: "xxx", itemText: "xxx", typeText: "Boolean" }
|
||||
// NOTHING_ELSE
|
||||
@@ -0,0 +1,10 @@
|
||||
class C {
|
||||
val xxx = 1
|
||||
|
||||
fun foo(xxx: String) {
|
||||
xx<caret>
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: { lookupString: "xxx", itemText: "xxx", typeText: "String" }
|
||||
// NOTHING_ELSE
|
||||
@@ -0,0 +1,17 @@
|
||||
package ppp
|
||||
|
||||
class C {
|
||||
fun xxx(p: Int) = ""
|
||||
|
||||
fun foo() {
|
||||
xx<caret>
|
||||
}
|
||||
}
|
||||
|
||||
fun C.xxx(p: Int) = 1
|
||||
fun Any.xxx(c: Char) = 1
|
||||
fun C.xxx(c: Char) = 1
|
||||
|
||||
// EXIST: { lookupString: "xxx", itemText: "xxx", tailText: "(p: Int)", typeText: "String" }
|
||||
// EXIST: { lookupString: "xxx", itemText: "xxx", tailText: "(c: Char) for C in ppp", typeText: "Int" }
|
||||
// NOTHING_ELSE
|
||||
@@ -0,0 +1,17 @@
|
||||
package ppp
|
||||
|
||||
class C {
|
||||
fun xxx(vararg s: String, p: Int) = ""
|
||||
|
||||
fun foo() {
|
||||
xx<caret>
|
||||
}
|
||||
}
|
||||
|
||||
fun C.xxx(vararg s: String, p: Int) = 1
|
||||
fun Any.xxx(vararg s: String, c: Char) = 1
|
||||
fun C.xxx(vararg s: String, c: Char) = 1
|
||||
|
||||
// EXIST: { lookupString: "xxx", itemText: "xxx", tailText: "(vararg s: String, p: Int)", typeText: "String" }
|
||||
// EXIST: { lookupString: "xxx", itemText: "xxx", tailText: "(vararg s: String, c: Char) for C in ppp", typeText: "Int" }
|
||||
// NOTHING_ELSE
|
||||
@@ -0,0 +1,14 @@
|
||||
class C {
|
||||
inner class Inner {
|
||||
fun foo() {
|
||||
xx<caret>
|
||||
}
|
||||
|
||||
val xxx: String get() = 1
|
||||
}
|
||||
|
||||
val xxx: Int get() = 1
|
||||
}
|
||||
|
||||
// EXIST: { lookupString: "xxx", itemText: "xxx", typeText: "String" }
|
||||
// NOTHING_ELSE
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
interface I
|
||||
|
||||
class C : I {
|
||||
inner class Inner {
|
||||
fun foo() {
|
||||
xx<caret>
|
||||
}
|
||||
|
||||
val Any.xxx: Int get() = 1
|
||||
}
|
||||
|
||||
val I.xxx: Int get() = 1
|
||||
|
||||
}
|
||||
|
||||
val C.xxx: Int get() = 1
|
||||
|
||||
// EXIST: { lookupString: "xxx", itemText: "xxx", tailText: " for Any in C.Inner", typeText: "Int" }
|
||||
// NOTHING_ELSE
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package ppp
|
||||
|
||||
class C {
|
||||
val xxx = ""
|
||||
fun xxx() = ""
|
||||
fun xxx(p: Int) = ""
|
||||
|
||||
fun foo() {
|
||||
xx<caret>
|
||||
}
|
||||
}
|
||||
|
||||
val C.xxx: Int
|
||||
get() = 1
|
||||
|
||||
fun C.xxx() = 1
|
||||
fun C.xxx(p: Int) = 1
|
||||
fun C.xxx(p: String) = 1
|
||||
|
||||
// EXIST: { lookupString: "xxx", itemText: "xxx", tailText: null, typeText: "String" }
|
||||
// EXIST: { lookupString: "xxx", itemText: "xxx", tailText: "()", typeText: "String" }
|
||||
// EXIST: { lookupString: "xxx", itemText: "xxx", tailText: "(p: Int)", typeText: "String" }
|
||||
// EXIST: { lookupString: "xxx", itemText: "xxx", tailText: "(p: String) for C in ppp", typeText: "Int" }
|
||||
// NOTHING_ELSE
|
||||
@@ -0,0 +1,12 @@
|
||||
val xxx: Int get() = 1
|
||||
|
||||
class C {
|
||||
fun foo() {
|
||||
xx<caret>
|
||||
}
|
||||
|
||||
val xxx: String get() = 1
|
||||
}
|
||||
|
||||
// EXIST: { lookupString: "xxx", itemText: "xxx", typeText: "String" }
|
||||
// NOTHING_ELSE
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package ppp
|
||||
|
||||
interface I
|
||||
|
||||
class C : I {
|
||||
fun foo() {
|
||||
xx<caret>
|
||||
}
|
||||
}
|
||||
|
||||
val Any.xxx: Int get() = 1
|
||||
val I.xxx: Int get() = 1
|
||||
|
||||
fun Any.xxx() = 1
|
||||
fun C.xxx() = 1
|
||||
|
||||
// EXIST: { lookupString: "xxx", itemText: "xxx", tailText: " for I in ppp", typeText: "Int" }
|
||||
// EXIST: { lookupString: "xxx", itemText: "xxx", tailText: "() for C in ppp", typeText: "Int" }
|
||||
// NOTHING_ELSE
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package dependency
|
||||
|
||||
fun Any.xxx(): Int = 1
|
||||
fun ppp.C.xxx(): Int = 1
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package ppp
|
||||
|
||||
import dependency.*
|
||||
|
||||
class C {
|
||||
fun foo() {
|
||||
xx<caret>
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: { lookupString: "xxx", itemText: "xxx", tailText: "() for C in dependency", typeText: "Int" }
|
||||
// NOTHING_ELSE
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package dependency
|
||||
|
||||
fun Any.xxx(): Int = 1
|
||||
fun ppp.C.xxx(): Int = 1
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package ppp
|
||||
|
||||
class C {
|
||||
fun foo() {
|
||||
xx<caret>
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: { lookupString: "xxx", itemText: "xxx", tailText: "() for C in dependency", typeText: "Int" }
|
||||
// NOTHING_ELSE
|
||||
+81
@@ -1396,6 +1396,87 @@ public class JSBasicCompletionTestGenerated extends AbstractJSBasicCompletionTes
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("idea/idea-completion/testData/basic/common/shadowing")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Shadowing extends AbstractJSBasicCompletionTest {
|
||||
public void testAllFilesPresentInShadowing() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/idea-completion/testData/basic/common/shadowing"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("InInitializer1.kt")
|
||||
public void testInInitializer1() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/InInitializer1.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("InInitializer2.kt")
|
||||
public void testInInitializer2() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/InInitializer2.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("InInitializer3.kt")
|
||||
public void testInInitializer3() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/InInitializer3.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("Locals1.kt")
|
||||
public void testLocals1() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/Locals1.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("Locals2.kt")
|
||||
public void testLocals2() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/Locals2.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("Overloads.kt")
|
||||
public void testOverloads() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/Overloads.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("OverloadsAndVararg.kt")
|
||||
public void testOverloadsAndVararg() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/OverloadsAndVararg.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("PreferCloserMember.kt")
|
||||
public void testPreferCloserMember() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/PreferCloserMember.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("PreferMemberExtension.kt")
|
||||
public void testPreferMemberExtension() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/PreferMemberExtension.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("PreferMemberToExtension.kt")
|
||||
public void testPreferMemberToExtension() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/PreferMemberToExtension.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("PreferMemberToGlobal.kt")
|
||||
public void testPreferMemberToGlobal() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/PreferMemberToGlobal.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("PreferMoreSpecificExtension.kt")
|
||||
public void testPreferMoreSpecificExtension() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/PreferMoreSpecificExtension.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("idea/idea-completion/testData/basic/common/typeArgsOrNot")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
+81
@@ -1396,6 +1396,87 @@ public class JvmBasicCompletionTestGenerated extends AbstractJvmBasicCompletionT
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("idea/idea-completion/testData/basic/common/shadowing")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Shadowing extends AbstractJvmBasicCompletionTest {
|
||||
public void testAllFilesPresentInShadowing() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/idea-completion/testData/basic/common/shadowing"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("InInitializer1.kt")
|
||||
public void testInInitializer1() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/InInitializer1.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("InInitializer2.kt")
|
||||
public void testInInitializer2() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/InInitializer2.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("InInitializer3.kt")
|
||||
public void testInInitializer3() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/InInitializer3.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("Locals1.kt")
|
||||
public void testLocals1() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/Locals1.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("Locals2.kt")
|
||||
public void testLocals2() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/Locals2.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("Overloads.kt")
|
||||
public void testOverloads() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/Overloads.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("OverloadsAndVararg.kt")
|
||||
public void testOverloadsAndVararg() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/OverloadsAndVararg.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("PreferCloserMember.kt")
|
||||
public void testPreferCloserMember() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/PreferCloserMember.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("PreferMemberExtension.kt")
|
||||
public void testPreferMemberExtension() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/PreferMemberExtension.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("PreferMemberToExtension.kt")
|
||||
public void testPreferMemberToExtension() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/PreferMemberToExtension.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("PreferMemberToGlobal.kt")
|
||||
public void testPreferMemberToGlobal() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/PreferMemberToGlobal.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("PreferMoreSpecificExtension.kt")
|
||||
public void testPreferMoreSpecificExtension() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/shadowing/PreferMoreSpecificExtension.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("idea/idea-completion/testData/basic/common/typeArgsOrNot")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
+12
@@ -209,6 +209,18 @@ public class MultiFileJvmBasicCompletionTestGenerated extends AbstractMultiFileJ
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("PreferMoreSpecificExtension1")
|
||||
public void testPreferMoreSpecificExtension1() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/multifile/PreferMoreSpecificExtension1/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("PreferMoreSpecificExtension2")
|
||||
public void testPreferMoreSpecificExtension2() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/multifile/PreferMoreSpecificExtension2/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("TopLevelFunction")
|
||||
public void testTopLevelFunction() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/multifile/TopLevelFunction/");
|
||||
|
||||
Reference in New Issue
Block a user