YAML language support#283
Open
selfagency wants to merge 4 commits into
Open
Conversation
- Add tree-sitter-yaml v0.7.2 dependency - Implement 8 working YAML PreparedQuery variants: * string-scalar, integer-scalar, float-scalar, boolean-scalar * block-sequence, block-mapping, flow-sequence, flow-mapping - Add YAML CLI integration with --yaml, --yaml-query, --yaml-query-file - Add 8 comprehensive YAML tests with snapshot validation - All tests passing (501 unit + 195 module + 59 CLI + 2 regression)
Agent-Logs-Url: https://github.com/selfagency/srgn/sessions/4fe563b4-4394-4e3f-8bc1-6f874505c938 Co-authored-by: selfagency <2541728+selfagency@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds YAML language scoping to srgn using tree-sitter-yaml, wiring it into the CLI and test suite so YAML files (.yaml / .yml) can be scoped via prepared queries or custom tree-sitter queries.
Changes:
- Add a new YAML language scoper (
src/scoping/langs/yaml.rs) with 8 prepared query variants. - Integrate YAML scoping into the CLI (
--yaml,--yaml-query,--yaml-query-file) and documentation output. - Add YAML fixture + snapshot tests covering the prepared queries.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
Cargo.toml |
Adds the tree-sitter-yaml dependency. |
Cargo.lock |
Locks tree-sitter-yaml and updates dependency graph. |
src/scoping/langs.rs |
Exposes the new yaml language module. |
src/scoping/langs/yaml.rs |
Implements YAML CompiledQuery + prepared query variants and file detection (yaml/yml). |
src/main.rs |
Adds CLI flags and scope-group wiring for YAML queries. |
README.md |
Documents the new YAML CLI options and prepared query values. |
tests/langs/mod.rs |
Adds YAML prepared-query snapshots and a custom-query language-selection test case. |
tests/langs/yaml/base.yaml |
Adds a YAML fixture used by the snapshot tests. |
tests/langs/snapshots/r#mod__langs__base.yaml_string_scalar.snap |
Snapshot for --yaml string-scalar. |
tests/langs/snapshots/r#mod__langs__base.yaml_integer_scalar.snap |
Snapshot for --yaml integer-scalar. |
tests/langs/snapshots/r#mod__langs__base.yaml_float_scalar.snap |
Snapshot for --yaml float-scalar. |
tests/langs/snapshots/r#mod__langs__base.yaml_boolean_scalar.snap |
Snapshot for --yaml boolean-scalar. |
tests/langs/snapshots/r#mod__langs__base.yaml_block_sequence.snap |
Snapshot for --yaml block-sequence. |
tests/langs/snapshots/r#mod__langs__base.yaml_block_mapping.snap |
Snapshot for --yaml block-mapping. |
tests/langs/snapshots/r#mod__langs__base.yaml_flow_sequence.snap |
Snapshot for --yaml flow-sequence. |
tests/langs/snapshots/r#mod__langs__base.yaml_flow_mapping.snap |
Snapshot for --yaml flow-mapping. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds comprehensive YAML language support to srgn, enabling syntax-aware manipulation of
.yamland.ymlconfiguration files.Changes
tree-sitter-yaml v0.7.2(1,813,985 downloads, official tree-sitter grammar)string-scalar,integer-scalar,float-scalar,boolean-scalarblock-sequence,block-mapping,flow-sequence,flow-mapping--yaml,--yaml-query,--yaml-query-fileWhy This Matters
YAML is the most popular configuration format across:
This enables srgn to work effectively with the most widely-used configuration format in the ecosystem.
Example Usage
Implementation Quality