eginCaptures": { "1": { "name": "variable.parameter" } },
          "end": "(?=[,)])",
          "patterns": [{ "include": "#basic" }]
        },
        { "include": "#basic" }
      ]
    },
    "package-namespace": {
      "name": "entity.name.namespace",
      "match": "\\b[a-zA-Z][a-zA-Z0-9_]*\\b(?=\\s*::)"
    },
    "dollar-access": {
      "patterns": [
        {
          "match": "([\\p{L}\\p{Nl}._][\\p{L}\\p{Nl}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}._]*)(\\$)([\\p{L}\\p{Nl}.][\\p{L}\\p{Nl}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}._]*)",
          "captures": {
            "1": { "name": "variable.object.dollar" },
            "2": { "name": "keyword.operator.accessor.r" },
            "3": { "name": "variable.property.dollar" }
          }
        }
      ]
    },
    "identifiers": {
      "patterns": [
        { "include": "#identifier-syntactic" },
        { "include": "#identifier-quoted" }
      ]
    },
    "identifier-syntactic": {
      "name": "variable.object",
      "match": "[\\p{L}\\p{Nl}.][\\p{L}\\p{Nl}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}.]*"
    },
    "identifier-quoted": {
      "name": "variable.object",
      "begin": "`",
      "end": "`",
      "patterns": [{ "match": "\\\\`" }]
    },
    "keywords": {
      "patterns": [
        { "include": "#keywords-control" },
        { "include": "#keywords-builtin" },
        { "include": "#keywords-constant" }
      ]
    },
    "keywords-control": {
      "name": "keyword",
      "match": "(?:\\\\|function|if|else|in|break|next|repeat|for|while)\\b"
    },
    "keywords-builtin": {
      "name": "keyword.other",
      "match": "(?:setGroupGeneric|setRefClass|setGeneric|NextMethod|setMethod|UseMethod|tryCatch|setClass|warning|require|library|py|ggplot|ggraph|export|import|R6Class|return|switch|attach|detach|source|stop|try)(?=\\()"
    },
    "keywords-constant": {
      "name": "constant.language",
      "match": "(?:NA_character_|NA_integer_|NA_complex_|NA_real_|TRUE|FALSE|NULL|Inf|NaN|NA|T|F|rio|here|tidyverse|easystats|facet_wrap|facet_grid|facet_wrap2|facet_grid2|levels|label|labels|na.rm|\\.col|\\.fns|\\.names|\\.vars|\\.funs|\\.tbl|(?=\\w*df)\\w+)\\b"
    },
    "latex": {
      "patterns": [{ "name": "keyword.other", "match": "\\\\\\w+" }]
    },
    "markdown": {
      "patterns": [
        {
          "begin": "([`]{3,})\\s*(.*)",
          "beginCaptures": {
            "1": { "name": "comment.line" },
            "2": { "name": "entity.name.section" }
          },
          "end": "(\\1)",
          "endCaptures": { "1": { "name": "comment.line" } },
          "patterns": [{ "name": "comment.line", "match": "^\\s*#+'" }]
        },
        {
          "match": "(\\[)(?:(\\w+)(:{2,3}))?(\\w+)(\\(\\))?(\\])",
          "captures": {
            "1": { "name": "meta.bracket" },
            "2": { "name": "variable.object" },
            "3": { "name": "keyword.operator" },
            "4": { "name": "entity.name.function" },
            "5": { "name": "meta.bracket" },
            "6": { "name": "meta.bracket" }
          }
        },
        { "name": "markdown.bold", "match": "(\\s+|^)(__.+?__)\\b" },
        {
          "name": "markdown.italic",
          "match": "(\\s+|^)(_(?=[^_])(?:(?:\\\\.)|(?:[^_\\\\]))*?_)\\b"
        },
        { "name": "markdown.bold", "match": "([*][*].+?[*][*])" },
        {
          "name": "markdown.italic",
          "match": "([*](?=[^*\\s])(?:(?:\\\\.)|(?:[^*\\\\]))*?[*])"
        },
        { "name": "markup.quote", "match": "(`(?:[^`\\\\]|\\\\.)*`)" },
        { "name": "markup.underline.link", "match": "(<)([^>]*)(>)" }
      ]
    },
    "numbers": {
      "patterns": [
        {
          "name": "constant.numeric",
          "match": "0[xX][0-9a-fA-F]+(?:p[-+]?\\d+)?[iL]?"
        },
        {
          "name": "constant.numeric",
          "match": "(?:(?:\\d+(?:\\.\\d*)?)|(?:\\.\\d+))(?:[eE][+-]?\\d*)?[iL]?"
        }
      ]
    },
    "operators": {
      "patterns": [
        {
          "name": "keyword.operator.infix",
          "match": "%.*?%|\\|>"
        },
        {
          "name": "keyword.other.tilder",
          "match": "[~@]"
        },
        {
          "name": "keyword.operator",
          "match": "%.*?%|:::|::|:=|\\|>|=>|%%|>=|<=|==|!=|<<-|->>|->|<-|\\|\\||&&|=|\\+|-|\\*\\*?|/|\\^|>|<|!|&|\\||~|\\$|:|@|\\?|,"
        }
      ]
    },
    "strings": {
      "patterns": [
        { "include": "#qstring" },
        { "include": "#qqstring" },
        { "include": "#backtick-quoted" }
      ]
    },
    "qstring": {
      "name": "string.quoted.single",
      "begin": "'",
      "end": "'",
      "patterns": [{ "include": "#escapes" }]
    },
    "qqstring": {
      "name": "string.quoted.double",
      "begin": "\"",
      "end": "\"",
      "patterns": [{ "include": "#escapes" }]
    },
    "raw-strings": {
      "name": "string.quoted.other",
      "patterns": [
        {
          "name": "string.quoted.other",
          "begin": "[rR]\"(-*)\\{",
          "end": "\\}\\1\""
        },
        {
          "name": "string.quoted.other",
          "begin": "[rR]'(-*)\\{",
          "end": "\\}\\1'"
        },
        {
          "name": "string.quoted.other",
          "begin": "[rR]\"(-*)\\[",
          "end": "\\]\\1\""
        },
        {
          "name": "string.quoted.other",
          "begin": "[rR]'(-*)\\[",
          "end": "\\]\\1'"
        },
        {
          "name": "string.quoted.other",
          "begin": "[rR]\"(-*)\\(",
          "end": "\\)\\1\""
        },
        {
          "name": "string.quoted.other",
          "begin": "[rR]'(-*)\\(",
          "end": "\\)\\1'"
        }
      ]
    },
    "roxygen": {
      "begin": "(^\\s*#+')",
      "beginCaptures": { "1": { "name": "comment.line.roxygen" } },
      "end": "$",
      "patterns": [
        { "include": "#markdown" },
        { "include": "#roxygen-tokens" },
        { "include": "#latex" },
        { "name": "comment.line", "match": "." }
      ]
    },
    "roxygen-example": {
      "begin": "(^\\s*#+')\\s*(@examples)\\s*$",
      "beginCaptures": {
        "1": { "name": "comment.line" },
        "2": { "name": "keyword.other" }
      },
      "end": "(^\\s*#+')\\s*(@\\w*)",
      "endCaptures": {
        "1": { "name": "comment.line" },
        "2": { "name": "keyword.other" }
      },
      "patterns": [
        { "name": "comment.line", "match": "^\\s*#+'" },
        { "name": "meta.bracket", "match": "[\\[\\(\\{\\}\\)\\]]" },
        { "include": "#latex" },
        { "include": "#roxygen-tokens" },
        { "include": "#basic-roxygen-example" }
      ]
    },
    "roxygen-tokens": {
      "patterns": [
        { "name": "constant.character.escape", "match": "@@" },
        {
          "begin": "(@(?:param|field|slot))\\s*",
          "beginCaptures": { "1": { "name": "keyword.other" } },
          "end": "(?:\\s|$)",
          "patterns": [
            { "name": "variable.parameter", "match": "([\\w.]+)" },
            { "name": "keyword.operator", "match": "," }
          ]
        },
        { "name": "keyword.other", "match": "@(?!@)\\w*" }
      ]
    },
    "function-call-arguments": {
      "patterns": [{ "include": "#expression" }]
    },
    "backtick-quoted": {
      "name": "string.quoted.backtick.r",
      "begin": "`",
      "beginCaptures": {
        "0": { "name": "punctuation.definition.string.begin.r" }
      },
      "end": "`",
      "endCaptures": {
        "0": { "name": "punctuation.definition.string.end.r" }
      },
      "patterns": [
        {
          "name": "constant.character.escape.r",
          "match": "\\\\."
        }
      ]
    },
    "builtin-functions": {
      "patterns": [
        {
          "name": "meta.function-call.r",
          "begin": "\\b(?:(base)(: