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())
            )
        )
    }
}
