Update Icon for .kts and .gradle.kts files
^KT-23431 Fixed
This commit is contained in:
@@ -39,6 +39,12 @@ import javax.swing.Icon
|
||||
class KotlinIconProvider : IconProvider(), DumbAware {
|
||||
override fun getIcon(psiElement: PsiElement, flags: Int): Icon? {
|
||||
if (psiElement is KtFile) {
|
||||
if (psiElement.isScript()) {
|
||||
return when {
|
||||
psiElement.name.endsWith(".gradle.kts") -> KotlinIcons.GRADLE_SCRIPT
|
||||
else -> KotlinIcons.SCRIPT
|
||||
}
|
||||
}
|
||||
val mainClass = getSingleClass(psiElement)
|
||||
return if (mainClass != null) getIcon(mainClass, flags) else KotlinIcons.FILE
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@ public interface KotlinIcons {
|
||||
Icon ABSTRACT_CLASS = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/abstractClassKotlin.png");
|
||||
Icon ENUM = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/enumKotlin.png");
|
||||
Icon FILE = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/kotlin_file.png");
|
||||
Icon SCRIPT = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/kotlin_script.png");
|
||||
Icon GRADLE_SCRIPT = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/kotlin_gradle_script.png");
|
||||
Icon ACTIVITY = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/kotlin_activity.png");
|
||||
Icon OBJECT = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/objectKotlin.png");
|
||||
Icon INTERFACE = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/interfaceKotlin.png");
|
||||
|
||||
Reference in New Issue
Block a user