Skip to content

Add tree-sitter queries for embedding, overrides, runnables, and textobjects#1287

Open
micahscopes wants to merge 1 commit intomasterfrom
add-treesitter-queries
Open

Add tree-sitter queries for embedding, overrides, runnables, and textobjects#1287
micahscopes wants to merge 1 commit intomasterfrom
add-treesitter-queries

Conversation

@micahscopes
Copy link
Collaborator

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 breadcrumbs
  • overrides.scm — string and comment overrides
  • runnables.scm — test module and test function detection
  • textobjects.scm — function, class, and comment text objects

These 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.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +16 to +20
) @_start
.
(attribute) *
.
(function_definition

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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