-
ast-grep is based on tree-sitter parsers and most of the time is spent on parsing.
There is some optimization to [skip parsing](https://github.com/ast-grep/ast-grep/blob/9f8ed5fb2abf35d928...) but generally I don't expect ast-grep can beat ripgrep or amber. (but sometimes ast-grep can beat grep due to parallel processing)
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
-
-
ripgrep
ripgrep recursively searches directories for a regex pattern while respecting your gitignore
-
I used to use https://comby.dev/ but I kept having issues where it wouldn't accept my input or it'd error during processing. It was very flakey. So I've resorted to using https://github.com/piranha/goreplace as backup which is much simpler but reliable.
I'll check this one out...
-
Feels similar to `sd` (https://github.com/chmln/sd)
which in my mind was the first “replace” version of ripgrep
grep -> ripgrep
-
srgn
A grep-like tool which understands source code syntax and allows for manipulation in addition to search
The tool you are describing is what I am trying to build at https://github.com/alexpovel/srgn . The idea is a compromise between regex (think ripgrep) and grammar awareness (through tree-sitter).
-
this is cool! i do the same thing[1], wanted ag/rg to be able to search and replace.
1. https://github.com/nathants/agr
-
Yeah it doesn't look like this is AST-aware at all.
If you want to do queries that understand the grammar, https://github.com/getgrit/gritql is closer to what you're looking for.
Ex. here's how you would search for your example of looking for a string unless it's inside a string constant. [0]
grit apply '"this_string" => `new_string` where { $match <: not within string() }'
[0] https://app.grit.io/studio?key=v8iA8zIbHs2uCykNpSF_G
-
Not to be confused with this Amber
https://amber-lang.com/