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

[feature] allow global utilities to provide meta-variables to their users #1297

Open
emosenkis opened this issue Jul 8, 2024 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@emosenkis
Copy link

⭐ Suggestion

Capturing meta-vars in utilities can be extremely valuable but currently this is only possible with local utilities, which prevents them from being reusable.

💻 Use Cases

Match a non-trivial construct and capture a piece that is deeply nested in it in a metavariable for use in the fix.

@GTB3NW
Copy link

GTB3NW commented Oct 3, 2024

I'm very glad I found this issue, I don't see it mentioned anywhere in the docs

@HerringtonDarkholme
Copy link
Member

I didn't expect users will use ast-grep this far 😆 so I didn't mention too much about util rules.

I will update the doc if more users have similar questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants