package me.zhouxi.slint

import com.intellij.ide.plugins.PluginManagerCore
import com.intellij.openapi.extensions.PluginId
import com.intellij.openapi.util.SystemInfo
import java.nio.file.Path

object SlintRuntime {
    val Id = PluginId.getId("me.zhouxi.slint")

    val Path: Path = PluginManagerCore.getPlugin(Id)!!.pluginPath

    private val BinaryName = if (SystemInfo.isWindows) {
        "slint-lsp-windows.exe"
    } else if (SystemInfo.isLinux) {
        "slint-lsp-linux"
    } else if (SystemInfo.isMac) {
        "slint-lsp-macos"
    } else {
        throw RuntimeException("Unsupported OS")
    }


    val LspExecutable: Path = Path.resolve("lsp").resolve(BinaryName)
}


