Project View: Fix presentation of Kotlin files and their members when @JvmName having the same name as the file itself

This commit is contained in:
Alexey Sedunov
2016-12-21 19:21:02 +03:00
parent 612dffb893
commit 7def536751
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -468,6 +468,8 @@ These artifacts include extensions for the types available in the latter JDKs, s
### IDE
- Project View: Fix presentation of Kotlin files and their members when @JvmName having the same name as the file itself
#### Intention actions, inspections and quickfixes
##### New features
@@ -26,6 +26,7 @@ import com.intellij.openapi.roots.ProjectRootManager
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.psi.PsiElement
import org.jetbrains.kotlin.asJava.classes.KtLightClass
import org.jetbrains.kotlin.asJava.classes.KtLightClassForFacade
import org.jetbrains.kotlin.idea.KotlinIconProvider
import org.jetbrains.kotlin.psi.KtClassBody
import org.jetbrains.kotlin.psi.KtClassOrObject
@@ -69,6 +70,7 @@ class KotlinExpandNodeProjectViewProvider : TreeStructureProvider, DumbAware {
private fun Any.asKtFile(): KtFile? = when (this) {
is KtFile -> this
is KtLightClassForFacade -> files.singleOrNull()
is KtLightClass -> kotlinOrigin?.containingFile as? KtFile
else -> null
}