Do not hide kotlin class files in source roots

This fixes a problem where file is indexed but querying
    index fails with an exception because file has no PSI

 #KT-21061 Fixed
This commit is contained in:
Pavel V. Talanov
2017-11-10 19:58:31 +03:00
parent 8696b37cdb
commit 6667732dd4
@@ -47,11 +47,8 @@ class KotlinClassFileDecompiler : ClassFileDecompilers.Full() {
override fun getStubBuilder() = stubBuilder
override fun createFileViewProvider(file: VirtualFile, manager: PsiManager, physical: Boolean): KotlinDecompiledFileViewProvider {
val project = manager.project
return KotlinDecompiledFileViewProvider(manager, file, physical) factory@{ provider ->
val virtualFile = provider.virtualFile
val fileIndex = ServiceManager.getService(project, FileIndexFacade::class.java)
if (!fileIndex.isInLibraryClasses(virtualFile) && fileIndex.isInSource(virtualFile)) return@factory null
if (isKotlinInternalCompiledFile(virtualFile))
null