Fixed completion for type parameters broken recently
This commit is contained in:
@@ -16,15 +16,15 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.renderer
|
package org.jetbrains.kotlin.renderer
|
||||||
|
|
||||||
import org.jetbrains.kotlin.descriptors.ClassDescriptor
|
import org.jetbrains.kotlin.descriptors.*
|
||||||
import org.jetbrains.kotlin.descriptors.ClassifierDescriptor
|
|
||||||
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
|
|
||||||
import org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor
|
|
||||||
import org.jetbrains.kotlin.name.FqNameBase
|
import org.jetbrains.kotlin.name.FqNameBase
|
||||||
import org.jetbrains.kotlin.name.Name
|
import org.jetbrains.kotlin.name.Name
|
||||||
|
|
||||||
public fun qualifiedNameForSourceCode(descriptor: ClassifierDescriptor): String {
|
public fun qualifiedNameForSourceCode(descriptor: ClassifierDescriptor): String {
|
||||||
val nameString = descriptor.getName().render()
|
val nameString = descriptor.getName().render()
|
||||||
|
if (descriptor is TypeParameterDescriptor) {
|
||||||
|
return nameString
|
||||||
|
}
|
||||||
val qualifier = qualifierName(descriptor.getContainingDeclaration())
|
val qualifier = qualifierName(descriptor.getContainingDeclaration())
|
||||||
return if (qualifier != null && qualifier != "") qualifier + "." + nameString else nameString
|
return if (qualifier != null && qualifier != "") qualifier + "." + nameString else nameString
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package xxx
|
||||||
|
|
||||||
|
class A<T> {
|
||||||
|
fun foo(x: <caret>)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ELEMENT: T
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package xxx
|
||||||
|
|
||||||
|
class A<T> {
|
||||||
|
fun foo(x: T<caret>)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ELEMENT: T
|
||||||
+6
@@ -143,6 +143,12 @@ public class BasicCompletionHandlerTestGenerated extends AbstractBasicCompletion
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("TypeParameter.kt")
|
||||||
|
public void testTypeParameter() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/handlers/basic/TypeParameter.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("idea/idea-completion/testData/handlers/basic/exclChar")
|
@TestMetadata("idea/idea-completion/testData/handlers/basic/exclChar")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
|||||||
Reference in New Issue
Block a user