Add tree-sitter queries for embedding, overrides, runnables, and textobjects#1287
Add tree-sitter queries for embedding, overrides, runnables, and textobjects#1287micahscopes wants to merge 1 commit intomasterfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b9930cff46
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| ) @_start | ||
| . | ||
| (attribute) * | ||
| . | ||
| (function_definition |
There was a problem hiding this comment.
Match test attributes inside function definitions
This pattern assumes attribute and function_definition are sibling nodes, but in this grammar attributes are nested under function_definition via attribute_list (see crates/tree-sitter-fe/grammar.js around function_definition), so a normal #[test] fn foo() {} never matches and no fe-test runnable is produced in editors that consume runnables.scm.
Useful? React with 👍 / 👎.
Adds four additional Tree-sitter query files to
crates/tree-sitter-fe/queries/, sourced from the zed-fe extension:embedding.scm— context/item/collapse queries for code folding and breadcrumbsoverrides.scm— string and comment overridesrunnables.scm— test module and test function detectiontextobjects.scm— function, class, and comment text objectsThese are useful for editors that consume tree-sitter queries directly (Zed, Neovim, Helix, etc.) and keeping them in the grammar repo makes them easier to maintain alongside the grammar itself.