Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(grit): fix matching function body #3810

Merged
merged 2 commits into from
Sep 6, 2024

Conversation

arendjr
Copy link
Contributor

@arendjr arendjr commented Sep 6, 2024

Summary

We had an issue with matching function bodies in Grit queries that prevented metavariables from matching statements inside a function body. In fact, even the presence of a metavariable inside a snippet's function body would prevent the query from matching at all.

To fix it, I made sure JsMetavariable will be accepted in our grammar inside AnyJsStatement and updated the JS parser so it's accepted there.

Test Plan

Expanded test cases.

@github-actions github-actions bot added A-Parser Area: parser A-Formatter Area: formatter A-Tooling Area: internal tools L-JavaScript Language: JavaScript and super languages labels Sep 6, 2024
Copy link

codspeed-hq bot commented Sep 6, 2024

CodSpeed Performance Report

Merging #3810 will improve performances by 6.33%

Comparing arendjr:fix-matching-function-body (ac3c83d) with main (5f4a8c5)

Summary

⚡ 1 improvements
✅ 106 untouched benchmarks

Benchmarks breakdown

Benchmark main arendjr:fix-matching-function-body Change
jquery.min_16034160674129647344.js[cached] 28.7 ms 27 ms +6.33%

@arendjr arendjr merged commit 4e681d1 into biomejs:main Sep 6, 2024
12 checks passed
@Conaclos Conaclos added the A-Changelog Area: changelog label Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog A-Formatter Area: formatter A-Parser Area: parser A-Tooling Area: internal tools L-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants