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

Can it support options to toggle between finding function definitions or function calls? #429

Closed
nick357 opened this issue Jan 11, 2025 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@nick357
Copy link

nick357 commented Jan 11, 2025

My question is whether this search plugin can support simple options to find function definitions and function calls. In everyday development, matching definitions and implementations is a very common requirement.

For example, if I enter "add" in the search box, by checking or selecting function definition and function call, the underlying call would be the following two corresponding rules.

https://ast-grep.github.io/playground.html#eyJtb2RlIjoiQ29uZmlnIiwibGFuZyI6ImphdmFzY3JpcHQiLCJxdWVyeSI6ImFkZCIsInJld3JpdGUiOiIiLCJzdHJpY3RuZXNzIjoiYXN0Iiwic2VsZWN0b3IiOiIiLCJjb25maWciOiJydWxlOlxuICBwYXR0ZXJuOiBhZGRcbiAgaW5zaWRlOlxuICAgIGtpbmQ6IGZ1bmN0aW9uX2RlY2xhcmF0aW9uIiwic291cmNlIjoiZnVuY3Rpb24gYWRkKGEpIHtcblxufVxuYWRkKDEpXG4ifQ==

https://ast-grep.github.io/playground.html#eyJtb2RlIjoiQ29uZmlnIiwibGFuZyI6ImphdmFzY3JpcHQiLCJxdWVyeSI6ImFkZCIsInJld3JpdGUiOiIiLCJzdHJpY3RuZXNzIjoiYXN0Iiwic2VsZWN0b3IiOiIiLCJjb25maWciOiJydWxlOlxuICBwYXR0ZXJuOiBhZGRcbiAgaW5zaWRlOlxuICAgIGtpbmQ6IGNhbGxfZXhwcmVzc2lvbiIsInNvdXJjZSI6ImZ1bmN0aW9uIGFkZChhKSB7XG5cbn1cbmFkZCgxKVxuIn0=

Originally posted by @nick357 in #427 (comment)

@HerringtonDarkholme
Copy link
Member

the feature should covered by #167

@HerringtonDarkholme HerringtonDarkholme added the duplicate This issue or pull request already exists label Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants