Skip to content

Docs, pinned helm-ls cache, editing queries, and CI - #33

Merged
cabrinha merged 7 commits into
mainfrom
cursor/helm-docs-pin-queries-ci-b2d5
Aug 27, 2026
Merged

cabrinha merged 7 commits into
mainfrom
cursor/helm-docs-pin-queries-ci-b2d5

Conversation

@cabrinha

@cabrinha cabrinha commented Aug 26, 2026 •

Copy link
Copy Markdown
Owner

Rebased onto main after #32 merged. This PR no longer fights that work.

From #32 (already on main, kept)

Vendored helm lexer ({} plus rest of line plus trailing newline), YAML injected per (text) node with only @content (no combined, no dual @content / @injection.content), file detection (.tpl / helmfile suffixes), helm-ls settings wrapping, brackets.scm without the backtick rule, and scripts/check-grammar.sh.

From #33

README/docs (pinned helm-ls auto-download, yaml-language-server for full LSP), helm-ls pin+cache (src/binary.rs, skip GitHub when the pinned binary is on disk), indents.scm / textobjects.scm, and CI: grammar-diff gate, Zed-style query load, zed-extension package, ts_query_ls format --check languages.

zed_extension_api stays at 0.5.0.

Conflicts resolved on rebase

tests/grammar-pin.sha now matches the vendored pin d4a62d1. Query scripts compile against local vendor/tree-sitter-helm. Combined injection is rejected by both check-grammar.sh and check-zed-queries.sh.

How I tested

  • cargo test (15 tests: pin/cache + helm-ls settings wrap)
  • cargo build --target wasm32-wasip1 --release
  • bash scripts/check-queries.sh
  • bash scripts/check-grammar.sh
  • bash scripts/check-grammar-pin.sh
  • bash scripts/check-zed-queries.sh (fails dual @content, combined injection, and backtick brackets)
  • ts_query_ls format --check languages
Open in Web Open in Cursor 

@cabrinha
cabrinha marked this pull request as ready for review August 26, 2026 23:37
README still told people to install helm-ls first, which has not been
true since the auto-download path landed. yaml-language-server remains
required for full Kubernetes schema LSP.

Recommended file_types now match the Zed Helm docs: templates, helmfile.d,
and values*.yaml. Chart.yaml stays YAML. Globs do not belong in
path_suffixes.
A cached helm-ls build was only used when latest_github_release failed,
so every Zed restart hit GitHub. Pin v0.5.4, return that binary when it
is already on disk, and only delete other helm_ls_* version dirs after a
download so languages/ and grammars/ are not wiped.

The pin and cleanup rules live in a host-testable module.
Everyday editing was missing tree-sitter indent and bracket matching
beyond config.toml auto-close. Indent if/range/with/define/block, outdent
end/else, and treat named templates as textobjects. Also outdent {{ end }}
lines via decrease_indent_patterns.
Run cargo test, a wasm32-wasip1 build, and tree-sitter parse/query checks
against a small example chart. No extra secrets. Catches helm-ls pin
regressions and highlight/indent query breakage.
Zed rejected mixed @content/@injection.content and invalid backtick
brackets even though tree-sitter query compiled them. Fail CI on those
load errors, using the same capture-name rules as the speed/accuracy
branch.

Also lock the tree-sitter-go-template SHA in tests/grammar-pin.sha to
the extension.toml pin, clone that commit, and regenerate the helm
dialect the way the upstream grammar CI does so generated parser files
cannot drift silently.
Copy the check_extension steps from zed-industries/zed extension_tests.yml:
wget the cached zed-extension CLI and package with --source-dir /
--scratch-dir / --output-dir, and run ts_query_ls format --check languages
from the ribru17/ts_query_ls v3.15.1 release.

Format the Helm query files so that check passes. Grammar pin and Zed
query-load jobs stay as they are.
extension.toml now pins vendor/tree-sitter-helm @ d4a62d1 from #32.
Keep tests/grammar-pin.sha in lockstep, compile queries against the
local vendor copy, and reject combined YAML injection the same way
check-grammar.sh does.
@cursor
cursor Bot force-pushed the cursor/helm-docs-pin-queries-ci-b2d5 branch from 5bcbd08 to b404421 Compare August 27, 2026 00:37
@cabrinha
cabrinha merged commit dbdca6f into main Aug 27, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant