Completion: moved signatures from "item text" to tail
#KT-5652 Fixed
This commit is contained in:
@@ -20,6 +20,7 @@ import com.google.common.base.Function;
|
||||
import com.google.common.collect.Collections2;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonNull;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.intellij.codeInsight.lookup.LookupElement;
|
||||
@@ -75,7 +76,10 @@ public class ExpectedCompletionUtils {
|
||||
if (!validKeys.contains(key)) {
|
||||
throw new RuntimeException("Invalid json property '" + key + "'");
|
||||
}
|
||||
map.put(key, entry.getValue().getAsString());
|
||||
JsonElement value = entry.getValue();
|
||||
if (!(value instanceof JsonNull)) {
|
||||
map.put(key, value.getAsString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -298,6 +298,12 @@ public class JSBasicCompletionTestGenerated extends AbstractJSBasicCompletionTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("HigherOrderFunction2.kt")
|
||||
public void testHigherOrderFunction2() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/completion/basic/common/HigherOrderFunction2.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ImportedEnumMembers.kt")
|
||||
public void testImportedEnumMembers() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/completion/basic/common/ImportedEnumMembers.kt");
|
||||
|
||||
@@ -298,6 +298,12 @@ public class JvmBasicCompletionTestGenerated extends AbstractJvmBasicCompletionT
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("HigherOrderFunction2.kt")
|
||||
public void testHigherOrderFunction2() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/completion/basic/common/HigherOrderFunction2.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ImportedEnumMembers.kt")
|
||||
public void testImportedEnumMembers() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/completion/basic/common/ImportedEnumMembers.kt");
|
||||
|
||||
@@ -84,11 +84,11 @@ public class BasicCompletionHandlerTest : CompletionHandlerTestBase(){
|
||||
|
||||
fun testHigherOrderFunctionWithArg() = doTest(2, "filterNot", null, '\n')
|
||||
|
||||
fun testHigherOrderFunctionWithArgs1() = doTest(1, "foo", "foo { (String, Char) -> ... }", null, '\n')
|
||||
fun testHigherOrderFunctionWithArgs1() = doTest(1, "foo", "foo", " { (String, Char) -> ... }", '\n')
|
||||
|
||||
fun testHigherOrderFunctionWithArgs2() = doTest(1, "foo", "foo(p: (String, Char) -> Boolean)", null, '\n')
|
||||
fun testHigherOrderFunctionWithArgs2() = doTest(1, "foo", "foo", "(p: (String, Char) -> Boolean)", '\n')
|
||||
|
||||
fun testHigherOrderFunctionWithArgs3() = doTest(1, "foo", "foo { (String, Char) -> ... }", null, '\n')
|
||||
fun testHigherOrderFunctionWithArgs3() = doTest(1, "foo", "foo", " { (String, Char) -> ... }", '\n')
|
||||
|
||||
fun testForceParenthesisForTabChar() = doTest(0, "some", null, '\t')
|
||||
|
||||
@@ -161,7 +161,7 @@ public class BasicCompletionHandlerTest : CompletionHandlerTestBase(){
|
||||
fun testTypeArgOfSuper() = doTest(1, "X", null, '\n')
|
||||
|
||||
fun testKeywordClassName() = doTest(1, "class", null, '\n')
|
||||
fun testKeywordFunctionName() = doTest(1, "fun", "fun()", null, '\n')
|
||||
fun testKeywordFunctionName() = doTest(1, "fun", "fun", "()", '\n')
|
||||
|
||||
fun testInfixCall() = doTest(1, "to", null, null, '\n')
|
||||
fun testInfixCallOnSpace() = doTest(1, "to", null, null, ' ')
|
||||
|
||||
Reference in New Issue
Block a user