{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/language-configuration/latest.json",
  "title": "Language configuration",
  "description": "Configuration file for language features in VS Code and Visual Studio.",
  "x-lintel": {
    "source": "https://www.schemastore.org/language-configuration.json",
    "sourceSha256": "812a84433ed1983166f81b6d95435ccce096e7c63723ba3a4f3e32621a6dbff1",
    "fileMatch": [
      "language-configuration.json",
      "language-configuration.yaml",
      "language-configuration.yml"
    ],
    "parsers": [
      "json",
      "yaml"
    ]
  },
  "type": "object",
  "properties": {
    "comments": {
      "description": "The language's comment settings.",
      "type": "object",
      "properties": {
        "lineComment": {
          "description": "The line comment token, like `// this is a comment`.",
          "type": "string"
        },
        "blockComment": {
          "$ref": "#/$defs/charPair",
          "description": "The block comment character pair, like `/* block comment *&#47;`"
        }
      }
    },
    "brackets": {
      "description": "The language's brackets.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/charPair"
      }
    },
    "autoClosingPairs": {
      "description": "The language's auto closing pairs. The 'close' character is automatically inserted with the 'open' character is typed.",
      "type": "array",
      "items": {
        "anyOf": [
          {
            "$ref": "#/$defs/charPair"
          },
          {
            "type": "object",
            "properties": {
              "open": {
                "type": "string"
              },
              "close": {
                "type": "string"
              },
              "notIn": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "open",
              "close"
            ]
          }
        ]
      }
    },
    "autoCloseBefore": {
      "description": "What characters must be after the cursor for bracket or quote autoclosing to occur.",
      "type": "string"
    },
    "surroundingPairs": {
      "description": "The language's surrounding pairs. When the 'open' character is typed on a selection, the selected string is surrounded by the open and close characters.",
      "type": "array",
      "items": {
        "anyOf": [
          {
            "$ref": "#/$defs/charPair"
          },
          {
            "type": "object",
            "properties": {
              "open": {
                "type": "string"
              },
              "close": {
                "type": "string"
              }
            },
            "required": [
              "open",
              "close"
            ]
          }
        ]
      }
    },
    "folding": {
      "description": "The language's folding rules.",
      "type": "object",
      "properties": {
        "markers": {
          "description": "Region markers used by the language.",
          "type": "object",
          "properties": {
            "start": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "$ref": "#/$defs/regexp"
                }
              ]
            },
            "end": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "$ref": "#/$defs/regexp"
                }
              ]
            }
          }
        }
      }
    },
    "wordPattern": {
      "description": "The language's word definition.",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "$ref": "#/$defs/regexp"
        }
      ]
    },
    "indentationRules": {
      "description": "The language's indentation settings.",
      "type": "object",
      "properties": {
        "decreaseIndentPattern": {
          "description": "If a line matches this pattern, then all the lines after it should be unindented once (until another rule matches).",
          "anyOf": [
            {
              "type": "string"
            },
            {
              "$ref": "#/$defs/regexp"
            }
          ]
        },
        "increaseIndentPattern": {
          "description": "If a line matches this pattern, then all the lines after it should be indented once (until another rule matches).",
          "anyOf": [
            {
              "type": "string"
            },
            {
              "$ref": "#/$defs/regexp"
            }
          ]
        },
        "indentNextLinePattern": {
          "description": "If a line matches this pattern, then only the next line after it should be indented once.",
          "anyOf": [
            {
              "type": "string"
            },
            {
              "$ref": "#/$defs/regexp"
            }
          ]
        },
        "unIndentedLinePattern": {
          "description": "If a line matches this pattern, then its indentation should not be changed and it should not be evaluated against the other rules.",
          "anyOf": [
            {
              "type": "string"
            },
            {
              "$ref": "#/$defs/regexp"
            }
          ]
        }
      },
      "required": [
        "decreaseIndentPattern",
        "increaseIndentPattern"
      ]
    },
    "onEnterRules": {
      "description": "The language's rules to be evaluated when pressing Enter.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "beforeText": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/$defs/regexp"
              }
            ]
          },
          "afterText": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/$defs/regexp"
              }
            ]
          },
          "previousLineText": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/$defs/regexp"
              }
            ]
          },
          "action": {
            "type": "object",
            "properties": {
              "indent": {
                "type": "string",
                "enum": [
                  "none",
                  "indent",
                  "indentOutdent",
                  "outdent"
                ]
              },
              "appendText": {
                "type": "string"
              },
              "removeText": {
                "type": "integer",
                "minimum": 1
              }
            },
            "required": [
              "indent"
            ]
          }
        },
        "required": [
          "beforeText",
          "action"
        ]
      }
    }
  },
  "$defs": {
    "regexp": {
      "type": "object",
      "properties": {
        "pattern": {
          "type": "string"
        },
        "flags": {
          "type": "string"
        }
      },
      "required": [
        "pattern"
      ]
    },
    "charPair": {
      "type": "array",
      "prefixItems": [
        {
          "type": "string"
        },
        {
          "type": "string"
        }
      ],
      "minItems": 2,
      "items": false
    }
  },
  "additionalProperties": true
}
