SYNG Beta – Structural Search for JavaScript
syng.dev
syng.dev
I'd love to hear your feedback on the tool in general, your experience, and the query language in particular.
Here's where you can find SYNG:
- Website: https://syng.dev
- Documentation: https://syng.dev/docs/manual
- VSCode Extension: https://marketplace.visualstudio.com/items?itemName=semantic...
- Discord server to chat or ask questions: https://discord.gg/ZUGAM9Y23r
Thank you very much!
PS: if you're curious about the query language's history, I tell the story of how I arrived at this particular implementation in the article at https://amireh.net/esgrep-ql.html. It's rather informal, as I wrote it originally for a friend, so take it for what it is.
For what I see on the documentation, I like the simplicity and the Lisp like query language. Definitely I’ll try this tool.
If you are wandering what is my use case: when you maintain a design system it’s very useful to understand how the components are used across projects, so you can prioritize a migration or redesign. Querying using the AST is better than doing many RegExp searches that don’t take into account syntax variants.
The use case you describe is a prominent one. I used to write ad-hoc static analysis programs to get at this information, and every time you do this, there's a lot you have to "relearn"; whether it's changes in the spec, or all the AST patterns you need to account for, etc. Burdensome and prone to error, but necessary and ultimately very useful.
And in other cases, using a RegExp search could yield thousands of results, more than a human can handle, and you might not be able to narrow them down without fear of missing positives. In both cases, an AST search comes very handy. And now it can be done very quickly too!