{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Lava Syntax Highlighting Schema",
  "type": "object",
  "properties": {
    "languageName": {
      "type": "string",
      "description": "Name of the language or mode."
    },
    "patterns": {
      "type": "array",
      "description": "List of patterns for syntax highlighting.",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Unique name for this pattern."
          },
          "matchStyle": {
            "type": "string",
            "enum": ["regex", "words"],
            "description": "Indicates whether this pattern uses a regex or a list of words."
          },
          "regex": {
            "type": "string",
            "description": "A regular expression used if matchStyle=regex."
          },
          "words": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "List of exact words to match if matchStyle=words."
          },
          "className": {
            "type": "string",
            "description": "The CSS or style class name to apply for highlighting."
          },
          "multiLine": {
            "type": "boolean",
            "description": "True if this pattern can match across multiple lines (block comments, etc.).",
            "default": false
          },
          "ignoreCase": {
            "type": "boolean",
            "description": "True if the match should be case-insensitive.",
            "default": false
          },
          "priority": {
            "type": "integer",
            "description": "Optional integer priority for conflict resolution. Higher = applied first."
          }
        },
        "required": ["name", "matchStyle", "className"],
        "additionalProperties": false,
        "oneOf": [
          {
            "properties": {
              "matchStyle": { "const": "regex" }
            },
            "required": ["regex"]
          },
          {
            "properties": {
              "matchStyle": { "const": "words" }
            },
            "required": ["words"]
          }
        ]
      }
    }
  },
  "required": ["languageName", "patterns"],
  "additionalProperties": false
}
