-- ┌                                               ┐
-- │                      LUA                      │
-- └                                               ┘
local lsp = vim.lsp

local capabilities = require("lsp-options").capabilities
local on_attach = require("lsp-options").on_attach

lsp.config("lua_ls", {
    capabilities = capabilities,
    on_attach = on_attach,
    settings = {
        Lua = {
            -- make the language server recognize "vim" global
            diagnostics = {
                globals = { "vim" },
            },
            workspace = {
                -- make language server aware of runtime files
                library = {
                    [vim.fn.expand("$VIMRUNTIME/lua")] = true,
                    [vim.fn.stdpath("config") .. "/lua"] = true,
                },
            },
        },
    },
})


-- ── Enable configs ───────────────────────────────────────────────
local enable = vim.lsp.enable
enable("lua_ls")
