feat: add TextMate bundle provider for Slint syntax highlighting
This provider loads the Slint TextMate grammar file and registers it with IntelliJ's TextMate system. Also adds the required textmate plugin dependency to build.gradle.kts. Co-Authored-By: Claude (auto) <noreply@anthropic.com>
This commit is contained in:
@@ -44,7 +44,7 @@ dependencies {
|
|||||||
testFramework(TestFrameworkType.Platform)
|
testFramework(TestFrameworkType.Platform)
|
||||||
|
|
||||||
// Add plugin dependencies for compilation here:
|
// Add plugin dependencies for compilation here:
|
||||||
|
bundledPlugin("org.jetbrains.plugins.textmate")
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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<TextMateBundleProvider.PluginBundle> {
|
||||||
|
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())
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user