Introduce KotlinMetadataFinder#hasMetadataPackage
Before creating a MetadataPackageFragment, check that the corresponding directory (across the classpath) contains at least one .kotlin_metadata file. Otherwise we're creating packages for every simple name queried during the resolution and sometimes prefer a (empty) package to the existing class, for example when the latter class is star-imported
This commit is contained in:
+3
@@ -119,6 +119,9 @@ class DirectoryBasedClassFinder(
|
||||
// TODO
|
||||
override fun findMetadata(classId: ClassId): InputStream? = null
|
||||
|
||||
// TODO
|
||||
override fun hasMetadataPackage(fqName: FqName): Boolean = false
|
||||
|
||||
// TODO: load built-ins from packageDirectory?
|
||||
override fun findBuiltInsData(packageFqName: FqName): InputStream? = null
|
||||
}
|
||||
|
||||
@@ -59,6 +59,9 @@ class JvmIDEVirtualFileFinder(private val scope: GlobalSearchScope) : VirtualFil
|
||||
// TODO
|
||||
override fun findMetadata(classId: ClassId): InputStream? = null
|
||||
|
||||
// TODO
|
||||
override fun hasMetadataPackage(fqName: FqName): Boolean = false
|
||||
|
||||
// TODO: load built-ins metadata from scope
|
||||
override fun findBuiltInsData(packageFqName: FqName): InputStream? = null
|
||||
|
||||
|
||||
Reference in New Issue
Block a user