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:
@@ -468,6 +468,8 @@ These artifacts include extensions for the types available in the latter JDKs, s
|
|||||||
|
|
||||||
### IDE
|
### 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
|
#### Intention actions, inspections and quickfixes
|
||||||
|
|
||||||
##### New features
|
##### New features
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import com.intellij.openapi.roots.ProjectRootManager
|
|||||||
import com.intellij.openapi.vfs.VirtualFile
|
import com.intellij.openapi.vfs.VirtualFile
|
||||||
import com.intellij.psi.PsiElement
|
import com.intellij.psi.PsiElement
|
||||||
import org.jetbrains.kotlin.asJava.classes.KtLightClass
|
import org.jetbrains.kotlin.asJava.classes.KtLightClass
|
||||||
|
import org.jetbrains.kotlin.asJava.classes.KtLightClassForFacade
|
||||||
import org.jetbrains.kotlin.idea.KotlinIconProvider
|
import org.jetbrains.kotlin.idea.KotlinIconProvider
|
||||||
import org.jetbrains.kotlin.psi.KtClassBody
|
import org.jetbrains.kotlin.psi.KtClassBody
|
||||||
import org.jetbrains.kotlin.psi.KtClassOrObject
|
import org.jetbrains.kotlin.psi.KtClassOrObject
|
||||||
@@ -69,6 +70,7 @@ class KotlinExpandNodeProjectViewProvider : TreeStructureProvider, DumbAware {
|
|||||||
|
|
||||||
private fun Any.asKtFile(): KtFile? = when (this) {
|
private fun Any.asKtFile(): KtFile? = when (this) {
|
||||||
is KtFile -> this
|
is KtFile -> this
|
||||||
|
is KtLightClassForFacade -> files.singleOrNull()
|
||||||
is KtLightClass -> kotlinOrigin?.containingFile as? KtFile
|
is KtLightClass -> kotlinOrigin?.containingFile as? KtFile
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user