Conversation
|
I don't think this messes up the broader approach to keywords that @savetheclocktower implemented in the previous PR. |
There was a problem hiding this comment.
Pull request overview
This pull request adds YAML front matter support and three new keywords (echo, slot, default) to the tree-sitter-vento grammar, along with comprehensive documentation and examples.
Changes:
- Added YAML front matter parsing with
---delimiters and language injection for syntax highlighting - Implemented three new keywords:
echofor output expressions,slot//slotfor slot definitions, anddefault//defaultfor default content blocks - Updated grammar rules, scanner, syntax highlighting queries, and test cases to support the new features
- Added comprehensive examples demonstrating front matter, keyword usage, and for-loop scoping
- Added documentation files (CHANGELOG.md, RUST_FIXES.md) and updated README.md with feature descriptions
Reviewed changes
Copilot reviewed 15 out of 17 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| grammar.js | Added front_matter, echo_tag, slot_block, and default_block grammar rules with proper precedence |
| src/grammar.json | Auto-generated grammar JSON reflecting the new rules |
| src/scanner.c | Added echo, slot, and default to KEYWORDS array for proper keyword detection |
| src/node-types.json | Auto-generated node types including new front_matter, echo_tag, slot_block, and default_block nodes |
| queries/highlights.scm | Comprehensive syntax highlighting rules for all keywords and front matter delimiters |
| queries/injections.scm | Added YAML language injection for front_matter_content |
| test/corpus/main.txt | Added test cases for front matter and new keywords with expected parse trees |
| test/corpus/new-keywords-test.vto | Example file demonstrating new keywords (contains invalid syntax on line 75) |
| examples/with-frontmatter.vto | Example demonstrating YAML front matter with Vento templates |
| examples/for-loop-scoping.vto | Example showing variable scoping in for loops |
| examples/all-keywords.vto | Comprehensive example using all supported Vento keywords |
| tree-sitter.json | Configuration file with highlights field and formatting improvements |
| pnpm-lock.yaml | New lockfile for dependency management |
| README.md | Updated with features section documenting keywords and front matter support |
| CHANGELOG.md | Documents changes for version 0.21.0 (contains discrepancies with actual PR changes) |
| RUST_FIXES.md | Documentation of Rust binding fixes (describes changes not present in this PR) |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| ### Added | ||
|
|
||
| - `locals.scm` query file for local scope and variable reference tracking |
There was a problem hiding this comment.
The CHANGELOG mentions adding a locals.scm query file, but this file is not present in the PR and does not exist in the queries directory. Either the file should be added, or this entry should be removed from the CHANGELOG.
CHANGELOG.md
Outdated
| - **Rust bindings**: Complete rewrite of `bindings/rust/lib.rs` to properly reference Vento | ||
| - **Rust bindings**: Comprehensive rewrite of `bindings/rust/README.md` with usage examples | ||
| - Updated `Cargo.toml` metadata (version, authors format, repository URL) | ||
| - Updated `package.json` metadata (name, keywords) |
There was a problem hiding this comment.
The CHANGELOG states that package.json metadata (name, keywords) was updated, but looking at the actual changes in this PR, the package.json keywords still show ["parser", "json"] instead of the claimed ["parser", "vento", "template", "tree-sitter"]. The name also remains unchanged. This discrepancy should be corrected by either making the actual changes or removing this entry from the CHANGELOG.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
Co-authored-by: bobrocke <2962426+bobrocke@users.noreply.github.com>
Co-authored-by: bobrocke <2962426+bobrocke@users.noreply.github.com>
Co-authored-by: bobrocke <2962426+bobrocke@users.noreply.github.com>
[WIP] WIP Address feedback on Yaml and keywords pull request
[WIP] Address feedback on Yaml&keywords pull request
Sync version numbers to 0.21.0
[WIP] Work in progress to address feedback on Yaml and keywords implementation
[WIP] Fix issues based on feedback for Yaml&keywords PR
Adding YAML front matter injection and some keyword updates.