Skip to content

fix(grit): correct arrow_function slot indices for GritQL patterns#8793

Merged
ematipico merged 4 commits intobiomejs:mainfrom
TheBaconWizard:fix/grit-arrow-fn-params
Jan 19, 2026
Merged

fix(grit): correct arrow_function slot indices for GritQL patterns#8793
ematipico merged 4 commits intobiomejs:mainfrom
TheBaconWizard:fix/grit-arrow-fn-params

Conversation

@TheBaconWizard
Copy link
Contributor

AI disclosure

I used cursor agent and ai to explain how plugins get ran and how plugin tree sitter bindings work.

Summary

Add missing parameters argument to arrow_function tree-sitter mapping.

Motivation

I ran into this issue while trying to write my own plugins.

Test Plan

Added test + snapshot files.

I also performed the following test

$ biome search 'arrow_function(parameters=$parameters, body=$body)' ./scratch.ts

scratch.ts:1:11 search
  1 │ const a = () => {};
scratch.ts:2:13 search 
  2 │ const add = (a: number, b: number, c: number, d: number) => a + b + c + d;
scratch.ts:3:14 search 
  3 │ const add1 = (a: number, b: number) => a + b

(pointed at build binary)

and received expected output vs

$ npx @biomejs/biome search 'arrow_function(parameters=$parameters, body=$body)' ./scratch.ts

  ✖ Error executing the Grit query

@changeset-bot
Copy link

changeset-bot bot commented Jan 19, 2026

🦋 Changeset detected

Latest commit: 4fb6c61

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@biomejs/biome Patch
@biomejs/cli-win32-x64 Patch
@biomejs/cli-win32-arm64 Patch
@biomejs/cli-darwin-x64 Patch
@biomejs/cli-darwin-arm64 Patch
@biomejs/cli-linux-x64 Patch
@biomejs/cli-linux-arm64 Patch
@biomejs/cli-linux-x64-musl Patch
@biomejs/cli-linux-arm64-musl Patch
@biomejs/wasm-web Patch
@biomejs/wasm-bundler Patch
@biomejs/wasm-nodejs Patch
@biomejs/backend-jsonrpc Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added A-Tooling Area: internal tools L-Grit Language: GritQL labels Jan 19, 2026
@TheBaconWizard TheBaconWizard changed the title Fix/grit arrow fn params fix(grit): correct arrow_function slot indices for GritQL patterns #8411 Jan 19, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 19, 2026

Walkthrough

This change adds an explicit parameters slot to the arrow_function GritQL pattern by updating Tree‑sitter mappings in generated data and in the codegen mapping. It adds a grit spec and a TypeScript test file demonstrating an arrow function with parameters and body. A changeset documenting the patch release and docs/messaging updates were also added. No public API or exported declarations were modified.

Possibly related PRs

Suggested labels

L-JavaScript

Suggested reviewers

  • ematipico
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately captures the main change: adding missing parameters slot to the arrow_function GritQL pattern mapping.
Description check ✅ Passed The description clearly explains the fix, motivation, and includes test verification with concrete examples of the resolved issue.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@TheBaconWizard TheBaconWizard force-pushed the fix/grit-arrow-fn-params branch from f3e9e06 to 61447e3 Compare January 19, 2026 00:34
Copy link
Contributor

@dyc3 dyc3 left a comment

Choose a reason for hiding this comment

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

Nothing looks particularly wrong to me, but I'll pass it of to @morgante or @arendjr to approve.

Co-authored-by: Carson McManus <dyc3@users.noreply.github.com>
@ematipico ematipico merged commit c19fb0e into biomejs:main Jan 19, 2026
14 checks passed
@github-actions github-actions bot mentioned this pull request Jan 19, 2026
@TheBaconWizard TheBaconWizard changed the title fix(grit): correct arrow_function slot indices for GritQL patterns #8411 fix(grit): correct arrow_function slot indices for GritQL patterns Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Tooling Area: internal tools L-Grit Language: GritQL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants