Insert type arguments by Tab too
This commit is contained in:
+1
-1
@@ -100,7 +100,7 @@ class KotlinFunctionInsertHandler(
|
||||
val openingBracket = if (insertLambda) '{' else '('
|
||||
val closingBracket = if (insertLambda) '}' else ')'
|
||||
|
||||
var insertTypeArguments = inputTypeArguments && (completionChar == '\n' || completionChar == '\r')
|
||||
var insertTypeArguments = inputTypeArguments && (completionChar == '\n' || completionChar == '\r' || completionChar == Lookup.REPLACE_SELECT_CHAR)
|
||||
|
||||
if (completionChar == Lookup.REPLACE_SELECT_CHAR) {
|
||||
val offset1 = chars.skipSpaces(offset)
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
inline fun <reified R> Iterable<*>.myFilterIsInstance(): List<R> {
|
||||
return filterIsInstanceTo(ArrayList<R>())
|
||||
}
|
||||
|
||||
fun foo(list: List<Any>) {
|
||||
list.<caret>filter(x)
|
||||
}
|
||||
|
||||
// ELEMENT: myFilterIsInstance
|
||||
// CHAR: '\t'
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
inline fun <reified R> Iterable<*>.myFilterIsInstance(): List<R> {
|
||||
return filterIsInstanceTo(ArrayList<R>())
|
||||
}
|
||||
|
||||
fun foo(list: List<Any>) {
|
||||
list.myFilterIsInstance<<caret>>(x)
|
||||
}
|
||||
|
||||
// ELEMENT: myFilterIsInstance
|
||||
// CHAR: '\t'
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
inline fun <reified R> Iterable<*>.myFilterIsInstance(): List<R> {
|
||||
return filterIsInstanceTo(ArrayList<R>())
|
||||
}
|
||||
|
||||
fun foo(list: List<Any>) {
|
||||
list.<caret>filter<String>(x)
|
||||
}
|
||||
|
||||
// ELEMENT: myFilterIsInstance
|
||||
// CHAR: '\t'
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
inline fun <reified R> Iterable<*>.myFilterIsInstance(): List<R> {
|
||||
return filterIsInstanceTo(ArrayList<R>())
|
||||
}
|
||||
|
||||
fun foo(list: List<Any>) {
|
||||
list.myFilterIsInstance<String>(<caret>x)
|
||||
}
|
||||
|
||||
// ELEMENT: myFilterIsInstance
|
||||
// CHAR: '\t'
|
||||
+12
@@ -481,6 +481,18 @@ public class BasicCompletionHandlerTestGenerated extends AbstractBasicCompletion
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ReplaceByTab1.kt")
|
||||
public void testReplaceByTab1() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/handlers/basic/typeArgsForCall/ReplaceByTab1.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ReplaceByTab2.kt")
|
||||
public void testReplaceByTab2() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/handlers/basic/typeArgsForCall/ReplaceByTab2.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("Simple.kt")
|
||||
public void testSimple() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/handlers/basic/typeArgsForCall/Simple.kt");
|
||||
|
||||
Reference in New Issue
Block a user