One useful tool beyond regular grep for counting the number of times a pattern appears is ast-grep [1], which allows for more sophisticated rules. [1] https://ast-grep.github.io/. - Source: Hacker News / 8 days ago
The amazing ast-grep tool does not support vue and scss by default but can be configured to do so. - Source: dev.to / about 1 month ago
Hi! ast-grep[1] author here. It is a tree-sitter based syntax tool to search tool. I wonder how you transition from tree-sitter to other builtin parsers? Tree-sitter gave a unified interface to all languages. Using language native parsers will require significant work for various FFI if I am not wrong. [1]: https://ast-grep.github.io/. - Source: Hacker News / 3 months ago
I’ve been looking at codemod tools recently, just as a way to extend my editing toolbox. I came across https://ast-grep.github.io/, which looks like it might address part of this problem. My initial test case was to locate all calls to a method where a specific argument was ‘true’, and it handled that well - that’s the kind of thing an IDE seems to struggle with. I’m not yet sure whether it could handle renaming a... - Source: Hacker News / 5 months ago
Astgrep is a very useful tool. https://ast-grep.github.io/ It's not as easy to use as grep but I think one can script it to be nearly so. It has huge power but without learning it all one can do searches that grep finds difficult. e.g. Finding all the locations where a method is called and showing the parameters even if they are on multiple lines. Ultragrep - I don't love this quite as much but it does have a way... - Source: Hacker News / 5 months ago
We are thrilled to announce that ast-grep, the powerful code search tool, has reached a stellar milestone of 6000 stars on GitHub! This is a testament to the community's trust in our tool and the continuous improvements we've made. Let's dive into the latest features and enhancements that make ast-grep the go-to tool for developers worldwide. - Source: dev.to / 9 months ago
It's unclear what the superpowers would be? Video doesn't show anything I can't do with an IDE or decent code editor, and there I also have refactoring tools, metadata like indicators for usages that can be used for navigating and so on. Reminds me of UML-like diagrams over relational databases, except that it's generated one piece at a time. In practice I generate diagrams showing cyclomatic complexity much more... - Source: Hacker News / 9 months ago
This article illustrates the usage of ast-grep, a tool designed to locate and substitute patterns in your codebase, towards easing your migration to React 19. - Source: dev.to / 10 months ago
Ast-grep is a command-line tool that lets you search and transform code written in many programming languages using abstract syntax trees (ASTs). ASTs are data structures that capture the syntactic and semantic structure of source code. With ast-grep, you can write patterns as if you are writing ordinary code, and it will match all code that has the same syntactical structure. And if you need more power, you can... - Source: dev.to / about 1 year ago
Is there an open source library that does this? Maybe something on top of ast-grep. Source: about 1 year ago
Thanks for the pointer. There are definitely a few tools that have explored the idea of searching the AST of code. Semgrep seems to do that, as does a tool called ast-grep [0]. Both of them are sort of doing the opposite of my tool. They are letting you specify your search as a chunk of code/AST. My tool let's you grep a regex as usual, but shows you the matches in a helpful AST aware way. [0]... - Source: Hacker News / about 1 year ago
Hi neovim subreddit! I'm the author of ast-grep, a tool for code structural search, lint, and rewriting based on syntax trees. Source: over 1 year ago
Are you tired of manually searching and modifying code? Do regular expressions and text-based tools fall short when it comes to complex syntax and nested structures? Look no further! In this blog post, I'm excited to introduce you to ast-grep, a powerful command-line tool designed to make structural searching and transforming of code a breeze using abstract syntax trees (ASTs). - Source: dev.to / over 1 year ago
I also use a global config, and my setup is a bit different - I always ignore the local coonfig and use the global config instead - but I recommend it. The project-local linting setup should always run anyway on pre-commit, so you're not loosing anything. This allows me to have a much more extensive linting setup, with more plugins and stricter rules, some which would slow you down on a laptop. I had to jump... Source: over 1 year ago
I'm working on ast-grep, a structural search/replace tool. I got few feedback and pull requests from the community for more language supports like tsx and cpp. Technically, it mainly involves Rust and wasm. Source: over 1 year ago
The new homepage has a list of notable supported languages now! https://ast-grep.github.io/. Source: almost 2 years ago
Hey folks! I'm writing a tool like a hybrid of grep, eslint and codemod, for almost all tree-sitter compatile languages. The front page is https://ast-grep.github.io/. Source: almost 2 years ago
Do you know an article comparing ast-grep to other products?
Suggest a link to a post with product alternatives.
This is an informative page about ast-grep. You can review and discuss the product here. The primary details have not been verified within the last quarter, and they might be outdated. If you think we are missing something, please use the means on this page to comment or suggest changes. All reviews and comments are highly encouranged and appreciated as they help everyone in the community to make an informed choice. Please always be kind and objective when evaluating a product and sharing your opinion.