a bit more diagnostics to track down "Cannot find package fragment for file"

This commit is contained in:
Dmitry Jemerov
2016-02-04 12:26:39 +01:00
parent 6038bde3c1
commit fa8706b46a
@@ -55,8 +55,10 @@ class PluginDeclarationProviderFactory(
}
override fun diagnoseMissingPackageFragment(file: KtFile) {
throw IllegalStateException("Cannot find package fragment for file ${file.name} with package ${file.packageFqName}, " +
"vFile ${file.virtualFile}, nonIndexed ${file in nonIndexedFiles}")
val packageFqName = file.packageFqName
throw IllegalStateException("Cannot find package fragment for file ${file.name} with package $packageFqName, " +
"vFile ${file.virtualFile}, nonIndexed ${file in nonIndexedFiles} " +
"packageExists=${PackageIndexUtil.packageExists(packageFqName, indexedFilesScope, project)}")
}
// trying to diagnose org.jetbrains.kotlin.resolve.lazy.NoDescriptorForDeclarationException in completion