IDE/FIR IDE: fix not showed following type parameters in completion

This commit is contained in:
Ilya Kirillov
2021-05-26 20:04:56 +02:00
committed by TeamCityServer
parent 0f13359229
commit ff369b1917
5 changed files with 29 additions and 0 deletions
@@ -0,0 +1,5 @@
// FIR_COMPARISON
fun <T: <caret>, S>.foo() {}
// EXIST: S
@@ -651,6 +651,11 @@ public class JSBasicCompletionTestGenerated extends AbstractJSBasicCompletionTes
runTest("idea/idea-completion/testData/basic/common/RecieverMembersFromExtFun.kt");
}
@TestMetadata("SecondTypeArg.kt")
public void testSecondTypeArg() throws Exception {
runTest("idea/idea-completion/testData/basic/common/SecondTypeArg.kt");
}
@TestMetadata("SetPrefixForProperties.kt")
public void testSetPrefixForProperties() throws Exception {
runTest("idea/idea-completion/testData/basic/common/SetPrefixForProperties.kt");
@@ -651,6 +651,11 @@ public class JvmBasicCompletionTestGenerated extends AbstractJvmBasicCompletionT
runTest("idea/idea-completion/testData/basic/common/RecieverMembersFromExtFun.kt");
}
@TestMetadata("SecondTypeArg.kt")
public void testSecondTypeArg() throws Exception {
runTest("idea/idea-completion/testData/basic/common/SecondTypeArg.kt");
}
@TestMetadata("SetPrefixForProperties.kt")
public void testSetPrefixForProperties() throws Exception {
runTest("idea/idea-completion/testData/basic/common/SetPrefixForProperties.kt");
@@ -651,6 +651,11 @@ public class HighLevelJvmBasicCompletionTestGenerated extends AbstractHighLevelJ
runTest("idea/idea-completion/testData/basic/common/RecieverMembersFromExtFun.kt");
}
@TestMetadata("SecondTypeArg.kt")
public void testSecondTypeArg() throws Exception {
runTest("idea/idea-completion/testData/basic/common/SecondTypeArg.kt");
}
@TestMetadata("SetPrefixForProperties.kt")
public void testSetPrefixForProperties() throws Exception {
runTest("idea/idea-completion/testData/basic/common/SetPrefixForProperties.kt");
@@ -43,10 +43,19 @@ abstract class CompletionDummyIdentifierProviderService {
?: specialExtensionReceiverDummyIdentifier(tokenBefore)
?: specialInTypeArgsDummyIdentifier(tokenBefore)
?: specialInArgumentListDummyIdentifier(tokenBefore)
?: isInTypeParametersList(tokenBefore)
?: DEFAULT_DUMMY_IDENTIFIER
}
}
private fun isInTypeParametersList(tokenBefore: PsiElement?): String? {
if (tokenBefore == null) return null
if (tokenBefore.parents.any { it is KtTypeParameterList }) {
return CompletionUtilCore.DUMMY_IDENTIFIER_TRIMMED
}
return null
}
private fun specialLambdaSignatureDummyIdentifier(tokenBefore: PsiElement?): String? {
var leaf = tokenBefore
while (leaf is PsiWhiteSpace || leaf is PsiComment) {