Initial implementation of KT-6427 Completion to use Java name suggestion to complete function parameters

(+ filtered out synthetic Kotlin classes from completion)
This commit is contained in:
Valentin Kipyatkov
2015-06-17 17:55:51 +03:00
parent e0f1bde20a
commit 8210d3091f
31 changed files with 408 additions and 81 deletions
@@ -1,4 +0,0 @@
fun foo(i<caret>) { }
// INVOCATION_COUNT: 0
// NUMBER: 0
@@ -1,4 +0,0 @@
fun foo(@inlineOptions i<caret>) { }
// INVOCATION_COUNT: 0
// NUMBER: 0
@@ -0,0 +1,6 @@
import kotlin.properties.*
fun f(readOnlyProp<caret>)
// EXIST: { lookupString: "readOnlyProperty", itemText: "readOnlyProperty: ReadOnlyProperty", tailText: "<R, T> (kotlin.properties)" }
// NUMBER: 1
@@ -0,0 +1,6 @@
import java.io.*
fun f(printSt<caret>)
// EXIST_JAVA_ONLY: { lookupString: "printStream", itemText: "printStream: PrintStream", tailText: " (java.io)" }
// NUMBER_JAVA: 1
@@ -0,0 +1,3 @@
fun f(read<caret>)
// EXIST: { lookupString: "readOnlyProperty", itemText: "readOnlyProperty: ReadOnlyProperty", tailText: "<R, T> (kotlin.properties)" }
@@ -0,0 +1,3 @@
fun f(file<caret>)
// EXIST_JAVA_ONLY: { lookupString: "file", itemText: "file: File", tailText: " (java.io)" }
@@ -0,0 +1,11 @@
package pack
class FooBar
class Boo
fun f(b<caret>)
// EXIST: { lookupString: "bar", itemText: "bar: FooBar", tailText: " (pack)" }
// EXIST: { lookupString: "fooBar", itemText: "fooBar: FooBar", tailText: " (pack)" }
// EXIST: { lookupString: "boo", itemText: "boo: Boo", tailText: " (pack)" }
@@ -0,0 +1,8 @@
import kotlin.properties.*
val x: ReadOnlyPr<caret>
// INVOCATION_COUNT: 2
// EXIST: "ReadOnlyProperty"
// ABSENT: "ReadOnlyProperty$$TImpl"
// NOTHING_ELSE
@@ -1,4 +1,4 @@
// INSERT_WHITESPACES_IN_SIMPLE_ONE_LINE_METHOD: false
// CODE_STYLE_SETTING: INSERT_WHITESPACES_IN_SIMPLE_ONE_LINE_METHOD = false
fun main(args: Array<String>) {
args.fil<caret>
@@ -1,4 +1,4 @@
// INSERT_WHITESPACES_IN_SIMPLE_ONE_LINE_METHOD: false
// CODE_STYLE_SETTING: INSERT_WHITESPACES_IN_SIMPLE_ONE_LINE_METHOD = false
fun main(args: Array<String>) {
args.filter {<caret>}
@@ -0,0 +1,8 @@
// CODE_STYLE_SETTING: SPACE_BEFORE_TYPE_COLON = true
// CODE_STYLE_SETTING: SPACE_AFTER_TYPE_COLON = false
class FooBar
fun f(b<caret>)
// ELEMENT: bar
@@ -0,0 +1,8 @@
// CODE_STYLE_SETTING: SPACE_BEFORE_TYPE_COLON = true
// CODE_STYLE_SETTING: SPACE_AFTER_TYPE_COLON = false
class FooBar
fun f(bar :FooBar<caret>)
// ELEMENT: bar
@@ -0,0 +1,6 @@
class FooBar
fun f(b<caret>)
// ELEMENT: bar
// CHAR: ','
@@ -0,0 +1,6 @@
class FooBar
fun f(bar: FooBar, <caret>)
// ELEMENT: bar
// CHAR: ','
@@ -0,0 +1,3 @@
fun f(file<caret>)
// ELEMENT_TEXT: "file: File"
@@ -0,0 +1,5 @@
import java.io.File
fun f(file: File<caret>)
// ELEMENT_TEXT: "file: File"
@@ -0,0 +1,5 @@
class FooBar
fun f(b<caret>)
// ELEMENT: bar
@@ -0,0 +1,5 @@
class FooBar
fun f(bar: FooBar<caret>)
// ELEMENT: bar