diff options
Diffstat (limited to 'runtime/queries/helm')
| -rw-r--r-- | runtime/queries/helm/folds.scm | 1 | ||||
| -rw-r--r-- | runtime/queries/helm/highlights.scm | 49 | ||||
| -rw-r--r-- | runtime/queries/helm/injections.scm | 36 | ||||
| -rw-r--r-- | runtime/queries/helm/locals.scm | 1 |
4 files changed, 87 insertions, 0 deletions
diff --git a/runtime/queries/helm/folds.scm b/runtime/queries/helm/folds.scm new file mode 100644 index 000000000..6ffb4b7d4 --- /dev/null +++ b/runtime/queries/helm/folds.scm @@ -0,0 +1 @@ +; inherits: gotmpl diff --git a/runtime/queries/helm/highlights.scm b/runtime/queries/helm/highlights.scm new file mode 100644 index 000000000..e9d221bee --- /dev/null +++ b/runtime/queries/helm/highlights.scm @@ -0,0 +1,49 @@ +; inherits: gotmpl + +; For the reasoning concerning the priorities, see gotmpl highlights. +; +; Builtin functions +(function_call + function: (identifier) @function.builtin + (#set! priority 110) + (#any-of? @function.builtin + "and" "or" "not" "eq" "ne" "lt" "le" "gt" "ge" "default" "required" "empty" "fail" "coalesce" + "ternary" "print" "println" "printf" "trim" "trimAll" "trimPrefix" "trimSuffix" "lower" "upper" + "title" "untitle" "repeat" "substr" "nospace" "trunc" "abbrev" "abbrevboth" "initials" + "randAlphaNum" "randAlpha" "randNumeric" "randAscii" "wrap" "wrapWith" "contains" "hasPrefix" + "hasSuffix" "quote" "squote" "cat" "indent" "nindent" "replace" "plural" "snakecase" "camelcase" + "kebabcase" "swapcase" "shuffle" "toStrings" "toDecimal" "toJson" "mustToJson" "toPrettyJson" + "mustToPrettyJson" "toRawJson" "mustToRawJson" "fromYaml" "fromJson" "fromJsonArray" + "fromYamlArray" "toYaml" "regexMatch" "mustRegexMatch" "regexFindAll" "mustRegexFinDall" + "regexFind" "mustRegexFind" "regexReplaceAll" "mustRegexReplaceAll" "regexReplaceAllLiteral" + "mustRegexReplaceAllLiteral" "regexSplit" "mustRegexSplit" "sha1sum" "sha256sum" "adler32sum" + "htpasswd" "derivePassword" "genPrivateKey" "buildCustomCert" "genCA" "genSelfSignedCert" + "genSignedCert" "encryptAES" "decryptAES" "now" "ago" "date" "dateInZone" "duration" + "durationRound" "unixEpoch" "dateModify" "mustDateModify" "htmlDate" "htmlDateInZone" "toDate" + "mustToDate" "dict" "get" "set" "unset" "hasKey" "pluck" "dig" "merge" "mustMerge" + "mergeOverwrite" "mustMergeOverwrite" "keys" "pick" "omit" "values" "deepCopy" "mustDeepCopy" + "b64enc" "b64dec" "b32enc" "b32dec" "list" "first" "mustFirst" "rest" "mustRest" "last" + "mustLast" "initial" "mustInitial" "append" "mustAppend" "prepend" "mustPrepend" "concat" + "reverse" "mustReverse" "uniq" "mustUniq" "without" "mustWithout" "has" "mustHas" "compact" + "mustCompact" "index" "slice" "mustSlice" "until" "untilStep" "seq" "add" "add1" "sub" "div" + "mod" "mul" "max" "min" "len" "addf" "add1f" "subf" "divf" "mulf" "maxf" "minf" "floor" "ceil" + "round" "getHostByName" "base" "dir" "clean" "ext" "isAbs" "kindOf" "kindIs" "typeOf" "typeIs" + "typeIsLike" "deepequal" "semver" "semverCompare" "urlParse" "urlJoin" "urlquery" "lookup" + "include")) + +; {{ .Values.test }} +(selector_expression + operand: (field + name: (identifier) @constant.builtin + (#set! priority 110) + (#any-of? @constant.builtin + "Values" "Chart" "Release" "Capabilities" "Files" "Subcharts" "Template")) + (field_identifier)) + +; {{ $.Values.test }} +(selector_expression + operand: (variable) + field: (field_identifier) @constant.builtin + (#set! priority 110) + (#any-of? @constant.builtin + "Values" "Chart" "Release" "Capabilities" "Files" "Subcharts" "Template")) diff --git a/runtime/queries/helm/injections.scm b/runtime/queries/helm/injections.scm new file mode 100644 index 000000000..2adf8743a --- /dev/null +++ b/runtime/queries/helm/injections.scm @@ -0,0 +1,36 @@ +; inherits: gotmpl + +((text) @injection.content + (#set! injection.language "yaml") + (#set! injection.combined)) + +; {{ regexFind "[a-zA-Z][1-9]" "abcd1234" }} +(function_call + function: (identifier) @_function + arguments: (argument_list + . + (interpreted_string_literal) @injection.content) + (#any-of? @_function + "regexMatch" "mustRegexMatch" "regexFindAll" "mustRegexFinDall" "regexFind" "mustRegexFind" + "regexReplaceAll" "mustRegexReplaceAll" "regexReplaceAllLiteral" "mustRegexReplaceAllLiteral" + "regexSplit" "mustRegexSplit") + (#offset! @injection.content 0 1 0 -1) + (#set! injection.language "regex")) + +(function_call + function: (identifier) @_function + arguments: (argument_list + . + (interpreted_string_literal) @injection.content) + (#any-of? @_function "fromYaml" "fromYamlArray") + (#offset! @injection.content 0 1 0 -1) + (#set! injection.language "yaml")) + +(function_call + function: (identifier) @_function + arguments: (argument_list + . + (interpreted_string_literal) @injection.content) + (#any-of? @_function "fromJson" "fromJsonArray") + (#offset! @injection.content 0 1 0 -1) + (#set! injection.language "json")) diff --git a/runtime/queries/helm/locals.scm b/runtime/queries/helm/locals.scm new file mode 100644 index 000000000..6ffb4b7d4 --- /dev/null +++ b/runtime/queries/helm/locals.scm @@ -0,0 +1 @@ +; inherits: gotmpl |
