ast-grep vs Roslynator
ast-grep
ast-grep.github.ioRoslynator
github.comSide by side
| Figure | ast-grep | Roslynator |
|---|---|---|
| Price from | Free | Free |
| Free plan | Yes | Yes |
| Free trial | — | — |
| Open source | — | — |
| Web | Yes | — |
| Windows | Yes | Yes |
| macOS | Yes | Yes |
| Linux | Yes | Yes |
| API | Yes | — |
| Plans published | 1 | 1 |
| Spec score · Code Refactoring Tools | 9.1 (#1) | 7.5 (#15) |
| Purpose | ast-grep is a fast, polyglot tool for structural code search, linting, and rewriting at scale. | Roslynator is a set of code analysis tools for C#, powered by Roslyn. |
Plans
In their own words
ast-grep
ast-grep is a free, open-source tool for structural code search, linting, and rewriting. It matches patterns against syntax-tree nodes, helping developers locate and change code across a codebase rather than searching plain text. Its CLI can preview and apply rewrites interactively, and scan configurable YAML rules with error, warning, info, or hint severity. Rules can combine pattern, kind, regex, relational, and composite conditions, and CLI commands help create and snapshot-test them. The project says it supports more than 20 languages and can load custom languages. JavaScript and WebAssembly APIs allow programmatic syntax-tree work; a browser playground offers a way to try patterns without local installation. Editor options include a VS Code extension and language-server setups, including for Vim and Neovim. The tool is free, has a web interface, and is distributed through package managers or built from source. Its FAQ notes that some advanced static-analysis information is unsupported, and one rule cannot target multiple languages at once.
Roslynator
Roslynator is a set of code analysis tools for C# development environments built on Roslyn. Its IDE extensions offer refactorings and fixes for compiler diagnostics, while analyzers are distributed separately through NuGet packages. Listed editor extensions cover Visual Studio 2026 and 2022, VS Code, and Open VSX. The VS Code extension requires legacy OmniSharp with `dotnet.server.useOmnisharp` set to true and does not work with C# Dev Kit. A command-line tool can be installed with `dotnet tool install -g roslynator.dotnet.cli`; the CLI is also integrated into MegaLinter for CI. EditorConfig settings can configure analyzers, refactorings, and compiler diagnostic fixes, and a testing framework supports unit tests for those tools. The .NET client libraries extend the Roslyn API but do not include analyzers or refactorings. The repository is licensed under Apache License 2.0. Its security policy supports version 5.x, CLI 0.x, and the Visual Studio 2026 and VS Code extensions; versions below 5.0 and Visual Studio 2022 extensions are out of support.