You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/blog/migrate-bevy.md
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ Before we start, we need to make sure that we have the following tools installed
45
45
Compared to the other two tools, ast-grep is lesser-known. In short it can do search and replace based on [abstract syntax trees](https://www.wikiwand.com/en/Abstract_syntax_tree). You can install it via [`cargo`](https://crates.io/crates/ast-grep) or [`brew`](https://formulae.brew.sh/formula/ast-grep).
46
46
47
47
```shell
48
-
# install the binary `sg`/`ast-grep`
48
+
# install the binary `ast-grep`
49
49
cargo install ast-grep
50
50
# or use brew
51
51
brew install ast-grep
@@ -149,7 +149,7 @@ So we just need to change the import name. [Using ast-grep is trivial here](http
149
149
We need to provide a pattern, `-p`, for it to search as well as a rewrite string, `-r` to replace the old API with the new one. The command should be quite self-explanatory.
150
150
151
151
```
152
-
sg -p 'CoreStage' -r CoreSet -i
152
+
ast-grep -p 'CoreStage' -r CoreSet -i
153
153
```
154
154
155
155
We suggest to add `-i` flag for `--interactive` editing. ast-grep will display the changed code diff and ask your decision to accept or not.
@@ -183,7 +183,7 @@ The [doc](https://bevyengine.org/learn/migration-guides/0.9-0.10/#label-types):
@@ -231,7 +231,7 @@ meta-variable is a wildcard expression that can match any single AST node. So we
231
231
However, I found some `add_stage_after`s are not replaced. Nah, ast-grep is [quite dumb](https://github.com/ast-grep/ast-grep/issues/374) that it cannot handle the optional comma after the last argument. So I used another query with a trailing comma.
0 commit comments