-- ───────────────────────────────────────────────────────────────────
--          ╭───────────────────────────────────────────────╮
--          │               LSP Configuration               │
--          ╰───────────────────────────────────────────────╯
return {
    -- lsp configuration
    "neovim/nvim-lspconfig",
    dependencies = {
        { "antosha417/nvim-lsp-file-operations", config = true },
        "mfussenegger/nvim-jdtls",
    },
    config = function()
        -- Change the Diagnostic symbols in the sign column (gutter)
        local signs = { Error = "󰅚 ", Warn = "󰀪 ", Hint = "󰌶", Info = "󰋽 " }
        for type, icon in pairs(signs) do
            local hl = "DiagnosticSign" .. type
            vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
        end

        -- ───────────────────────────────────────────────────────────────────
        --          ╭───────────────────────────────────────────────╮
        --          │        Import configs from other files        │
        --          ╰───────────────────────────────────────────────╯
        require("plugins.lsp.ls.bashls")
        require("plugins.lsp.ls.c")
        require("plugins.lsp.ls.dart")
        require("plugins.lsp.ls.docker")
        require("plugins.lsp.ls.gh-actions")
        require("plugins.lsp.ls.go")
        require("plugins.lsp.ls.haskell")
        require("plugins.lsp.ls.hypr")
        require("plugins.lsp.ls.low-level")
        require("plugins.lsp.ls.luals")
        require("plugins.lsp.ls.pyright")
        require("plugins.lsp.ls.qml")
        require("plugins.lsp.ls.rust-analyzer")
        require("plugins.lsp.ls.ruby")
        require("plugins.lsp.ls.sql")
        require("plugins.lsp.ls.text")
        require("plugins.lsp.ls.web")
        require("plugins.lsp.ls.yaml")
        -- ───────────────────────────────────────────────────────────────────

        local luasnip = require("luasnip")

        -- loads vscode style snippets from installed plugins (e.g. friendly-snippets)
        require("luasnip.loaders.from_vscode").lazy_load()
        require("luasnip.loaders.from_vscode").load({ paths = { "~/.config/nvim/snippets" } })
        luasnip.setup({})
        vim.keymap.set("n", "<C-s>", ":LuaSnipUnlinkCurrent<CR>", { desc = "Unlink current snippet" })
    end,
}
-- ───────────────────────────────────────────────────────────────────
