Changed lookup strings and prefix matchers for parameter name&type completion to get more stable and correct ordering
This commit is contained in:
+24
-25
@@ -52,7 +52,7 @@ class ParameterNameAndTypeCompletion(
|
||||
defaultPrefixMatcher: PrefixMatcher,
|
||||
private val resolutionFacade: ResolutionFacade
|
||||
) {
|
||||
private val parametersInCurrentFilePrefixMatcher = MyPrefixMatcher(defaultPrefixMatcher.getPrefix())
|
||||
private val modifiedPrefixMatcher = MyPrefixMatcher(defaultPrefixMatcher.prefix)
|
||||
|
||||
private val prefixWords: Array<String>
|
||||
private val nameSuggestionPrefixes: List<String> // prefixes to use to generate parameter names from class names
|
||||
@@ -74,13 +74,13 @@ class ParameterNameAndTypeCompletion(
|
||||
private val suggestionsByTypesAdded = HashSet<Type>()
|
||||
|
||||
public fun addFromImportedClasses(position: PsiElement, bindingContext: BindingContext, visibilityFilter: (DeclarationDescriptor) -> Boolean) {
|
||||
for ((i, prefixMatcher) in nameSuggestionPrefixMatchers.withIndex()) {
|
||||
for ((prefixMatcher, userPrefix) in nameSuggestionPrefixMatchers.zip(userPrefixes)) {
|
||||
val resolutionScope = position.getResolutionScope(bindingContext, resolutionFacade)
|
||||
val classifiers = resolutionScope.getDescriptorsFiltered(DescriptorKindFilter.NON_SINGLETON_CLASSIFIERS, prefixMatcher.toClassifierNamePrefixMatcher().asNameFilter())
|
||||
|
||||
for (classifier in classifiers) {
|
||||
if (visibilityFilter(classifier)) {
|
||||
addSuggestionsForClassifier(classifier, userPrefixes[i], prefixMatcher, notImported = false)
|
||||
addSuggestionsForClassifier(classifier, userPrefix, prefixMatcher, notImported = false)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,13 +89,13 @@ class ParameterNameAndTypeCompletion(
|
||||
}
|
||||
|
||||
public fun addFromAllClasses(parameters: CompletionParameters, indicesHelper: KotlinIndicesHelper) {
|
||||
for ((i, prefixMatcher) in nameSuggestionPrefixMatchers.withIndex()) {
|
||||
for ((prefixMatcher, userPrefix) in nameSuggestionPrefixMatchers.zip(userPrefixes)) {
|
||||
AllClassesCompletion(
|
||||
parameters, indicesHelper, prefixMatcher.toClassifierNamePrefixMatcher(), resolutionFacade, { !it.isSingleton() }
|
||||
).collect(
|
||||
{ addSuggestionsForClassifier(it, userPrefixes[i], prefixMatcher, notImported = true) },
|
||||
{ addSuggestionsForJavaClass(it, userPrefixes[i], prefixMatcher, notImported = true) }
|
||||
)
|
||||
{ addSuggestionsForClassifier(it, userPrefix, prefixMatcher, notImported = true) },
|
||||
{ addSuggestionsForJavaClass(it, userPrefix, prefixMatcher, notImported = true) }
|
||||
)
|
||||
|
||||
collector.flushToResultSet()
|
||||
}
|
||||
@@ -111,12 +111,12 @@ class ParameterNameAndTypeCompletion(
|
||||
ProgressManager.checkCanceled()
|
||||
|
||||
val name = parameter.getName()
|
||||
if (name != null && parametersInCurrentFilePrefixMatcher.prefixMatches(name)) {
|
||||
if (name != null && modifiedPrefixMatcher.prefixMatches(name)) {
|
||||
val descriptor = resolutionFacade.analyze(parameter)[BindingContext.VALUE_PARAMETER, parameter]
|
||||
if (descriptor != null) {
|
||||
val parameterType = descriptor.getType()
|
||||
if (parameterType.isVisible(visibilityFilter)) {
|
||||
val lookupElement = MyLookupElement.create("", name, ArbitraryType(parameterType), lookupElementFactory)
|
||||
val lookupElement = MyLookupElement.create(name, ArbitraryType(parameterType), lookupElementFactory)
|
||||
val count = lookupElementToCount[lookupElement] ?: 0
|
||||
lookupElementToCount[lookupElement!!] = count + 1
|
||||
}
|
||||
@@ -126,7 +126,7 @@ class ParameterNameAndTypeCompletion(
|
||||
|
||||
for ((lookupElement, count) in lookupElementToCount) {
|
||||
lookupElement.putUserData(PRIORITY_KEY, -count)
|
||||
collector.addElement(lookupElement, parametersInCurrentFilePrefixMatcher)
|
||||
collector.addElement(lookupElement, modifiedPrefixMatcher)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,10 +145,10 @@ class ParameterNameAndTypeCompletion(
|
||||
val nameSuggestions = KotlinNameSuggester.getCamelNames(className, { true }, userPrefix.isEmpty())
|
||||
for (name in nameSuggestions) {
|
||||
if (prefixMatcher.prefixMatches(name)) {
|
||||
val lookupElement = MyLookupElement.create(userPrefix, name, type, lookupElementFactory)
|
||||
val lookupElement = MyLookupElement.create(userPrefix + name, type, lookupElementFactory)
|
||||
if (lookupElement != null) {
|
||||
lookupElement.putUserData(PRIORITY_KEY, userPrefix.length()) // suggestions with longer user prefix get smaller priority
|
||||
collector.addElement(lookupElement, prefixMatcher, notImported)
|
||||
lookupElement.putUserData(PRIORITY_KEY, userPrefix.length()) // suggestions with longer user prefix get lower priority
|
||||
collector.addElement(lookupElement, modifiedPrefixMatcher, notImported = notImported)
|
||||
suggestionsByTypesAdded.add(type)
|
||||
}
|
||||
}
|
||||
@@ -184,28 +184,23 @@ class ParameterNameAndTypeCompletion(
|
||||
}
|
||||
|
||||
private class MyLookupElement private constructor(
|
||||
private val userPrefix: String,
|
||||
private val nameSuggestion: String,
|
||||
private val parameterName: String,
|
||||
private val type: Type,
|
||||
typeLookupElement: LookupElement
|
||||
) : LookupElementDecorator<LookupElement>(typeLookupElement) {
|
||||
|
||||
companion object {
|
||||
fun create(userPrefix: String, nameSuggestion: String, type: Type, factory: LookupElementFactory): LookupElement? {
|
||||
fun create(parameterName: String, type: Type, factory: LookupElementFactory): LookupElement? {
|
||||
val typeLookupElement = type.createTypeLookupElement(factory) ?: return null
|
||||
val lookupElement = MyLookupElement(userPrefix, nameSuggestion, type, typeLookupElement)
|
||||
val lookupElement = MyLookupElement(parameterName, type, typeLookupElement)
|
||||
return lookupElement.suppressAutoInsertion()
|
||||
}
|
||||
}
|
||||
|
||||
private val parameterName = userPrefix + nameSuggestion
|
||||
private val lookupString = parameterName + ": " + delegate.lookupString
|
||||
|
||||
override fun equals(other: Any?)
|
||||
= other is MyLookupElement && nameSuggestion == other.nameSuggestion && userPrefix == other.userPrefix && type == other.type
|
||||
override fun hashCode() = parameterName.hashCode()
|
||||
|
||||
override fun getLookupString() = nameSuggestion
|
||||
override fun getAllLookupStrings() = setOf(nameSuggestion)
|
||||
override fun getLookupString() = lookupString
|
||||
override fun getAllLookupStrings() = setOf(lookupString)
|
||||
|
||||
override fun renderElement(presentation: LookupElementPresentation) {
|
||||
super.renderElement(presentation)
|
||||
@@ -216,7 +211,7 @@ class ParameterNameAndTypeCompletion(
|
||||
val settings = CodeStyleSettingsManager.getInstance(context.getProject()).getCurrentSettings().getCustomSettings(javaClass<JetCodeStyleSettings>())
|
||||
val spaceBefore = if (settings.SPACE_BEFORE_TYPE_COLON) " " else ""
|
||||
val spaceAfter = if (settings.SPACE_AFTER_TYPE_COLON) " " else ""
|
||||
val text = nameSuggestion + spaceBefore + ":" + spaceAfter
|
||||
val text = parameterName + spaceBefore + ":" + spaceAfter
|
||||
val startOffset = context.getStartOffset()
|
||||
context.getDocument().insertString(startOffset, text)
|
||||
|
||||
@@ -225,6 +220,10 @@ class ParameterNameAndTypeCompletion(
|
||||
|
||||
super.handleInsert(context)
|
||||
}
|
||||
|
||||
override fun equals(other: Any?)
|
||||
= other is MyLookupElement && parameterName == other.parameterName && type == other.type
|
||||
override fun hashCode() = parameterName.hashCode()
|
||||
}
|
||||
|
||||
private companion object {
|
||||
|
||||
+1
-1
@@ -18,5 +18,5 @@ class A(overr<caret>) : Base2(), I
|
||||
// EXIST: { itemText: "override val someVal: Int", tailText: null, typeText: "I" }
|
||||
// EXIST: { itemText: "override var someVar: Int", tailText: null, typeText: "I" }
|
||||
// EXIST: { itemText: "override val fromBase: String", tailText: null, typeText: "Base1" }
|
||||
// EXIST_JAVA_ONLY: { lookupString: "override", itemText: "override: Override" }
|
||||
// EXIST_JAVA_ONLY: { lookupString: "override: Override", itemText: "override: Override" }
|
||||
// NOTHING_ELSE
|
||||
|
||||
+1
-1
@@ -4,4 +4,4 @@ class DeclarationDescriptor
|
||||
|
||||
fun f(dd<caret>)
|
||||
|
||||
// EXIST: { lookupString: "declarationDescriptor", itemText: "declarationDescriptor: DeclarationDescriptor", tailText: " (pack)" }
|
||||
// EXIST: { lookupString: "declarationDescriptor: DeclarationDescriptor", itemText: "declarationDescriptor: DeclarationDescriptor", tailText: " (pack)" }
|
||||
|
||||
+1
-1
@@ -3,5 +3,5 @@ class FooBaaaaar
|
||||
fun f(fooBaaaa<caret>)
|
||||
|
||||
// AUTOCOMPLETE_SETTING: true
|
||||
// EXIST: fooBaaaaar
|
||||
// EXIST: fooBaaaaar: FooBaaaaar
|
||||
// NUMBER: 1
|
||||
|
||||
+1
-1
@@ -2,5 +2,5 @@ import kotlin.properties.*
|
||||
|
||||
fun f(readonlypr<caret>)
|
||||
|
||||
// EXIST: { lookupString: "readOnlyProperty", itemText: "readOnlyProperty: ReadOnlyProperty", tailText: "<R, T> (kotlin.properties)" }
|
||||
// EXIST: { itemText: "readOnlyProperty: ReadOnlyProperty", tailText: "<R, T> (kotlin.properties)" }
|
||||
// NUMBER: 1
|
||||
|
||||
+1
-1
@@ -2,5 +2,5 @@ import java.sql.*
|
||||
|
||||
fun f(blob<caret>)
|
||||
|
||||
// EXIST_JAVA_ONLY: { lookupString: "blob", itemText: "blob: Blob", tailText: " (java.sql)" }
|
||||
// EXIST_JAVA_ONLY: { itemText: "blob: Blob", tailText: " (java.sql)" }
|
||||
// NUMBER_JAVA: 1
|
||||
|
||||
+3
-3
@@ -10,7 +10,7 @@ fun f3(algorithmException: MyAlgorithmException){}
|
||||
|
||||
fun f(algorith<caret>)
|
||||
|
||||
// EXIST_JAVA_ONLY: { lookupString: "algorithmException", itemText: "algorithmException: NoSuchAlgorithmException", tailText: " (java.security)" }
|
||||
// EXIST_JAVA_ONLY: { lookupString: "algorithmException", itemText: "algorithmException: NoSuchAlgorithmException?", tailText: " (java.security)" }
|
||||
// EXIST: { lookupString: "algorithmException", itemText: "algorithmException: MyAlgorithmException", tailText: " (ppp)" }
|
||||
// EXIST_JAVA_ONLY: { itemText: "algorithmException: NoSuchAlgorithmException", tailText: " (java.security)" }
|
||||
// EXIST_JAVA_ONLY: { itemText: "algorithmException: NoSuchAlgorithmException?", tailText: " (java.security)" }
|
||||
// EXIST: { itemText: "algorithmException: MyAlgorithmException", tailText: " (ppp)" }
|
||||
// NOTHING_ELSE
|
||||
|
||||
+1
-1
@@ -6,4 +6,4 @@ fun f() {
|
||||
x(fun (b<caret>))
|
||||
}
|
||||
|
||||
// ABSENT: boo
|
||||
// ABSENT: boo: Boo
|
||||
|
||||
+1
-1
@@ -7,4 +7,4 @@ fun f() {
|
||||
}
|
||||
}
|
||||
|
||||
// ABSENT: "exception"
|
||||
// ABSENT: "exception: Exception"
|
||||
|
||||
+1
-1
@@ -6,4 +6,4 @@ fun f() {
|
||||
val handler = { b<caret> }
|
||||
}
|
||||
|
||||
// ABSENT: boo
|
||||
// ABSENT: boo: Boo
|
||||
|
||||
+1
-1
@@ -4,4 +4,4 @@ var v: Int
|
||||
get(){}
|
||||
set(v<caret>)
|
||||
|
||||
// ABSENT: voo
|
||||
// ABSENT: voo: Voo
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
fun f(read<caret>)
|
||||
|
||||
// EXIST: { lookupString: "readOnlyProperty", itemText: "readOnlyProperty: ReadOnlyProperty", tailText: "<R, T> (kotlin.properties)" }
|
||||
// EXIST: { lookupString: "readOnlyProperty: ReadOnlyProperty", itemText: "readOnlyProperty: ReadOnlyProperty", tailText: "<R, T> (kotlin.properties)" }
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
fun f(file<caret>)
|
||||
|
||||
// EXIST_JAVA_ONLY: { lookupString: "file", itemText: "file: File", tailText: " (java.io)" }
|
||||
// EXIST_JAVA_ONLY: { lookupString: "file: File", itemText: "file: File", tailText: " (java.io)" }
|
||||
|
||||
+8
-8
@@ -18,11 +18,11 @@ class C(val handler: () -> Unit) {
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: { lookupString: "strings", itemText: "strings: List<String>", tailText: " (kotlin)" }
|
||||
// EXIST: { lookupString: "numbers", itemText: "numbers: List<Int>", tailText: " (kotlin)" }
|
||||
// EXIST: { lookupString: "value", itemText: "value: Any?", tailText: " (kotlin)" }
|
||||
// EXIST_JAVA_ONLY: { lookupString: "value", itemText: "value: File", tailText: " (java.io)" }
|
||||
// EXIST: { lookupString: "handler", itemText: "handler: (() -> String)?", tailText: null }
|
||||
// EXIST: { lookupString: "handler", itemText: "handler: () -> Unit", tailText: null }
|
||||
// ABSENT: "localParam"
|
||||
// ABSENT: "file"
|
||||
// EXIST: { lookupString: "strings: List", itemText: "strings: List<String>", tailText: " (kotlin)" }
|
||||
// EXIST: { lookupString: "numbers: List", itemText: "numbers: List<Int>", tailText: " (kotlin)" }
|
||||
// EXIST: { lookupString: "value: Any", itemText: "value: Any?", tailText: " (kotlin)" }
|
||||
// EXIST_JAVA_ONLY: { lookupString: "value: File", itemText: "value: File", tailText: " (java.io)" }
|
||||
// EXIST: { lookupString: "handler: (() -> String)?", itemText: "handler: (() -> String)?", tailText: null }
|
||||
// EXIST: { lookupString: "handler: () -> Unit", itemText: "handler: () -> Unit", tailText: null }
|
||||
// ABSENT: "localParam: String"
|
||||
// ABSENT: "file: File"
|
||||
|
||||
Vendored
+2
-2
@@ -14,6 +14,6 @@ class X {
|
||||
|
||||
fun foo(neste<caret>)
|
||||
|
||||
// EXIST: { lookupString: "nested", itemText: "nested: X.PublicNested", tailText: " (ppp)" }
|
||||
// EXIST: { lookupString: "nestedList", itemText: "nestedList: List<X.PublicNested>", tailText: " (kotlin)" }
|
||||
// EXIST: { itemText: "nested: X.PublicNested", tailText: " (ppp)" }
|
||||
// EXIST: { itemText: "nestedList: List<X.PublicNested>", tailText: " (kotlin)" }
|
||||
// NOTHING_ELSE
|
||||
|
||||
idea/idea-completion/testData/basic/common/parameterNameAndType/ParametersInFileInaccessibleType2.kt
Vendored
+2
-2
@@ -14,6 +14,6 @@ class X {
|
||||
|
||||
class C(val neste<caret>)
|
||||
|
||||
// EXIST: { lookupString: "nested", itemText: "nested: X.PublicNested", tailText: " (ppp)" }
|
||||
// EXIST: { lookupString: "nestedList", itemText: "nestedList: List<X.PublicNested>", tailText: " (kotlin)" }
|
||||
// EXIST: { itemText: "nested: X.PublicNested", tailText: " (ppp)" }
|
||||
// EXIST: { itemText: "nestedList: List<X.PublicNested>", tailText: " (kotlin)" }
|
||||
// NOTHING_ELSE
|
||||
|
||||
Vendored
+1
-1
@@ -6,5 +6,5 @@ class X<T1> {
|
||||
fun foo(xxx<caret>)
|
||||
}
|
||||
|
||||
// EXIST: { lookupString: "xxxValue1", itemText: "xxxValue1: T1", tailText: null }
|
||||
// EXIST: { lookupString: "xxxValue1: T1", itemText: "xxxValue1: T1", tailText: null }
|
||||
// NOTHING_ELSE
|
||||
|
||||
Vendored
+1
-1
@@ -8,5 +8,5 @@ class X<T1> {
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: { lookupString: "xxxValue1", itemText: "xxxValue1: T1", tailText: null }
|
||||
// EXIST: { lookupString: "xxxValue1: T1", itemText: "xxxValue1: T1", tailText: null }
|
||||
// NOTHING_ELSE
|
||||
|
||||
@@ -6,6 +6,6 @@ class Boo
|
||||
|
||||
fun f(b<caret>)
|
||||
|
||||
// EXIST: { lookupString: "bar", itemText: "bar: FooBar", tailText: " (pack)" }
|
||||
// ABSENT: fooBar
|
||||
// EXIST: { lookupString: "boo", itemText: "boo: Boo", tailText: " (pack)" }
|
||||
// EXIST: { lookupString: "bar: FooBar", itemText: "bar: FooBar", tailText: " (pack)" }
|
||||
// ABSENT: fooBar: FooBar
|
||||
// EXIST: { lookupString: "boo: Boo", itemText: "boo: Boo", tailText: " (pack)" }
|
||||
|
||||
+1
-1
@@ -2,5 +2,5 @@ import java.net.URLConnection
|
||||
|
||||
fun foo(url<caret>){}
|
||||
|
||||
// EXIST_JAVA_ONLY: { lookupString: "urlConnection", itemText: "urlConnection: URLConnection", tailText: " (java.net)" }
|
||||
// EXIST_JAVA_ONLY: { lookupString: "urlConnection: URLConnection", itemText: "urlConnection: URLConnection", tailText: " (java.net)" }
|
||||
// ABSENT: urlconnection
|
||||
|
||||
+3
-3
@@ -6,6 +6,6 @@ class Boo
|
||||
|
||||
fun f(myB<caret>)
|
||||
|
||||
// EXIST: { lookupString: "Bar", itemText: "myBar: FooBar", tailText: " (pack)" }
|
||||
// ABSENT: FooBar
|
||||
// EXIST: { lookupString: "Boo", itemText: "myBoo: Boo", tailText: " (pack)" }
|
||||
// EXIST: { lookupString: "myBar: FooBar", itemText: "myBar: FooBar", tailText: " (pack)" }
|
||||
// ABSENT: myBFooBar: FooBar
|
||||
// EXIST: { lookupString: "myBoo: Boo", itemText: "myBoo: Boo", tailText: " (pack)" }
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
fun f(myF<caret>)
|
||||
|
||||
// EXIST_JAVA_ONLY: { lookupString: "File", itemText: "myFile: File", tailText: " (java.io)" }
|
||||
// EXIST_JAVA_ONLY: { lookupString: "myFile: File", itemText: "myFile: File", tailText: " (java.io)" }
|
||||
|
||||
+2
-2
@@ -6,6 +6,6 @@ class Fuu
|
||||
|
||||
fun f(myFooF<caret>)
|
||||
|
||||
// EXIST: { lookupString: "FooFaa", itemText: "myFooFaa: FooFaa", tailText: " (pack)" }
|
||||
// EXIST: { lookupString: "Fuu", itemText: "myFooFuu: Fuu", tailText: " (pack)" }
|
||||
// EXIST: { lookupString: "myFooFaa: FooFaa", itemText: "myFooFaa: FooFaa", tailText: " (pack)" }
|
||||
// EXIST: { lookupString: "myFooFuu: Fuu", itemText: "myFooFuu: Fuu", tailText: " (pack)" }
|
||||
// ABSENT: { itemText: "myFooFooFaa: FooFaa" }
|
||||
|
||||
+3
-3
@@ -6,6 +6,6 @@ class Boo
|
||||
|
||||
class C(val b<caret>)
|
||||
|
||||
// EXIST: { lookupString: "bar", itemText: "bar: FooBar", tailText: " (pack)" }
|
||||
// ABSENT: fooBar
|
||||
// EXIST: { lookupString: "boo", itemText: "boo: Boo", tailText: " (pack)" }
|
||||
// EXIST: { lookupString: "bar: FooBar", itemText: "bar: FooBar", tailText: " (pack)" }
|
||||
// ABSENT: fooBar: FooBar
|
||||
// EXIST: { lookupString: "boo: Boo", itemText: "boo: Boo", tailText: " (pack)" }
|
||||
|
||||
+3
-3
@@ -6,6 +6,6 @@ class Boo
|
||||
|
||||
class C(private var b<caret>)
|
||||
|
||||
// EXIST: { lookupString: "bar", itemText: "bar: FooBar", tailText: " (pack)" }
|
||||
// ABSENT: fooBar
|
||||
// EXIST: { lookupString: "boo", itemText: "boo: Boo", tailText: " (pack)" }
|
||||
// EXIST: { lookupString: "bar: FooBar", itemText: "bar: FooBar", tailText: " (pack)" }
|
||||
// ABSENT: fooBar: FooBar
|
||||
// EXIST: { lookupString: "boo: Boo", itemText: "boo: Boo", tailText: " (pack)" }
|
||||
|
||||
+6
-6
@@ -3,9 +3,9 @@ fun f(nested: Outer.Nested.NestedNested?){}
|
||||
|
||||
fun foo(nest<caret>)
|
||||
|
||||
// EXIST: { lookupString: "nested", itemText: "nested: Outer.Nested?", tailText: " (<root>)" }
|
||||
// EXIST: { lookupString: "nested", itemText: "nested: Outer.Nested", tailText: " (<root>)" }
|
||||
// EXIST: { lookupString: "nested", itemText: "nested: Outer.Nested.NestedNested?", tailText: " (<root>)" }
|
||||
// EXIST: { lookupString: "nested", itemText: "nested: Outer.Nested.NestedNested", tailText: " (<root>)" }
|
||||
// EXIST: { lookupString: "nested", itemText: "nested: JavaOuter.Nested", tailText: " (<root>)" }
|
||||
// EXIST: { lookupString: "nested", itemText: "nested: JavaOuter.Nested.NestedNested", tailText: " (<root>)" }
|
||||
// EXIST: { lookupString: "nested: Nested", itemText: "nested: Outer.Nested?", tailText: " (<root>)" }
|
||||
// EXIST: { lookupString: "nested: Nested", itemText: "nested: Outer.Nested", tailText: " (<root>)" }
|
||||
// EXIST: { lookupString: "nested: NestedNested", itemText: "nested: Outer.Nested.NestedNested?", tailText: " (<root>)" }
|
||||
// EXIST: { lookupString: "nested: NestedNested", itemText: "nested: Outer.Nested.NestedNested", tailText: " (<root>)" }
|
||||
// EXIST: { lookupString: "nested: Nested", itemText: "nested: JavaOuter.Nested", tailText: " (<root>)" }
|
||||
// EXIST: { lookupString: "nested: NestedNested", itemText: "nested: JavaOuter.Nested.NestedNested", tailText: " (<root>)" }
|
||||
|
||||
+1
-1
@@ -5,4 +5,4 @@ class FooBar
|
||||
|
||||
fun f(b<caret>)
|
||||
|
||||
// ELEMENT: bar
|
||||
// ELEMENT: bar: FooBar
|
||||
|
||||
Vendored
+1
-1
@@ -5,4 +5,4 @@ class FooBar
|
||||
|
||||
fun f(bar :FooBar<caret>)
|
||||
|
||||
// ELEMENT: bar
|
||||
// ELEMENT: bar: FooBar
|
||||
|
||||
@@ -2,5 +2,5 @@ class FooBar
|
||||
|
||||
fun f(b<caret>)
|
||||
|
||||
// ELEMENT: bar
|
||||
// ELEMENT: bar: FooBar
|
||||
// CHAR: ','
|
||||
|
||||
+1
-1
@@ -2,5 +2,5 @@ class FooBar
|
||||
|
||||
fun f(bar: FooBar, <caret>)
|
||||
|
||||
// ELEMENT: bar
|
||||
// ELEMENT: bar: FooBar
|
||||
// CHAR: ','
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
fun f(file<caret>)
|
||||
|
||||
// ELEMENT_TEXT: "file: File"
|
||||
// ELEMENT: "file: File"
|
||||
|
||||
+1
-1
@@ -2,4 +2,4 @@ import java.io.File
|
||||
|
||||
fun f(file: File<caret>)
|
||||
|
||||
// ELEMENT_TEXT: "file: File"
|
||||
// ELEMENT: "file: File"
|
||||
|
||||
+1
-1
@@ -2,4 +2,4 @@ fun foo(xxx: ((java.io.File) -> List<String>)?)
|
||||
|
||||
fun bar(x<caret>)
|
||||
|
||||
// ELEMENT: xxx
|
||||
// ELEMENT: xxx: ((File) -> List<String>)?
|
||||
|
||||
+1
-1
@@ -4,4 +4,4 @@ fun foo(xxx: ((java.io.File) -> List<String>)?)
|
||||
|
||||
fun bar(xxx: ((File) -> List<String>)?<caret>)
|
||||
|
||||
// ELEMENT: xxx
|
||||
// ELEMENT: xxx: ((File) -> List<String>)?
|
||||
|
||||
+1
-1
@@ -2,4 +2,4 @@ fun foo(xxx: java.io.File?)
|
||||
|
||||
fun bar(x<caret>)
|
||||
|
||||
// ELEMENT: xxx
|
||||
// ELEMENT_TEXT: xxx: File?
|
||||
|
||||
Vendored
+1
-1
@@ -4,4 +4,4 @@ fun foo(xxx: java.io.File?)
|
||||
|
||||
fun bar(xxx: File?<caret>)
|
||||
|
||||
// ELEMENT: xxx
|
||||
// ELEMENT_TEXT: xxx: File?
|
||||
|
||||
+1
-1
@@ -2,4 +2,4 @@ class FooBar
|
||||
|
||||
fun f(b<caret>)
|
||||
|
||||
// ELEMENT: bar
|
||||
// ELEMENT: bar: FooBar
|
||||
|
||||
+1
-1
@@ -2,4 +2,4 @@ class FooBar
|
||||
|
||||
fun f(bar: FooBar<caret>)
|
||||
|
||||
// ELEMENT: bar
|
||||
// ELEMENT: bar: FooBar
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
fun<T> foo(t<caret>)
|
||||
|
||||
// ELEMENT: t
|
||||
// ELEMENT: t: T
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
fun<T> foo(t: T<caret>)
|
||||
|
||||
// ELEMENT: t
|
||||
// ELEMENT: t: T
|
||||
|
||||
+1
-1
@@ -2,4 +2,4 @@ class FooBar
|
||||
|
||||
fun f(myFo<caret>)
|
||||
|
||||
// ELEMENT: FooBar
|
||||
// ELEMENT: myFooBar: FooBar
|
||||
|
||||
+1
-1
@@ -2,4 +2,4 @@ class FooBar
|
||||
|
||||
fun f(myFooBar: FooBar<caret>)
|
||||
|
||||
// ELEMENT: FooBar
|
||||
// ELEMENT: myFooBar: FooBar
|
||||
|
||||
+3
-3
@@ -4,6 +4,6 @@ class MyClassC
|
||||
|
||||
fun foo(myCla<caret>)
|
||||
|
||||
// ORDER: myClassA
|
||||
// ORDER: myClassC
|
||||
// ORDER: myClassB
|
||||
// ORDER: myClassA: MyClassA
|
||||
// ORDER: myClassC: MyClassC
|
||||
// ORDER: myClassB: MyClassB
|
||||
|
||||
Vendored
+6
-6
@@ -8,9 +8,9 @@ fun h(myFileX: String)
|
||||
|
||||
fun foo(myFi<caret>)
|
||||
|
||||
// ORDER: myFileY
|
||||
// ORDER: myFileB
|
||||
// ORDER: myFileX
|
||||
// ORDER: myFileX
|
||||
// ORDER: myFileA
|
||||
// ORDER: myFileC
|
||||
// ORDER: myFileY: Int
|
||||
// ORDER: myFileB: MyFileB
|
||||
// ORDER: myFileX: Int
|
||||
// ORDER: myFileX: String
|
||||
// ORDER: myFileA: MyFileA
|
||||
// ORDER: myFileC: MyFileC
|
||||
|
||||
+4
-4
@@ -2,7 +2,7 @@ import ppp.MyClassB
|
||||
|
||||
fun foo(myCla<caret>)
|
||||
|
||||
// ORDER: myClassB
|
||||
// ORDER: myClassA
|
||||
// ORDER: myClassC
|
||||
// ORDER: myClaaa
|
||||
// ORDER: myClassB: MyClassB
|
||||
// ORDER: myClassA: MyClassA
|
||||
// ORDER: myClassC: MyClassC
|
||||
// ORDER: myClaaa: MyClaaa
|
||||
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
package other
|
||||
|
||||
class SpecificStream
|
||||
|
||||
class SimpleStream
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
class MyAbsoluteSpecificStream
|
||||
|
||||
fun foo(myAbSpeStream<caret>)
|
||||
|
||||
// ORDER: myAbsoluteSpecificStream: MyAbsoluteSpecificStream
|
||||
// ORDER: myAbSpecificStream: SpecificStream
|
||||
+2
-2
@@ -3,5 +3,5 @@ class MyFileStream
|
||||
|
||||
fun foo(myFi<caret>)
|
||||
|
||||
// ORDER: myFile
|
||||
// ORDER: myFileStream
|
||||
// ORDER: myFile: MyFile
|
||||
// ORDER: myFileStream: MyFileStream
|
||||
|
||||
+2
-2
@@ -3,5 +3,5 @@ class FaOaOa
|
||||
|
||||
fun foo(foo<caret>)
|
||||
|
||||
// ORDER: fooBar
|
||||
// ORDER: faOaOa
|
||||
// ORDER: fooBar: FooBar
|
||||
// ORDER: faOaOa: FaOaOa
|
||||
|
||||
+3
-3
@@ -6,6 +6,6 @@ class Xaa
|
||||
|
||||
fun foo(zzzYyyX<caret>)
|
||||
|
||||
// ORDER: zzzYyyXxx
|
||||
// ORDER: YyyXoo
|
||||
// ORDER: Xaa
|
||||
// ORDER: zzzYyyXxx: ZzzYyyXxx
|
||||
// ORDER: zzzYyyXoo: YyyXoo
|
||||
// ORDER: zzzYyyXaa: Xaa
|
||||
|
||||
+6
@@ -268,6 +268,12 @@ public class BasicCompletionWeigherTestGenerated extends AbstractBasicCompletion
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("MoreWordsMatchFirst.kt")
|
||||
public void testMoreWordsMatchFirst() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/weighers/basic/parameterNameAndType/MoreWordsMatchFirst.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ShorterFirst.kt")
|
||||
public void testShorterFirst() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/weighers/basic/parameterNameAndType/ShorterFirst.kt");
|
||||
|
||||
Reference in New Issue
Block a user