KT-11308 Hide kotlin.jvm.internal package contents from completion and auto-import
#KT-11308 fixed
This commit is contained in:
@@ -158,7 +158,7 @@ abstract class CompletionSession(
|
||||
|
||||
private fun isVisibleDescriptor(descriptor: DeclarationDescriptor, completeNonAccessible: Boolean): Boolean {
|
||||
if (!configuration.javaClassesNotToBeUsed && descriptor is ClassDescriptor) {
|
||||
if (descriptor.importableFqName?.let { isJavaClassNotToBeUsedInKotlin(it) } == true) return false
|
||||
if (descriptor.importableFqName?.let(::isJavaClassNotToBeUsedInKotlin) == true) return false
|
||||
}
|
||||
|
||||
if (descriptor is TypeParameterDescriptor && !isTypeParameterVisible(descriptor)) return false
|
||||
@@ -169,6 +169,8 @@ abstract class CompletionSession(
|
||||
return completeNonAccessible && (!descriptor.isFromLibrary() || isDebuggerContext)
|
||||
}
|
||||
|
||||
if (descriptor.isExcludedFromAutoImport(project)) return false
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
fun some() {
|
||||
kotlin.jvm.<caret>
|
||||
}
|
||||
|
||||
// ABSENT: internal
|
||||
+6
@@ -572,6 +572,12 @@ public class JSBasicCompletionTestGenerated extends AbstractJSBasicCompletionTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("NoCompletionForExcluded.kt")
|
||||
public void testNoCompletionForExcluded() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/NoCompletionForExcluded.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("NoEmptyPackage.kt")
|
||||
public void testNoEmptyPackage() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/NoEmptyPackage.kt");
|
||||
|
||||
+6
@@ -572,6 +572,12 @@ public class JvmBasicCompletionTestGenerated extends AbstractJvmBasicCompletionT
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("NoCompletionForExcluded.kt")
|
||||
public void testNoCompletionForExcluded() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/NoCompletionForExcluded.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("NoEmptyPackage.kt")
|
||||
public void testNoEmptyPackage() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/NoEmptyPackage.kt");
|
||||
|
||||
Reference in New Issue
Block a user