KT-9813 Parameter name&type completion gets in the way of typing
#KT-9813 Fixed
This commit is contained in:
+2
-1
@@ -33,9 +33,9 @@ import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
|
|||||||
import org.jetbrains.kotlin.idea.core.KotlinIndicesHelper
|
import org.jetbrains.kotlin.idea.core.KotlinIndicesHelper
|
||||||
import org.jetbrains.kotlin.idea.core.KotlinNameSuggester
|
import org.jetbrains.kotlin.idea.core.KotlinNameSuggester
|
||||||
import org.jetbrains.kotlin.idea.core.formatter.JetCodeStyleSettings
|
import org.jetbrains.kotlin.idea.core.formatter.JetCodeStyleSettings
|
||||||
import org.jetbrains.kotlin.idea.util.getResolutionScope
|
|
||||||
import org.jetbrains.kotlin.idea.resolve.ResolutionFacade
|
import org.jetbrains.kotlin.idea.resolve.ResolutionFacade
|
||||||
import org.jetbrains.kotlin.idea.util.IdeDescriptorRenderers
|
import org.jetbrains.kotlin.idea.util.IdeDescriptorRenderers
|
||||||
|
import org.jetbrains.kotlin.idea.util.getResolutionScope
|
||||||
import org.jetbrains.kotlin.psi.KtDeclaration
|
import org.jetbrains.kotlin.psi.KtDeclaration
|
||||||
import org.jetbrains.kotlin.psi.KtExpression
|
import org.jetbrains.kotlin.psi.KtExpression
|
||||||
import org.jetbrains.kotlin.psi.KtParameter
|
import org.jetbrains.kotlin.psi.KtParameter
|
||||||
@@ -194,6 +194,7 @@ class ParameterNameAndTypeCompletion(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// we need space before colon in lookupString otherwise completion list is not closed on typing ':' (see KT-9813)
|
||||||
private val lookupString = parameterName + " : " + delegate.lookupString
|
private val lookupString = parameterName + " : " + delegate.lookupString
|
||||||
|
|
||||||
override fun getLookupString() = lookupString
|
override fun getLookupString() = lookupString
|
||||||
|
|||||||
+1
-1
@@ -18,5 +18,5 @@ class A(overr<caret>) : Base2(), I
|
|||||||
// EXIST: { itemText: "override val someVal: Int", tailText: null, typeText: "I", attributes: "bold" }
|
// EXIST: { itemText: "override val someVal: Int", tailText: null, typeText: "I", attributes: "bold" }
|
||||||
// EXIST: { itemText: "override var someVar: Int", tailText: null, typeText: "I", attributes: "bold" }
|
// EXIST: { itemText: "override var someVar: Int", tailText: null, typeText: "I", attributes: "bold" }
|
||||||
// EXIST: { itemText: "override val fromBase: String", tailText: null, typeText: "Base1", attributes: "" }
|
// EXIST: { itemText: "override val fromBase: String", tailText: null, typeText: "Base1", attributes: "" }
|
||||||
// EXIST_JAVA_ONLY: { lookupString: "override: Override", itemText: "override: Override" }
|
// EXIST_JAVA_ONLY: { itemText: "override: Override" }
|
||||||
// NOTHING_ELSE
|
// NOTHING_ELSE
|
||||||
|
|||||||
+1
-1
@@ -3,5 +3,5 @@ class FooBaaaaar
|
|||||||
fun f(fooBaaaa<caret>)
|
fun f(fooBaaaa<caret>)
|
||||||
|
|
||||||
// AUTOCOMPLETE_SETTING: true
|
// AUTOCOMPLETE_SETTING: true
|
||||||
// EXIST: fooBaaaaar: FooBaaaaar
|
// EXIST: { itemText: "fooBaaaaar: FooBaaaaar" }
|
||||||
// NUMBER: 1
|
// NUMBER: 1
|
||||||
|
|||||||
+1
-1
@@ -6,4 +6,4 @@ fun f() {
|
|||||||
x(fun (b<caret>))
|
x(fun (b<caret>))
|
||||||
}
|
}
|
||||||
|
|
||||||
// ABSENT: boo: Boo
|
// ABSENT: { itemText: "boo: Boo" }
|
||||||
|
|||||||
+1
-1
@@ -7,4 +7,4 @@ fun f() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ABSENT: "exception: Exception"
|
// ABSENT: { itemText: "exception: Exception" }
|
||||||
|
|||||||
+1
-1
@@ -6,4 +6,4 @@ fun f() {
|
|||||||
val handler = { b<caret> }
|
val handler = { b<caret> }
|
||||||
}
|
}
|
||||||
|
|
||||||
// ABSENT: boo: Boo
|
// ABSENT: { itemText: "boo: Boo" }
|
||||||
|
|||||||
+1
-1
@@ -4,4 +4,4 @@ var v: Int
|
|||||||
get(){}
|
get(){}
|
||||||
set(v<caret>)
|
set(v<caret>)
|
||||||
|
|
||||||
// ABSENT: voo: Voo
|
// ABSENT: { itemText: "voo: Voo" }
|
||||||
|
|||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
fun f(read<caret>)
|
fun f(read<caret>)
|
||||||
|
|
||||||
// EXIST: { lookupString: "readOnlyProperty: ReadOnlyProperty", itemText: "readOnlyProperty: ReadOnlyProperty", tailText: "<R, T> (kotlin.properties)" }
|
// EXIST: { itemText: "readOnlyProperty: ReadOnlyProperty", tailText: "<R, T> (kotlin.properties)" }
|
||||||
|
|||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
fun f(file<caret>)
|
fun f(file<caret>)
|
||||||
|
|
||||||
// EXIST_JAVA_ONLY: { lookupString: "file: File", itemText: "file: File", tailText: " (java.io)" }
|
// EXIST_JAVA_ONLY: { itemText: "file: File", tailText: " (java.io)" }
|
||||||
|
|||||||
+2
-2
@@ -24,5 +24,5 @@ class C(val handler: () -> Unit) {
|
|||||||
// EXIST_JAVA_ONLY: { lookupString: "value : File", itemText: "value: File", tailText: " (java.io)" }
|
// EXIST_JAVA_ONLY: { lookupString: "value : File", itemText: "value: File", tailText: " (java.io)" }
|
||||||
// EXIST: { lookupString: "handler : (() -> String)?", itemText: "handler: (() -> String)?", tailText: null }
|
// EXIST: { lookupString: "handler : (() -> String)?", itemText: "handler: (() -> String)?", tailText: null }
|
||||||
// EXIST: { lookupString: "handler : () -> Unit", itemText: "handler: () -> Unit", tailText: null }
|
// EXIST: { lookupString: "handler : () -> Unit", itemText: "handler: () -> Unit", tailText: null }
|
||||||
// ABSENT: "localParam: String"
|
// ABSENT: { itemText: "localParam: String" }
|
||||||
// ABSENT: "file: File"
|
// ABSENT: { itemText: "file: File" }
|
||||||
|
|||||||
Vendored
+1
-1
@@ -6,5 +6,5 @@ class X<T1> {
|
|||||||
fun foo(xxx<caret>)
|
fun foo(xxx<caret>)
|
||||||
}
|
}
|
||||||
|
|
||||||
// EXIST: { lookupString: "xxxValue1: T1", itemText: "xxxValue1: T1", tailText: null }
|
// EXIST: { itemText: "xxxValue1: T1", tailText: null }
|
||||||
// NOTHING_ELSE
|
// NOTHING_ELSE
|
||||||
|
|||||||
Vendored
+1
-1
@@ -8,5 +8,5 @@ class X<T1> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// EXIST: { lookupString: "xxxValue1: T1", itemText: "xxxValue1: T1", tailText: null }
|
// EXIST: { itemText: "xxxValue1: T1", tailText: null }
|
||||||
// NOTHING_ELSE
|
// NOTHING_ELSE
|
||||||
|
|||||||
@@ -7,5 +7,5 @@ class Boo
|
|||||||
fun f(b<caret>)
|
fun f(b<caret>)
|
||||||
|
|
||||||
// EXIST: { lookupString: "bar : FooBar", itemText: "bar: FooBar", tailText: " (pack)" }
|
// EXIST: { lookupString: "bar : FooBar", itemText: "bar: FooBar", tailText: " (pack)" }
|
||||||
// ABSENT: fooBar: FooBar
|
// ABSENT: { itemText: "fooBar: FooBar" }
|
||||||
// EXIST: { lookupString: "boo : Boo", itemText: "boo: Boo", tailText: " (pack)" }
|
// EXIST: { lookupString: "boo : Boo", itemText: "boo: Boo", tailText: " (pack)" }
|
||||||
|
|||||||
+2
-2
@@ -2,5 +2,5 @@ import java.net.URLConnection
|
|||||||
|
|
||||||
fun foo(url<caret>){}
|
fun foo(url<caret>){}
|
||||||
|
|
||||||
// EXIST_JAVA_ONLY: { lookupString: "urlConnection: URLConnection", itemText: "urlConnection: URLConnection", tailText: " (java.net)" }
|
// EXIST_JAVA_ONLY: { itemText: "urlConnection: URLConnection", tailText: " (java.net)" }
|
||||||
// ABSENT: urlconnection
|
// ABSENT: { itemText: "urlconnection: URLConnection" }
|
||||||
|
|||||||
+1
-1
@@ -7,5 +7,5 @@ class Boo
|
|||||||
fun f(myB<caret>)
|
fun f(myB<caret>)
|
||||||
|
|
||||||
// EXIST: { lookupString: "myBar : FooBar", itemText: "myBar: FooBar", tailText: " (pack)" }
|
// EXIST: { lookupString: "myBar : FooBar", itemText: "myBar: FooBar", tailText: " (pack)" }
|
||||||
// ABSENT: myBFooBar: FooBar
|
// ABSENT: { itemText: "myBFooBar: FooBar" }
|
||||||
// EXIST: { lookupString: "myBoo : Boo", itemText: "myBoo: Boo", tailText: " (pack)" }
|
// EXIST: { lookupString: "myBoo : Boo", itemText: "myBoo: Boo", tailText: " (pack)" }
|
||||||
|
|||||||
+3
-3
@@ -6,6 +6,6 @@ class Boo
|
|||||||
|
|
||||||
class C(val b<caret>)
|
class C(val b<caret>)
|
||||||
|
|
||||||
// EXIST: { lookupString: "bar: FooBar", itemText: "bar: FooBar", tailText: " (pack)" }
|
// EXIST: { itemText: "bar: FooBar", tailText: " (pack)" }
|
||||||
// ABSENT: fooBar: FooBar
|
// ABSENT: { itemText: "fooBar: FooBar" }
|
||||||
// EXIST: { lookupString: "boo: Boo", itemText: "boo: Boo", tailText: " (pack)" }
|
// EXIST: { itemText: "boo: Boo", tailText: " (pack)" }
|
||||||
|
|||||||
+3
-3
@@ -6,6 +6,6 @@ class Boo
|
|||||||
|
|
||||||
class C(private var b<caret>)
|
class C(private var b<caret>)
|
||||||
|
|
||||||
// EXIST: { lookupString: "bar: FooBar", itemText: "bar: FooBar", tailText: " (pack)" }
|
// EXIST: { itemText: "bar: FooBar", tailText: " (pack)" }
|
||||||
// ABSENT: fooBar: FooBar
|
// ABSENT: { itemText: "fooBar: FooBar" }
|
||||||
// EXIST: { lookupString: "boo: Boo", itemText: "boo: Boo", tailText: " (pack)" }
|
// EXIST: { itemText: "boo: Boo", tailText: " (pack)" }
|
||||||
|
|||||||
+1
-1
@@ -5,4 +5,4 @@ class FooBar
|
|||||||
|
|
||||||
fun f(b<caret>)
|
fun f(b<caret>)
|
||||||
|
|
||||||
// ELEMENT: bar: FooBar
|
// ELEMENT_TEXT: bar: FooBar
|
||||||
|
|||||||
Vendored
+1
-1
@@ -5,4 +5,4 @@ class FooBar
|
|||||||
|
|
||||||
fun f(bar :FooBar<caret>)
|
fun f(bar :FooBar<caret>)
|
||||||
|
|
||||||
// ELEMENT: bar: FooBar
|
// ELEMENT_TEXT: bar: FooBar
|
||||||
|
|||||||
@@ -2,5 +2,5 @@ class FooBar
|
|||||||
|
|
||||||
fun f(b<caret>)
|
fun f(b<caret>)
|
||||||
|
|
||||||
// ELEMENT: bar: FooBar
|
// ELEMENT_TEXT: bar: FooBar
|
||||||
// CHAR: ','
|
// CHAR: ','
|
||||||
|
|||||||
+1
-1
@@ -2,5 +2,5 @@ class FooBar
|
|||||||
|
|
||||||
fun f(bar: FooBar, <caret>)
|
fun f(bar: FooBar, <caret>)
|
||||||
|
|
||||||
// ELEMENT: bar: FooBar
|
// ELEMENT_TEXT: bar: FooBar
|
||||||
// CHAR: ','
|
// CHAR: ','
|
||||||
|
|||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
fun f(file<caret>)
|
fun f(file<caret>)
|
||||||
|
|
||||||
// ELEMENT: "file: File"
|
// ELEMENT_TEXT: "file: File"
|
||||||
|
|||||||
+1
-1
@@ -2,4 +2,4 @@ import java.io.File
|
|||||||
|
|
||||||
fun f(file: File<caret>)
|
fun f(file: File<caret>)
|
||||||
|
|
||||||
// ELEMENT: "file: File"
|
// ELEMENT_TEXT: "file: File"
|
||||||
|
|||||||
+1
-1
@@ -2,4 +2,4 @@ fun foo(xxx: ((java.io.File) -> List<String>)?)
|
|||||||
|
|
||||||
fun bar(x<caret>)
|
fun bar(x<caret>)
|
||||||
|
|
||||||
// ELEMENT: xxx: ((File) -> List<String>)?
|
// ELEMENT_TEXT: 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>)
|
fun bar(xxx: ((File) -> List<String>)?<caret>)
|
||||||
|
|
||||||
// ELEMENT: xxx: ((File) -> List<String>)?
|
// ELEMENT_TEXT: xxx: ((File) -> List<String>)?
|
||||||
|
|||||||
+1
-1
@@ -2,4 +2,4 @@ class FooBar
|
|||||||
|
|
||||||
fun f(b<caret>)
|
fun f(b<caret>)
|
||||||
|
|
||||||
// ELEMENT: bar: FooBar
|
// ELEMENT_TEXT: bar: FooBar
|
||||||
|
|||||||
+1
-1
@@ -2,4 +2,4 @@ class FooBar
|
|||||||
|
|
||||||
fun f(bar: FooBar<caret>)
|
fun f(bar: FooBar<caret>)
|
||||||
|
|
||||||
// ELEMENT: bar: FooBar
|
// ELEMENT_TEXT: bar: FooBar
|
||||||
|
|||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
fun<T> foo(t<caret>)
|
fun<T> foo(t<caret>)
|
||||||
|
|
||||||
// ELEMENT: t: T
|
// ELEMENT_TEXT: t: T
|
||||||
|
|||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
fun<T> foo(t: T<caret>)
|
fun<T> foo(t: T<caret>)
|
||||||
|
|
||||||
// ELEMENT: t: T
|
// ELEMENT_TEXT: t: T
|
||||||
|
|||||||
+1
-1
@@ -2,4 +2,4 @@ class FooBar
|
|||||||
|
|
||||||
fun f(myFo<caret>)
|
fun f(myFo<caret>)
|
||||||
|
|
||||||
// ELEMENT: myFooBar: FooBar
|
// ELEMENT_TEXT: myFooBar: FooBar
|
||||||
|
|||||||
+1
-1
@@ -2,4 +2,4 @@ class FooBar
|
|||||||
|
|
||||||
fun f(myFooBar: FooBar<caret>)
|
fun f(myFooBar: FooBar<caret>)
|
||||||
|
|
||||||
// ELEMENT: myFooBar: FooBar
|
// ELEMENT_TEXT: myFooBar: FooBar
|
||||||
|
|||||||
Reference in New Issue
Block a user