I don't understand what makes this a "code" search and replace tool as opposed to a general text search and replace tool (a la the many many existing options for such). I was kind of expecting some kind of AST structure or grammar spec or at least a quick tokenizer to be able to handle situations like "don't replace this text if it appears in a string constant", but it doesn't mention anything like that.
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).
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. (Disclaimer: I'm the author.)
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()'
Off the top of my head amber can refer to: an in browser small talk implementation, a typed to bash compiled language, a text replacement tool, a crystal mvc web framework, and a medical simulation software.
There's an Amber Smalltalk and Amber Bash Scripting Language and this. I just discovered these literally the past week.
"Namespace collisions" in the real world get my goat in general, but in this case, I'm about to have a heart attack from the discovery of all 3 in one week.
I get why for all cases : amber=electron/ήλεκτρο in Ancient Greek.*
But still.
* One of my favorite albums is Amber by Autechre, and where I learned this nugget (also - it's a pile of Sand Dunes on the cover, so silicon). Clever boys.
related, you might want to consider changing your username - when I saw your comment I thought you were the Madrid sporting organization and it took me a while to realize.
I used to use https://comby.dev/ which is amazing when it works but I kept having issues where it wouldn't accept my input or it'd error during processing. It was very flaky. So I've resorted to using https://github.com/piranha/goreplace as backup which is much simpler but reliable.
Most of the time if I'm doing this, it's in a git repo and I only want to affect the checked-in files so that I can easily diff my changes. So I use a combination of `git grep`, `xargs`, and `perl` via a script I named `git-gsr`:
Seems 'amber' a popular name. A dynamics package, an hypothetical operating system, a framework, a Java enhancing project, a VM, a language, now a tool.
I'm glad that people make tools like this, but this is a task that I need to do so rarely that I'm likely to forget it exists, which means that I'll likely roll my own (inferior!) version as a one-time thing.
ripgrep is brilliant and I use it a lot but it has no knowledge of the languages it works with so I don't use it for searching anything more than names of functions or stuff.
If you really need to search for code constructs that can span multiple lines (but not always do) then Treesitter-aware tools like ast-grep and gritql are superior.