More elegant way to achieve the same + fixed KT-7746 Top level package name completion does not work inside class body
#KT-7746 Fixed
This commit is contained in:
+4
-4
@@ -233,11 +233,11 @@ class BasicCompletionSession(configuration: CompletionSessionConfiguration,
|
||||
private companion object {
|
||||
object NonAnnotationClassifierExclude : DescriptorKindExclude {
|
||||
override fun matches(descriptor: DeclarationDescriptor): Boolean {
|
||||
return if (descriptor is ClassDescriptor)
|
||||
descriptor.getKind() != ClassKind.ANNOTATION_CLASS
|
||||
else
|
||||
descriptor !is ClassifierDescriptor
|
||||
if (descriptor !is ClassifierDescriptor) return false
|
||||
return descriptor !is ClassDescriptor || descriptor.getKind() != ClassKind.ANNOTATION_CLASS
|
||||
}
|
||||
|
||||
override val fullyExcludedDescriptorKinds: Int get() = 0
|
||||
}
|
||||
|
||||
val ANNOTATION_TYPES_FILTER = DescriptorKindFilter(DescriptorKindFilter.NON_SINGLETON_CLASSIFIERS_MASK or DescriptorKindFilter.PACKAGES_MASK) exclude NonAnnotationClassifierExclude
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
class A {
|
||||
kot<caret>
|
||||
}
|
||||
|
||||
// EXIST: "kotlin"
|
||||
+6
@@ -865,6 +865,12 @@ public class JSBasicCompletionTestGenerated extends AbstractJSBasicCompletionTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("TopLevelPackageInClassBody.kt")
|
||||
public void testTopLevelPackageInClassBody() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/TopLevelPackageInClassBody.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("TypeParameterFromOuterClass.kt")
|
||||
public void testTypeParameterFromOuterClass() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/TypeParameterFromOuterClass.kt");
|
||||
|
||||
+6
@@ -865,6 +865,12 @@ public class JvmBasicCompletionTestGenerated extends AbstractJvmBasicCompletionT
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("TopLevelPackageInClassBody.kt")
|
||||
public void testTopLevelPackageInClassBody() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/TopLevelPackageInClassBody.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("TypeParameterFromOuterClass.kt")
|
||||
public void testTypeParameterFromOuterClass() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/TypeParameterFromOuterClass.kt");
|
||||
|
||||
Reference in New Issue
Block a user