Install latest/edge of SG Ast-Grep
Ubuntu 16.04 or later?
Make sure snap support is enabled in your Desktop store.
Install using the command line
sudo snap install ast-grep --edge
Don't have snapd? Get set up for snaps.
Thank you for your report. Information you provided will help us investigate further.
There was an error while sending your report. Please try again later.
Generate an embeddable card to be shared on external websites.
ast-grep is an abstract syntax tree based tool to search code by pattern code. Think of it as your old-friend grep, but matching AST nodes instead of text.
You can write patterns as if you are writing ordinary code. It will match all code that has the same syntactical structure.
You can use $ sign + upper case letters as a wildcard, e.g. $MATCH, to match any single AST node. Think of it as regular expression dot ., except it is not textual.
Try the online playground for a taste! https://ast-grep.github.io/playground.html
Choose your Linux distribution to get detailed installation instructions. If yours is not shown, get more details on the installing snapd documentation.