local p = require("oldworld.palette")
local u = require("oldworld.utils.color_utils")

return {
    -- LSP Semantic Token Groups
    ["@lsp.type.boolean"] = { link = "@boolean" },
    ["@lsp.type.builtinType"] = { link = "@type.builtin" },
    ["@lsp.type.comment"] = { link = "@comment" },
    ["@lsp.type.enum"] = { link = "@type" },
    ["@lsp.type.enumMember"] = { link = "@constant" },
    ["@lsp.type.escapeSequence"] = { link = "@string.escape" },
    ["@lsp.type.formatSpecifier"] = { link = "@punctuation.special" },
    ["@lsp.type.interface"] = { fg = p.yellow },
    ["@lsp.type.macro"] = { fg = p.magenta },
    ["@lsp.type.keyword"] = { link = "@keyword" },
    ["@lsp.type.namespace"] = { link = "@namespace" },
    ["@lsp.type.number"] = { link = "@number" },
    ["@lsp.type.operator"] = { link = "@operator" },
    ["@lsp.type.parameter"] = { link = "@parameter" },
    ["@lsp.type.property"] = { link = "@property" },
    ["@lsp.type.selfKeyword"] = { link = "@variable.builtin" },
    ["@lsp.type.string.rust"] = { link = "@string" },
    ["@lsp.type.typeAlias"] = { link = "@type.definition" },
    ["@lsp.type.unresolvedReference"] = { undercurl = true, sp = p.error },
    ["@lsp.mod.readonly"] = { link = "@constant" },
    ["@lsp.typemod.function.readonly"] = { fg = p.blue },
    ["@lsp.typemod.variable.declaration"] = { fg = p.fg },
    ["@lsp.typemod.property"] = { fg = u.lighten(p.blue, 0.5, p.fg) },
    ["@lsp.typemod.class.defaultLibrary"] = { link = "@type.builtin" },
    ["@lsp.typemod.enum.defaultLibrary"] = { link = "@type.builtin" },
    ["@lsp.typemod.enumMember.defaultLibrary"] = { link = "@constant.builtin" },
    ["@lsp.typemod.function.defaultLibrary"] = { link = "@function.builtin" },
    ["@lsp.typemod.keyword.async"] = { link = "@keyword.coroutine" },
    ["@lsp.typemod.macro.defaultLibrary"] = { link = "@function.builtin" },
    ["@lsp.typemod.method.defaultLibrary"] = { link = "@function.builtin" },
    ["@lsp.typemod.operator.injected"] = { link = "@operator" },
    ["@lsp.typemod.string.injected"] = { link = "@string" },
    ["@lsp.typemod.type.defaultLibrary"] = { fg = p.purple },
    ["@lsp.typemod.variable.defaultLibrary"] = { link = "@variable.builtin" },
    ["@lsp.typemod.variable.injected"] = { link = "@variable" },
    -- Diagnostics
    DiagnosticOk = { fg = p.green },
    DiagnosticError = { fg = p.red },
    DiagnosticWarn = { fg = p.yellow },
    DiagnosticInfo = { fg = p.purple },
    DiagnosticHint = { fg = p.cyan },
    DiagnosticUnderlineError = { fg = p.red, underline = true },
    DiagnosticUnderlineWarn = { fg = p.yellow, underline = true },
    DiagnosticUnderlineInfo = { fg = p.purple, underline = true },
    DiagnosticUnderlineHint = { fg = p.cyan, underline = true },

    -- Neovim's built-in language server client
    LspReferenceWrite = { fg = p.purple, underline = true },
    LspReferenceText = { fg = p.purple, underline = true },
    LspReferenceRead = { fg = p.purple, underline = true },
    LspSignatureActiveParameter = { fg = p.yellow, bold = true },
}
