import type { Theme } from "./theme-types"

export function getMarkupSyntaxRules(theme: Theme) {
  return [
    { scope: ["markup.heading"], style: { foreground: theme.markdownHeading, bold: true } },
    { scope: ["markup.heading.1"], style: { foreground: theme.markdownHeading, bold: true } },
    { scope: ["markup.heading.2"], style: { foreground: theme.markdownHeading, bold: true } },
    { scope: ["markup.heading.3"], style: { foreground: theme.markdownHeading, bold: true } },
    { scope: ["markup.heading.4"], style: { foreground: theme.markdownHeading, bold: true } },
    { scope: ["markup.heading.5"], style: { foreground: theme.markdownHeading, bold: true } },
    { scope: ["markup.heading.6"], style: { foreground: theme.markdownHeading, bold: true } },
    { scope: ["markup.bold", "markup.strong"], style: { foreground: theme.markdownStrong, bold: true } },
    { scope: ["markup.italic"], style: { foreground: theme.markdownEmph, italic: true } },
    { scope: ["markup.list"], style: { foreground: theme.markdownListItem } },
    { scope: ["markup.quote"], style: { foreground: theme.markdownBlockQuote, italic: true } },
    { scope: ["markup.raw", "markup.raw.block"], style: { foreground: theme.markdownCode } },
    { scope: ["markup.raw.inline"], style: { foreground: theme.markdownCode, background: theme.background } },
    { scope: ["markup.link"], style: { foreground: theme.markdownLink, underline: true } },
    { scope: ["markup.link.label"], style: { foreground: theme.markdownLinkText, underline: true } },
    { scope: ["markup.link.url"], style: { foreground: theme.markdownLink, underline: true } },
    { scope: ["label"], style: { foreground: theme.markdownLinkText } },
    { scope: ["spell", "nospell"], style: { foreground: theme.text } },
    { scope: ["conceal"], style: { foreground: theme.textMuted } },
    { scope: ["string.special", "string.special.url"], style: { foreground: theme.markdownLink, underline: true } },
    { scope: ["character"], style: { foreground: theme.syntaxString } },
    { scope: ["float"], style: { foreground: theme.syntaxNumber } },
    { scope: ["comment.error"], style: { foreground: theme.error, italic: true, bold: true } },
    { scope: ["comment.warning"], style: { foreground: theme.warning, italic: true, bold: true } },
    { scope: ["comment.todo", "comment.note"], style: { foreground: theme.info, italic: true, bold: true } },
    { scope: ["namespace"], style: { foreground: theme.syntaxType } },
    { scope: ["field"], style: { foreground: theme.syntaxVariable } },
    { scope: ["type.definition"], style: { foreground: theme.syntaxType, bold: true } },
    { scope: ["keyword.export"], style: { foreground: theme.syntaxKeyword } },
    { scope: ["attribute", "annotation"], style: { foreground: theme.warning } },
    { scope: ["tag"], style: { foreground: theme.error } },
    { scope: ["tag.attribute"], style: { foreground: theme.syntaxKeyword } },
    { scope: ["tag.delimiter"], style: { foreground: theme.syntaxOperator } },
    { scope: ["markup.strikethrough"], style: { foreground: theme.textMuted } },
    { scope: ["markup.underline"], style: { foreground: theme.text, underline: true } },
    { scope: ["markup.list.checked"], style: { foreground: theme.success } },
    { scope: ["markup.list.unchecked"], style: { foreground: theme.textMuted } },
    { scope: ["diff.plus"], style: { foreground: theme.diffAdded, background: theme.diffAddedBg } },
    { scope: ["diff.minus"], style: { foreground: theme.diffRemoved, background: theme.diffRemovedBg } },
    { scope: ["diff.delta"], style: { foreground: theme.diffContext, background: theme.diffContextBg } },
    { scope: ["error"], style: { foreground: theme.error, bold: true } },
    { scope: ["warning"], style: { foreground: theme.warning, bold: true } },
    { scope: ["info"], style: { foreground: theme.info } },
    { scope: ["debug"], style: { foreground: theme.textMuted } },
  ]
}
