diff --git a/.editorconfig b/.editorconfig index d86ac02..77cb74d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -18,7 +18,7 @@ indent_style = tab indent_size = 4 # python -[*.{ini,py,py.tpl,rst}] +[*.{ini,py,py.tpl,rst,kt,kts}] indent_size = 4 # rust diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..7fb7cc0 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "src/main/resources/icons"] + path = src/main/resources/icons + url = https://github.com/catppuccin/vscode-icons.git diff --git a/build.gradle.kts b/build.gradle.kts index fe6484e..0e574f7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -37,7 +37,7 @@ intellij { changelog { version.set(properties("pluginVersion")) path.set(file("CHANGELOG.md").canonicalPath) - header.set(provider { "${version.get()} - ${date()}"}) + header.set(provider { "${version.get()} - ${date()}" }) headerParserRegex.set("""(\d\.\d\.\d)""".toRegex()) itemPrefix.set("-") keepUnreleasedSection.set(true) @@ -68,7 +68,7 @@ tasks { // Get the latest available change notes from the changelog file changeNotes.set(provider { - changelog.renderItem(changelog.getLatest(), Changelog.OutputType.HTML) + changelog.renderItem(changelog.getLatest(), Changelog.OutputType.HTML) }) } diff --git a/src/main/kotlin/com/github/catppuccin/jetbrains/icons/CatppuccinIconProvider.kt b/src/main/kotlin/com/github/catppuccin/jetbrains/icons/CatppuccinIconProvider.kt new file mode 100644 index 0000000..82a5fa0 --- /dev/null +++ b/src/main/kotlin/com/github/catppuccin/jetbrains/icons/CatppuccinIconProvider.kt @@ -0,0 +1,22 @@ +package com.github.catppuccin.jetbrains.icons + +import com.intellij.ide.IconProvider +import com.intellij.psi.PsiElement +import com.intellij.psi.util.PsiUtilCore +import javax.swing.Icon + +class CatppuccinIconProvider : IconProvider() { + override fun getIcon(element: PsiElement, flags: Int): Icon? { + var icon: Icon? = null + val virtualFile = PsiUtilCore.getVirtualFile(element) + + if (virtualFile != null) { + val fileName = virtualFile.name + if (fileName.endsWith(".md")) { + icon = CatppuccinIcons.MARKDOWN_FILE; + } + } + + return icon + } +} diff --git a/src/main/kotlin/com/github/catppuccin/jetbrains/icons/CatppuccinIcons.kt b/src/main/kotlin/com/github/catppuccin/jetbrains/icons/CatppuccinIcons.kt new file mode 100644 index 0000000..4876bb6 --- /dev/null +++ b/src/main/kotlin/com/github/catppuccin/jetbrains/icons/CatppuccinIcons.kt @@ -0,0 +1,9 @@ +package com.github.catppuccin.jetbrains.icons + +import javax.swing.Icon +import com.intellij.openapi.util.IconLoader + +object CatppuccinIcons { + @JvmField + val MARKDOWN_FILE: Icon = IconLoader.getIcon("/icons/icons/markdown.svg", javaClass) +} diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 04ed96d..0aaf935 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -50,5 +50,9 @@ For further help, see also: + + diff --git a/src/main/resources/icons b/src/main/resources/icons new file mode 160000 index 0000000..6fd54a0 --- /dev/null +++ b/src/main/resources/icons @@ -0,0 +1 @@ +Subproject commit 6fd54a0abe5ad6972e6bb823bb4a9c6faa04b7e3