diff --git a/CHANGELOG.md b/CHANGELOG.md index f6a19b6..f194be9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ ### Added +- Differentiate Java files (Annotation, Class, Enum, etc.) by colour and shape in the file tree. If you know how to + implement these icons in the rest of the user interface, please reach out to us via the issue tracker or the + Catppuccin discord! +- Upgrade submodule `vscode-icons` from v1.15.0 to v1.16.0 (See [vscode-icons CHANGELOG.md](https://github.com/catppuccin/vscode-icons/blob/main/CHANGELOG.md#v1160) for added icons and associations) + ### Changed ### Deprecated diff --git a/generate/vscode-icons b/generate/vscode-icons index 1a90668..dfc051a 160000 --- a/generate/vscode-icons +++ b/generate/vscode-icons @@ -1 +1 @@ -Subproject commit 1a90668e6ee0fbdf26f683e1cc37367a0e526871 +Subproject commit dfc051a2aee18934cc8ab94a62464aafc24a6de9 diff --git a/gradle.properties b/gradle.properties index 645c701..a0b4044 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ pluginGroup=com.github.catppuccin.jetbrains_icons pluginName=Catppuccin Icons -pluginVersion=1.7.0 +pluginVersion=1.8.0 pluginSinceBuild=231 pluginUntilBuild=242.* platformType=IC diff --git a/src/main/kotlin/com/github/catppuccin/jetbrains_icons/IconProvider.kt b/src/main/kotlin/com/github/catppuccin/jetbrains_icons/IconProvider.kt index c7a1768..08eed18 100644 --- a/src/main/kotlin/com/github/catppuccin/jetbrains_icons/IconProvider.kt +++ b/src/main/kotlin/com/github/catppuccin/jetbrains_icons/IconProvider.kt @@ -74,10 +74,13 @@ class IconProvider : IconProvider() { file.accept(object : JavaRecursiveElementVisitor() { override fun visitClass(aClass: PsiClass) { when { + aClass.isAnnotationType -> fileType = "JAVA_ANNOTATION" aClass.isInterface -> fileType = "JAVA_INTERFACE" aClass.isEnum -> fileType = "JAVA_ENUM" - aClass.isAnnotationType -> fileType = "JAVA_ANNOTATION" aClass.isRecord -> fileType = "JAVA_RECORD" + PsiClassUtils.isException(aClass) -> fileType = "JAVA_EXCEPTION" + PsiClassUtils.isSealed(aClass) -> fileType = "JAVA_SEALED" + PsiClassUtils.isFinal(aClass) -> fileType = "JAVA_FINAL" PsiClassUtils.isAbstract(aClass) -> fileType = "JAVA_ABSTRACT" } } @@ -87,12 +90,15 @@ class IconProvider : IconProvider() { private fun provideJavaIcons(): Map { return mapOf( - "JAVA_INTERFACE" to icons.java_alt_1, - "JAVA_ENUM" to icons.java_alt_3, - "JAVA_ANNOTATION" to icons.java_alt_1, - "JAVA_RECORD" to icons.java_alt_2, - "JAVA_ABSTRACT" to icons.java_alt_1, - "JAVA_CLASS" to icons.java, + "JAVA_ANNOTATION" to icons.java_annotation, + "JAVA_INTERFACE" to icons.java_interface, + "JAVA_ENUM" to icons.java_enum, + "JAVA_RECORD" to icons.java_record, + "JAVA_EXCEPTION" to icons.java_exception, + "JAVA_ABSTRACT" to icons.java_class_abstract, + "JAVA_SEALED" to icons.java_class_sealed, + "JAVA_FINAL" to icons.java_class_final, + "JAVA_CLASS" to icons.java_class, ) } } diff --git a/src/main/kotlin/com/github/catppuccin/jetbrains_icons/util/PsiClassUtils.kt b/src/main/kotlin/com/github/catppuccin/jetbrains_icons/util/PsiClassUtils.kt index a2675b9..e1c667e 100644 --- a/src/main/kotlin/com/github/catppuccin/jetbrains_icons/util/PsiClassUtils.kt +++ b/src/main/kotlin/com/github/catppuccin/jetbrains_icons/util/PsiClassUtils.kt @@ -7,4 +7,16 @@ object PsiClassUtils { fun isAbstract(psiClass: PsiClass): Boolean { return psiClass.hasModifierProperty(PsiModifier.ABSTRACT) } + + fun isSealed(psiClass: PsiClass): Boolean { + return psiClass.hasModifierProperty(PsiModifier.SEALED) + } + + fun isFinal(psiClass: PsiClass): Boolean { + return psiClass.hasModifierProperty(PsiModifier.FINAL) + } + + fun isException(psiClass: PsiClass): Boolean { + return psiClass.name!!.endsWith("Exception") + } }