-- 1. Configuration
vim.lsp.config('kotlin_language_server', {
    cmd = { "kotlin-language-server" },
    filetypes = { "kotlin" },
    -- Kotlin projects are usually defined by build files or git
    root_markers = { "settings.gradle", "settings.gradle.kts", "pom.xml", ".git" },

    -- flags in lspconfig setup are now part of the general config table
    init_options = {
        debounceTextChanges = 150,
    },

    settings = {
        kotlin = {
            linting = { enabled = true },
            completion = { enabled = true },
        },
    },
})

-- 2. Enable the server
vim.lsp.enable('kotlin_language_server')
