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

Custom Language Support #179

Open
v217 opened this issue Dec 25, 2024 · 2 comments
Open

Custom Language Support #179

v217 opened this issue Dec 25, 2024 · 2 comments

Comments

@v217
Copy link

v217 commented Dec 25, 2024

Hi!
Please add Custom Language Support.

Thanks!

@alexpovel
Copy link
Owner

Hi @v217 !

Thanks for your request. It looks like a lot of work, and also to run against the spirit of srgn a bit. The "prepared queries" are a large part of what makes srgn useful in my mind, and with a pluggable aka custom language, they couldn't be offered anymore. At that point, using tools like ast-grep or the tree-sitter CLI directly seems like suitable solutions.

@v217
Copy link
Author

v217 commented Jan 1, 2025

Hi Alex!
Thanks for srgn!
The motivation for this issue was, that in ast-grep you can't (like in srgn) use “tree-sitter queries” to select matches. If you don't write grammars, that is probably not an issue, but if you want to customize the tooling for a language, you have to remember two queries: The tree-sitter query and the query used, e.g., in ast-grep. That's in my view the main advantage of srgn over ast-grep, but this advantage mainly is important, if you are familiar with the tree-sitter queries, e.g., you most likely wrote or modified your own custom grammar. So even for a subset of features of srgn custom language support might be motivated?
Or, as you mentioned, using tree-sitter directly in your scripts.

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

No branches or pull requests

2 participants