diff --git a/build.gradle.kts b/build.gradle.kts index b0dc19b..56960f9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -44,7 +44,7 @@ dependencies { testFramework(TestFrameworkType.Platform) // Add plugin dependencies for compilation here: - + bundledPlugin("org.jetbrains.plugins.textmate") } } diff --git a/src/main/kotlin/me/zhouxi/slint/lang/syntax/SlintTextMateProvider.kt b/src/main/kotlin/me/zhouxi/slint/lang/syntax/SlintTextMateProvider.kt new file mode 100644 index 0000000..74c14b2 --- /dev/null +++ b/src/main/kotlin/me/zhouxi/slint/lang/syntax/SlintTextMateProvider.kt @@ -0,0 +1,18 @@ +package me.zhouxi.slint.lang.syntax + +import org.jetbrains.plugins.textmate.api.TextMateBundleProvider +import java.nio.file.Path + +class SlintTextMateProvider : TextMateBundleProvider { + override fun getBundles(): List { + val resource = SlintTextMateProvider::class.java.classLoader.getResource("textmate/slint.tmLanguage.json") + ?: throw IllegalStateException("Could not find Slint TextMate grammar file") + + return listOf( + TextMateBundleProvider.PluginBundle( + "Slint", + Path.of(resource.toURI()) + ) + ) + } +}