diff --git a/Cargo.toml b/Cargo.toml index 1c5f3ed..7a68beb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zed_helm" -version = "0.0.2" +version = "0.0.3" edition = "2021" publish = false license = "Apache-2.0" diff --git a/README.md b/README.md index e41425c..f722fc3 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,13 @@ Syntax highlighting for Helm templates using tree-sitter and integration of [hel ## Installation -The extension relies on the PATH environment variable and first looks for 'helm_ls', then 'helm-ls'. If neither is available, an error is shown. +The extension relies on the PATH environment variable and first looks for 'helm_ls', +then 'helm-ls'. If neither is available, an error is shown. ## Configuration -This is an example of providing configuration for the language server via Zed's `settings.json`. For full reference of possible values, refer to [helm-ls configuration section](https://github.com/mrjosh/helm-ls/?tab=readme-ov-file#configuration-options). +This is an example of providing configuration for the language server via Zed's `settings.json`. +For full reference of possible values, refer to [helm-ls configuration section](https://github.com/mrjosh/helm-ls/?tab=readme-ov-file#configuration-options). ```json { @@ -36,10 +38,10 @@ https://github.com/ngalaiko/tree-sitter-go-template Every time the extension is released: -1. **Bump the Version:** +1. **Bump the Version:** Update the version number in Cargo.toml and extension.toml. -2. **Update Extension Index:** +2. **Update Extension Index:** After releasing, update the extension entry in [zed-industries/extensions](http://github.com/zed-industries/extensions/) to reflect the new version. This ensures users always have access to the latest diff --git a/languages/helm/config.toml b/languages/helm/config.toml index f153caf..5cd1360 100644 --- a/languages/helm/config.toml +++ b/languages/helm/config.toml @@ -2,6 +2,8 @@ name = "Helm" grammar = "helm" line_comments = ["# "] path_suffixes = [".helmignore"] +tab_size = 2 +word_characters = ["-"] block_comment = ["{{/* ", " */}}"] brackets = [ { start = "{{", end = "}}", close = true, newline = false }, diff --git a/languages/helm/highlights.scm b/languages/helm/highlights.scm index 943e2bf..6186c70 100644 --- a/languages/helm/highlights.scm +++ b/languages/helm/highlights.scm @@ -24,7 +24,7 @@ ; Builtin functions ((identifier) @function.builtin - (#match? @function.builtin "^(and|call|html|index|slice|js|len|not|or|print|printf|println|urlquery|eq|ne|lt|ge|gt|ge|indent|nindent|toYaml|toJson|trim|b64enc|b64dec|default)$")) + (#match? @function.builtin "^(abbrev|abbrevboth|add|add1|add1f|addf|adler32sum|ago|and|append|atoi|b32dec|b32enc|b64dec|b64enc|base|buildCustomCert|camelcase|call|cat|ceil|chunk|clean|coalesce|compact|concat|contains|date|dateInZone|dateModify|decryptAES|deepCopy|deepEqual|default|derivePassword|dict|dig|dir|div|divf|duration|durationRound|empty|encryptAES|eq|ext|fail|first|float64|floor|fromJson|fromJsonArray|fromYaml|fromYamlArray|ge|genCA|genPrivateKey|genSelfSignedCert|genSignedCert|get|getHostByName|gt|has|hasKey|hasPrefix|hasSuffix|html|htmlDate|htmlDateInZone|htpasswd|index|indent|initials|int|int64|isAbs|js|kebabcase|keys|kindIs|kindOf|last|le|len|list|lookup|lower|lt|max|maxf|merge|mergeOverwrite|min|minf|mod|mul|mulf|mustAppend|mustCompact|mustDateModify|mustDeepCopy|mustFirst|mustHas|mustInitial|mustLast|mustMerge|mustMergeOverwrite|mustPrepend|mustRegexFind|mustRegexFindAll|mustRegexMatch|mustRegexReplaceAll|mustRegexReplaceAllLiteral|mustRegexSplit|mustRest|mustReverse|mustSlice|mustToDate|mustToJson|mustToPrettyJson|mustToRawJson|mustToToml|mustUniq|mustWithout|ne|nindent|nospace|not|now|omit|or|pick|pluck|plural|prepend|print|printf|println|quote|randAlpha|randAlphaNum|randAscii|randBytes|randNumeric|regexFind|regexFindAll|regexMatch|regexReplaceAll|regexReplaceAllLiteral|regexSplit|repeat|replace|required|rest|reverse|round|semver|semverCompare|seq|set|sha1sum|sha256sum|shuffle|slice|snakecase|squote|sub|subf|substr|swapcase|ternary|title|toDate|toDecimal|toJson|toPrettyJson|toRawJson|toString|toStrings|toToml|toYaml|toYamlPretty|trim|trimAll|trimPrefix|trimSuffix|trunc|typeIs|typeIsLike|typeOf|uniq|unixEpoch|unset|until|untilStep|untitle|upper|urlJoin|urlParse|urlquery|uuidv4|values|without|wrap|wrapWith)$")) ; Delimiters diff --git a/languages/helm/outline.scm b/languages/helm/outline.scm new file mode 100644 index 0000000..9e8c1ba --- /dev/null +++ b/languages/helm/outline.scm @@ -0,0 +1,15 @@ +; Named template definitions: {{- define "mychart.labels" -}} ... {{- end }} +; Both quoted ("name") and backtick (`name`) string forms are handled. +(define_action + name: [ + (interpreted_string_literal) + (raw_string_literal) + ] @name) @item + +; Block definitions: {{- block "mychart.body" . -}} ... {{- end }} +; `block` is like `define` but with a fallback body — also worth showing in the outline. +(block_action + name: [ + (interpreted_string_literal) + (raw_string_literal) + ] @name) @item