ast-grep-cli 0.27.2__tar.gz → 0.27.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/Cargo.lock +54 -54
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/Cargo.toml +6 -6
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/PKG-INFO +1 -1
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/src/debug.rs +92 -8
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/src/run.rs +3 -5
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/core/src/matcher/pattern.rs +7 -2
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/pyproject.toml +1 -1
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/LICENSE +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/README.md +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/Cargo.toml +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/src/bin/ast-grep.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/src/completions.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/src/config.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/src/error.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/src/lang/custom_lang.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/src/lang/injection.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/src/lang/lang_globs.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/src/lang.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/src/lib.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/src/lsp.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/src/main.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/src/new.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/src/print/cloud_print.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/src/print/colored_print/test.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/src/print/colored_print.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/src/print/interactive_print.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/src/print/json_print.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/src/print/mod.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/src/scan.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/src/utils.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/src/verify/case_result.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/src/verify/find_file.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/src/verify/mod.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/src/verify/reporter.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/src/verify/snapshot.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/src/verify/test_case.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/tests/common/mod.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/tests/run_test.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/tests/scan_test.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/cli/tests/verify_test.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/config/Cargo.toml +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/config/src/check_var.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/config/src/combined.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/config/src/fixer.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/config/src/lib.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/config/src/maybe.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/config/src/rule/deserialize_env.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/config/src/rule/mod.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/config/src/rule/nth_child.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/config/src/rule/referent_rule.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/config/src/rule/relational_rule.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/config/src/rule/stop_by.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/config/src/rule_collection.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/config/src/rule_config.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/config/src/rule_core.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/config/src/transform/mod.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/config/src/transform/rewrite.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/config/src/transform/string_case.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/config/src/transform/transformation.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/core/Cargo.toml +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/core/src/language.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/core/src/lib.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/core/src/match_tree/match_node.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/core/src/match_tree/mod.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/core/src/match_tree/strictness.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/core/src/matcher/kind.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/core/src/matcher/node_match.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/core/src/matcher/text.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/core/src/matcher.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/core/src/meta_var.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/core/src/node.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/core/src/ops.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/core/src/pinned.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/core/src/replacer/indent.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/core/src/replacer/structural.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/core/src/replacer/template.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/core/src/replacer.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/core/src/source.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/core/src/traversal.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/dynamic/Cargo.toml +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/dynamic/src/lib.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/language/Cargo.toml +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/language/src/bash.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/language/src/cpp.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/language/src/csharp.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/language/src/css.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/language/src/elixir.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/language/src/go.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/language/src/haskell.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/language/src/html.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/language/src/json.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/language/src/kotlin.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/language/src/lib.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/language/src/lua.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/language/src/parsers.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/language/src/php.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/language/src/python.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/language/src/ruby.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/language/src/rust.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/language/src/scala.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/language/src/swift.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/language/src/yaml.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/lsp/Cargo.toml +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/lsp/src/lib.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/lsp/src/utils.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.27.3}/crates/lsp/tests/basic.rs +0 -0
|
@@ -92,9 +92,9 @@ dependencies = [
|
|
|
92
92
|
|
|
93
93
|
[[package]]
|
|
94
94
|
name = "anyhow"
|
|
95
|
-
version = "1.0.
|
|
95
|
+
version = "1.0.89"
|
|
96
96
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
97
|
-
checksum = "
|
|
97
|
+
checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6"
|
|
98
98
|
|
|
99
99
|
[[package]]
|
|
100
100
|
name = "assert_cmd"
|
|
@@ -114,7 +114,7 @@ dependencies = [
|
|
|
114
114
|
|
|
115
115
|
[[package]]
|
|
116
116
|
name = "ast-grep"
|
|
117
|
-
version = "0.27.
|
|
117
|
+
version = "0.27.3"
|
|
118
118
|
dependencies = [
|
|
119
119
|
"ansi_term",
|
|
120
120
|
"anyhow",
|
|
@@ -145,7 +145,7 @@ dependencies = [
|
|
|
145
145
|
|
|
146
146
|
[[package]]
|
|
147
147
|
name = "ast-grep-config"
|
|
148
|
-
version = "0.27.
|
|
148
|
+
version = "0.27.3"
|
|
149
149
|
dependencies = [
|
|
150
150
|
"anyhow",
|
|
151
151
|
"ast-grep-core",
|
|
@@ -161,7 +161,7 @@ dependencies = [
|
|
|
161
161
|
|
|
162
162
|
[[package]]
|
|
163
163
|
name = "ast-grep-core"
|
|
164
|
-
version = "0.27.
|
|
164
|
+
version = "0.27.3"
|
|
165
165
|
dependencies = [
|
|
166
166
|
"bit-set",
|
|
167
167
|
"regex",
|
|
@@ -172,7 +172,7 @@ dependencies = [
|
|
|
172
172
|
|
|
173
173
|
[[package]]
|
|
174
174
|
name = "ast-grep-dynamic"
|
|
175
|
-
version = "0.27.
|
|
175
|
+
version = "0.27.3"
|
|
176
176
|
dependencies = [
|
|
177
177
|
"ast-grep-core",
|
|
178
178
|
"ignore",
|
|
@@ -184,7 +184,7 @@ dependencies = [
|
|
|
184
184
|
|
|
185
185
|
[[package]]
|
|
186
186
|
name = "ast-grep-language"
|
|
187
|
-
version = "0.27.
|
|
187
|
+
version = "0.27.3"
|
|
188
188
|
dependencies = [
|
|
189
189
|
"ast-grep-core",
|
|
190
190
|
"ignore",
|
|
@@ -217,12 +217,12 @@ dependencies = [
|
|
|
217
217
|
|
|
218
218
|
[[package]]
|
|
219
219
|
name = "ast-grep-lsp"
|
|
220
|
-
version = "0.27.
|
|
220
|
+
version = "0.27.3"
|
|
221
221
|
dependencies = [
|
|
222
222
|
"ast-grep-config",
|
|
223
223
|
"ast-grep-core",
|
|
224
224
|
"ast-grep-language",
|
|
225
|
-
"dashmap 6.0
|
|
225
|
+
"dashmap 6.1.0",
|
|
226
226
|
"serde",
|
|
227
227
|
"serde_json",
|
|
228
228
|
"tokio",
|
|
@@ -231,7 +231,7 @@ dependencies = [
|
|
|
231
231
|
|
|
232
232
|
[[package]]
|
|
233
233
|
name = "ast-grep-napi"
|
|
234
|
-
version = "0.27.
|
|
234
|
+
version = "0.27.3"
|
|
235
235
|
dependencies = [
|
|
236
236
|
"ast-grep-config",
|
|
237
237
|
"ast-grep-core",
|
|
@@ -250,7 +250,7 @@ dependencies = [
|
|
|
250
250
|
|
|
251
251
|
[[package]]
|
|
252
252
|
name = "ast-grep-py"
|
|
253
|
-
version = "0.27.
|
|
253
|
+
version = "0.27.3"
|
|
254
254
|
dependencies = [
|
|
255
255
|
"anyhow",
|
|
256
256
|
"ast-grep-config",
|
|
@@ -318,7 +318,7 @@ dependencies = [
|
|
|
318
318
|
|
|
319
319
|
[[package]]
|
|
320
320
|
name = "benches"
|
|
321
|
-
version = "0.27.
|
|
321
|
+
version = "0.27.3"
|
|
322
322
|
dependencies = [
|
|
323
323
|
"ast-grep-config",
|
|
324
324
|
"ast-grep-core",
|
|
@@ -429,9 +429,9 @@ dependencies = [
|
|
|
429
429
|
|
|
430
430
|
[[package]]
|
|
431
431
|
name = "clap"
|
|
432
|
-
version = "4.5.
|
|
432
|
+
version = "4.5.18"
|
|
433
433
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
434
|
-
checksum = "
|
|
434
|
+
checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3"
|
|
435
435
|
dependencies = [
|
|
436
436
|
"clap_builder",
|
|
437
437
|
"clap_derive",
|
|
@@ -439,9 +439,9 @@ dependencies = [
|
|
|
439
439
|
|
|
440
440
|
[[package]]
|
|
441
441
|
name = "clap_builder"
|
|
442
|
-
version = "4.5.
|
|
442
|
+
version = "4.5.18"
|
|
443
443
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
444
|
-
checksum = "
|
|
444
|
+
checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b"
|
|
445
445
|
dependencies = [
|
|
446
446
|
"anstream",
|
|
447
447
|
"anstyle",
|
|
@@ -451,18 +451,18 @@ dependencies = [
|
|
|
451
451
|
|
|
452
452
|
[[package]]
|
|
453
453
|
name = "clap_complete"
|
|
454
|
-
version = "4.5.
|
|
454
|
+
version = "4.5.29"
|
|
455
455
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
456
|
-
checksum = "
|
|
456
|
+
checksum = "8937760c3f4c60871870b8c3ee5f9b30771f792a7045c48bcbba999d7d6b3b8e"
|
|
457
457
|
dependencies = [
|
|
458
458
|
"clap",
|
|
459
459
|
]
|
|
460
460
|
|
|
461
461
|
[[package]]
|
|
462
462
|
name = "clap_derive"
|
|
463
|
-
version = "4.5.
|
|
463
|
+
version = "4.5.18"
|
|
464
464
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
465
|
-
checksum = "
|
|
465
|
+
checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab"
|
|
466
466
|
dependencies = [
|
|
467
467
|
"heck",
|
|
468
468
|
"proc-macro2",
|
|
@@ -634,9 +634,9 @@ dependencies = [
|
|
|
634
634
|
|
|
635
635
|
[[package]]
|
|
636
636
|
name = "dashmap"
|
|
637
|
-
version = "6.0
|
|
637
|
+
version = "6.1.0"
|
|
638
638
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
639
|
-
checksum = "
|
|
639
|
+
checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf"
|
|
640
640
|
dependencies = [
|
|
641
641
|
"cfg-if",
|
|
642
642
|
"crossbeam-utils",
|
|
@@ -813,9 +813,9 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
|
|
|
813
813
|
|
|
814
814
|
[[package]]
|
|
815
815
|
name = "globset"
|
|
816
|
-
version = "0.4.
|
|
816
|
+
version = "0.4.15"
|
|
817
817
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
818
|
-
checksum = "
|
|
818
|
+
checksum = "15f1ce686646e7f1e19bf7d5533fe443a45dbfb990e00629110797578b42fb19"
|
|
819
819
|
dependencies = [
|
|
820
820
|
"aho-corasick",
|
|
821
821
|
"bstr",
|
|
@@ -879,9 +879,9 @@ dependencies = [
|
|
|
879
879
|
|
|
880
880
|
[[package]]
|
|
881
881
|
name = "ignore"
|
|
882
|
-
version = "0.4.
|
|
882
|
+
version = "0.4.23"
|
|
883
883
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
884
|
-
checksum = "
|
|
884
|
+
checksum = "6d89fd380afde86567dfba715db065673989d6253f42b88179abd3eae47bda4b"
|
|
885
885
|
dependencies = [
|
|
886
886
|
"crossbeam-deque",
|
|
887
887
|
"globset",
|
|
@@ -895,9 +895,9 @@ dependencies = [
|
|
|
895
895
|
|
|
896
896
|
[[package]]
|
|
897
897
|
name = "indexmap"
|
|
898
|
-
version = "2.
|
|
898
|
+
version = "2.5.0"
|
|
899
899
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
900
|
-
checksum = "
|
|
900
|
+
checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5"
|
|
901
901
|
dependencies = [
|
|
902
902
|
"equivalent",
|
|
903
903
|
"hashbrown",
|
|
@@ -1069,9 +1069,9 @@ dependencies = [
|
|
|
1069
1069
|
|
|
1070
1070
|
[[package]]
|
|
1071
1071
|
name = "napi"
|
|
1072
|
-
version = "2.16.
|
|
1072
|
+
version = "2.16.11"
|
|
1073
1073
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1074
|
-
checksum = "
|
|
1074
|
+
checksum = "53575dfa17f208dd1ce3a2da2da4659aae393b256a472f2738a8586a6c4107fd"
|
|
1075
1075
|
dependencies = [
|
|
1076
1076
|
"anyhow",
|
|
1077
1077
|
"bitflags 2.5.0",
|
|
@@ -1091,9 +1091,9 @@ checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a"
|
|
|
1091
1091
|
|
|
1092
1092
|
[[package]]
|
|
1093
1093
|
name = "napi-derive"
|
|
1094
|
-
version = "2.16.
|
|
1094
|
+
version = "2.16.12"
|
|
1095
1095
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1096
|
-
checksum = "
|
|
1096
|
+
checksum = "17435f7a00bfdab20b0c27d9c56f58f6499e418252253081bfff448099da31d1"
|
|
1097
1097
|
dependencies = [
|
|
1098
1098
|
"cfg-if",
|
|
1099
1099
|
"convert_case",
|
|
@@ -1105,9 +1105,9 @@ dependencies = [
|
|
|
1105
1105
|
|
|
1106
1106
|
[[package]]
|
|
1107
1107
|
name = "napi-derive-backend"
|
|
1108
|
-
version = "1.0.
|
|
1108
|
+
version = "1.0.74"
|
|
1109
1109
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1110
|
-
checksum = "
|
|
1110
|
+
checksum = "967c485e00f0bf3b1bdbe510a38a4606919cf1d34d9a37ad41f25a81aa077abe"
|
|
1111
1111
|
dependencies = [
|
|
1112
1112
|
"convert_case",
|
|
1113
1113
|
"once_cell",
|
|
@@ -1318,9 +1318,9 @@ dependencies = [
|
|
|
1318
1318
|
|
|
1319
1319
|
[[package]]
|
|
1320
1320
|
name = "pyo3"
|
|
1321
|
-
version = "0.22.
|
|
1321
|
+
version = "0.22.3"
|
|
1322
1322
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1323
|
-
checksum = "
|
|
1323
|
+
checksum = "15ee168e30649f7f234c3d49ef5a7a6cbf5134289bc46c29ff3155fa3221c225"
|
|
1324
1324
|
dependencies = [
|
|
1325
1325
|
"anyhow",
|
|
1326
1326
|
"cfg-if",
|
|
@@ -1337,9 +1337,9 @@ dependencies = [
|
|
|
1337
1337
|
|
|
1338
1338
|
[[package]]
|
|
1339
1339
|
name = "pyo3-build-config"
|
|
1340
|
-
version = "0.22.
|
|
1340
|
+
version = "0.22.3"
|
|
1341
1341
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1342
|
-
checksum = "
|
|
1342
|
+
checksum = "e61cef80755fe9e46bb8a0b8f20752ca7676dcc07a5277d8b7768c6172e529b3"
|
|
1343
1343
|
dependencies = [
|
|
1344
1344
|
"once_cell",
|
|
1345
1345
|
"target-lexicon",
|
|
@@ -1347,9 +1347,9 @@ dependencies = [
|
|
|
1347
1347
|
|
|
1348
1348
|
[[package]]
|
|
1349
1349
|
name = "pyo3-ffi"
|
|
1350
|
-
version = "0.22.
|
|
1350
|
+
version = "0.22.3"
|
|
1351
1351
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1352
|
-
checksum = "
|
|
1352
|
+
checksum = "67ce096073ec5405f5ee2b8b31f03a68e02aa10d5d4f565eca04acc41931fa1c"
|
|
1353
1353
|
dependencies = [
|
|
1354
1354
|
"libc",
|
|
1355
1355
|
"pyo3-build-config",
|
|
@@ -1357,9 +1357,9 @@ dependencies = [
|
|
|
1357
1357
|
|
|
1358
1358
|
[[package]]
|
|
1359
1359
|
name = "pyo3-macros"
|
|
1360
|
-
version = "0.22.
|
|
1360
|
+
version = "0.22.3"
|
|
1361
1361
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1362
|
-
checksum = "
|
|
1362
|
+
checksum = "2440c6d12bc8f3ae39f1e775266fa5122fd0c8891ce7520fa6048e683ad3de28"
|
|
1363
1363
|
dependencies = [
|
|
1364
1364
|
"proc-macro2",
|
|
1365
1365
|
"pyo3-macros-backend",
|
|
@@ -1369,9 +1369,9 @@ dependencies = [
|
|
|
1369
1369
|
|
|
1370
1370
|
[[package]]
|
|
1371
1371
|
name = "pyo3-macros-backend"
|
|
1372
|
-
version = "0.22.
|
|
1372
|
+
version = "0.22.3"
|
|
1373
1373
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1374
|
-
checksum = "
|
|
1374
|
+
checksum = "1be962f0e06da8f8465729ea2cb71a416d2257dff56cbe40a70d3e62a93ae5d1"
|
|
1375
1375
|
dependencies = [
|
|
1376
1376
|
"heck",
|
|
1377
1377
|
"proc-macro2",
|
|
@@ -1529,18 +1529,18 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b"
|
|
|
1529
1529
|
|
|
1530
1530
|
[[package]]
|
|
1531
1531
|
name = "serde"
|
|
1532
|
-
version = "1.0.
|
|
1532
|
+
version = "1.0.210"
|
|
1533
1533
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1534
|
-
checksum = "
|
|
1534
|
+
checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a"
|
|
1535
1535
|
dependencies = [
|
|
1536
1536
|
"serde_derive",
|
|
1537
1537
|
]
|
|
1538
1538
|
|
|
1539
1539
|
[[package]]
|
|
1540
1540
|
name = "serde_derive"
|
|
1541
|
-
version = "1.0.
|
|
1541
|
+
version = "1.0.210"
|
|
1542
1542
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1543
|
-
checksum = "
|
|
1543
|
+
checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f"
|
|
1544
1544
|
dependencies = [
|
|
1545
1545
|
"proc-macro2",
|
|
1546
1546
|
"quote",
|
|
@@ -1560,9 +1560,9 @@ dependencies = [
|
|
|
1560
1560
|
|
|
1561
1561
|
[[package]]
|
|
1562
1562
|
name = "serde_json"
|
|
1563
|
-
version = "1.0.
|
|
1563
|
+
version = "1.0.128"
|
|
1564
1564
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1565
|
-
checksum = "
|
|
1565
|
+
checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8"
|
|
1566
1566
|
dependencies = [
|
|
1567
1567
|
"indexmap",
|
|
1568
1568
|
"itoa",
|
|
@@ -1755,9 +1755,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
|
|
|
1755
1755
|
|
|
1756
1756
|
[[package]]
|
|
1757
1757
|
name = "tokio"
|
|
1758
|
-
version = "1.
|
|
1758
|
+
version = "1.40.0"
|
|
1759
1759
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1760
|
-
checksum = "
|
|
1760
|
+
checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998"
|
|
1761
1761
|
dependencies = [
|
|
1762
1762
|
"backtrace",
|
|
1763
1763
|
"bytes",
|
|
@@ -1785,9 +1785,9 @@ checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41"
|
|
|
1785
1785
|
|
|
1786
1786
|
[[package]]
|
|
1787
1787
|
name = "toml_edit"
|
|
1788
|
-
version = "0.22.
|
|
1788
|
+
version = "0.22.21"
|
|
1789
1789
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1790
|
-
checksum = "
|
|
1790
|
+
checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf"
|
|
1791
1791
|
dependencies = [
|
|
1792
1792
|
"indexmap",
|
|
1793
1793
|
"toml_datetime",
|
|
@@ -7,7 +7,7 @@ resolver = "2"
|
|
|
7
7
|
lto = true
|
|
8
8
|
|
|
9
9
|
[workspace.package]
|
|
10
|
-
version = "0.27.
|
|
10
|
+
version = "0.27.3"
|
|
11
11
|
authors = ["Herrington Darkholme <2883231+HerringtonDarkholme@users.noreply.github.com>"]
|
|
12
12
|
edition = "2021"
|
|
13
13
|
license = "MIT"
|
|
@@ -18,11 +18,11 @@ rust-version = "1.67"
|
|
|
18
18
|
readme = "README.md"
|
|
19
19
|
|
|
20
20
|
[workspace.dependencies]
|
|
21
|
-
ast-grep-core = { path = "crates/core", version = "0.27.
|
|
22
|
-
ast-grep-config = { path = "crates/config", version = "0.27.
|
|
23
|
-
ast-grep-dynamic = { path = "crates/dynamic", version = "0.27.
|
|
24
|
-
ast-grep-language = { path = "crates/language", version = "0.27.
|
|
25
|
-
ast-grep-lsp = { path = "crates/lsp", version = "0.27.
|
|
21
|
+
ast-grep-core = { path = "crates/core", version = "0.27.3" }
|
|
22
|
+
ast-grep-config = { path = "crates/config", version = "0.27.3" }
|
|
23
|
+
ast-grep-dynamic = { path = "crates/dynamic", version = "0.27.3" }
|
|
24
|
+
ast-grep-language = { path = "crates/language", version = "0.27.3" }
|
|
25
|
+
ast-grep-lsp = { path = "crates/lsp", version = "0.27.3" }
|
|
26
26
|
|
|
27
27
|
bit-set = { version = "0.8.0" }
|
|
28
28
|
ignore = { version = "0.4.22" }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
use crate::lang::SgLang;
|
|
2
2
|
use crate::print::ColorArg;
|
|
3
3
|
use ansi_term::Style;
|
|
4
|
-
use ast_grep_core::Pattern;
|
|
4
|
+
use ast_grep_core::{language::TSLanguage, matcher::PatternNode, meta_var::MetaVariable, Pattern};
|
|
5
5
|
use ast_grep_language::Language;
|
|
6
6
|
use clap::ValueEnum;
|
|
7
7
|
use tree_sitter as ts;
|
|
@@ -18,24 +18,28 @@ pub enum DebugFormat {
|
|
|
18
18
|
Sexp,
|
|
19
19
|
}
|
|
20
20
|
impl DebugFormat {
|
|
21
|
-
pub fn debug_query(&self,
|
|
21
|
+
pub fn debug_query(&self, src: &str, pattern: &Pattern<SgLang>, lang: SgLang, color: ColorArg) {
|
|
22
22
|
let colored = color.should_use_color();
|
|
23
23
|
match self {
|
|
24
24
|
DebugFormat::Pattern => {
|
|
25
|
-
let
|
|
26
|
-
|
|
25
|
+
let lang = lang.get_ts_language();
|
|
26
|
+
let mut ret = String::new();
|
|
27
|
+
let fmt = DumpFmt::named(colored);
|
|
28
|
+
dump_pattern(&pattern.node, &lang, &fmt, 0, &mut ret)
|
|
29
|
+
.expect("unexpected error in writing string");
|
|
30
|
+
println!("Debug Pattern:\n{}", ret);
|
|
27
31
|
}
|
|
28
32
|
DebugFormat::Sexp => {
|
|
29
|
-
let root = lang.ast_grep(
|
|
33
|
+
let root = lang.ast_grep(src);
|
|
30
34
|
println!("Debug Sexp:\n{}", root.root().to_sexp());
|
|
31
35
|
}
|
|
32
36
|
DebugFormat::Ast => {
|
|
33
|
-
let root = lang.ast_grep(
|
|
37
|
+
let root = lang.ast_grep(src);
|
|
34
38
|
let dumped = dump_node(root.root().get_ts_node());
|
|
35
39
|
println!("Debug AST:\n{}", dumped.ast(colored));
|
|
36
40
|
}
|
|
37
41
|
DebugFormat::Cst => {
|
|
38
|
-
let root = lang.ast_grep(
|
|
42
|
+
let root = lang.ast_grep(src);
|
|
39
43
|
let dumped = dump_node(root.root().get_ts_node());
|
|
40
44
|
println!("Debug CST:\n{}", dumped.cst(colored));
|
|
41
45
|
}
|
|
@@ -43,6 +47,51 @@ impl DebugFormat {
|
|
|
43
47
|
}
|
|
44
48
|
}
|
|
45
49
|
|
|
50
|
+
fn dump_pattern(
|
|
51
|
+
pattern: &PatternNode,
|
|
52
|
+
lang: &TSLanguage,
|
|
53
|
+
style: &DumpFmt,
|
|
54
|
+
indent: usize,
|
|
55
|
+
ret: &mut String,
|
|
56
|
+
) -> FmtResult {
|
|
57
|
+
write!(ret, "{}", " ".repeat(indent))?;
|
|
58
|
+
match pattern {
|
|
59
|
+
PatternNode::MetaVar { meta_var } => {
|
|
60
|
+
let meta_var = match meta_var {
|
|
61
|
+
MetaVariable::Capture(name, _) => format!("${name}"),
|
|
62
|
+
MetaVariable::MultiCapture(name) => format!("$$${name}"),
|
|
63
|
+
MetaVariable::Multiple => "$$$".to_string(),
|
|
64
|
+
MetaVariable::Dropped(_) => "$_".to_string(),
|
|
65
|
+
};
|
|
66
|
+
let meta_var = style.kind_style.paint(meta_var);
|
|
67
|
+
writeln!(ret, "{} {meta_var}", style.field_style.paint("MetaVar"))?;
|
|
68
|
+
}
|
|
69
|
+
PatternNode::Terminal {
|
|
70
|
+
text,
|
|
71
|
+
kind_id,
|
|
72
|
+
is_named,
|
|
73
|
+
} => {
|
|
74
|
+
let lang = lang.get_ts_language();
|
|
75
|
+
if *is_named {
|
|
76
|
+
let kind = lang.node_kind_for_id(*kind_id).unwrap();
|
|
77
|
+
let kind = style.kind_style.paint(format!("{kind}"));
|
|
78
|
+
writeln!(ret, "{kind} {text}")?;
|
|
79
|
+
} else {
|
|
80
|
+
writeln!(ret, "{text}")?;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
PatternNode::Internal { kind_id, children } => {
|
|
84
|
+
let kind = lang.node_kind_for_id(*kind_id).unwrap();
|
|
85
|
+
let kind = style.kind_style.paint(kind);
|
|
86
|
+
writeln!(ret, "{kind}")?;
|
|
87
|
+
for child in children {
|
|
88
|
+
dump_pattern(child, lang, style, indent + 1, ret)?;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
Ok(())
|
|
93
|
+
}
|
|
94
|
+
|
|
46
95
|
pub struct DumpNode {
|
|
47
96
|
field: Option<String>,
|
|
48
97
|
kind: String,
|
|
@@ -77,7 +126,6 @@ impl DumpFmt {
|
|
|
77
126
|
}
|
|
78
127
|
}
|
|
79
128
|
|
|
80
|
-
// TODO: add colorized output
|
|
81
129
|
use std::fmt::{Result as FmtResult, Write};
|
|
82
130
|
impl DumpNode {
|
|
83
131
|
pub fn ast(&self, colored: bool) -> String {
|
|
@@ -178,3 +226,39 @@ fn dump_nodes(cursor: &mut ts::TreeCursor, target: &mut Vec<DumpNode>) {
|
|
|
178
226
|
}
|
|
179
227
|
}
|
|
180
228
|
}
|
|
229
|
+
|
|
230
|
+
#[cfg(test)]
|
|
231
|
+
mod test {
|
|
232
|
+
use super::*;
|
|
233
|
+
use ast_grep_language::{TypeScript, C};
|
|
234
|
+
const DUMPED: &str = r#"
|
|
235
|
+
program (0,0)-(0,11)
|
|
236
|
+
variable_declaration (0,0)-(0,11)
|
|
237
|
+
variable_declarator (0,4)-(0,11)
|
|
238
|
+
name: identifier (0,4)-(0,5)
|
|
239
|
+
value: number (0,8)-(0,11)"#;
|
|
240
|
+
#[test]
|
|
241
|
+
fn test_dump_node() {
|
|
242
|
+
let lang = SgLang::Builtin(TypeScript.into());
|
|
243
|
+
let root = lang.ast_grep("var a = 123");
|
|
244
|
+
let dumped = dump_node(root.root().get_ts_node());
|
|
245
|
+
assert_eq!(DUMPED.trim(), dumped.ast(false).trim());
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
const MISSING: &str = r#"
|
|
249
|
+
translation_unit (0,0)-(0,9)
|
|
250
|
+
declaration (0,0)-(0,9)
|
|
251
|
+
type: primitive_type (0,0)-(0,3)
|
|
252
|
+
declarator: init_declarator (0,4)-(0,9)
|
|
253
|
+
declarator: identifier (0,4)-(0,5)
|
|
254
|
+
= (0,6)-(0,7)
|
|
255
|
+
value: number_literal (0,8)-(0,9)
|
|
256
|
+
MISSING ; (0,9)-(0,9)"#;
|
|
257
|
+
#[test]
|
|
258
|
+
fn test_missing_node() {
|
|
259
|
+
let lang = SgLang::Builtin(C.into());
|
|
260
|
+
let root = lang.ast_grep("int a = 1");
|
|
261
|
+
let dumped = dump_node(root.root().get_ts_node());
|
|
262
|
+
assert_eq!(MISSING.trim(), dumped.cst(false).trim());
|
|
263
|
+
}
|
|
264
|
+
}
|
|
@@ -264,6 +264,9 @@ impl<Printer> RunWithSpecificLang<Printer> {
|
|
|
264
264
|
fn new(arg: RunArg, printer: Printer) -> Result<Self> {
|
|
265
265
|
let lang = arg.lang.ok_or(anyhow::anyhow!(EC::LanguageNotSpecified))?;
|
|
266
266
|
let pattern = arg.build_pattern(lang)?;
|
|
267
|
+
if let Some(format) = arg.debug_query {
|
|
268
|
+
format.debug_query(&arg.pattern, &pattern, lang, arg.output.color);
|
|
269
|
+
}
|
|
267
270
|
let rewrite = if let Some(s) = &arg.rewrite {
|
|
268
271
|
Some(Fixer::from_str(s, &lang).context(EC::ParsePattern)?)
|
|
269
272
|
} else {
|
|
@@ -284,11 +287,6 @@ impl<P: Printer> Worker for RunWithSpecificLang<P> {
|
|
|
284
287
|
fn consume_items(&self, items: Items<Self::Item>) -> Result<()> {
|
|
285
288
|
let printer = &self.printer;
|
|
286
289
|
printer.before_print()?;
|
|
287
|
-
let arg = &self.arg;
|
|
288
|
-
let lang = arg.lang.expect("must present");
|
|
289
|
-
if let Some(format) = arg.debug_query {
|
|
290
|
-
format.debug_query(&self.arg.pattern, lang, self.arg.output.color);
|
|
291
|
-
}
|
|
292
290
|
let mut has_matches = false;
|
|
293
291
|
for match_unit in items {
|
|
294
292
|
match_one_file(printer, &match_unit, &self.rewrite)?;
|
|
@@ -260,6 +260,11 @@ impl<L: Language> Matcher<L> for Pattern<L> {
|
|
|
260
260
|
node: Node<'tree, D>,
|
|
261
261
|
env: &mut Cow<MetaVarEnv<'tree, D>>,
|
|
262
262
|
) -> Option<Node<'tree, D>> {
|
|
263
|
+
if let Some(k) = self.root_kind {
|
|
264
|
+
if node.kind_id() != k {
|
|
265
|
+
return None;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
263
268
|
// do not pollute the env if pattern does not match
|
|
264
269
|
let mut may_write = Cow::Borrowed(env.as_ref());
|
|
265
270
|
let node = match_node_non_recursive(self, node, &mut may_write)?;
|
|
@@ -523,8 +528,8 @@ mod test {
|
|
|
523
528
|
fn test_bare_wildcard_in_context() {
|
|
524
529
|
let pattern = Pattern::contextual("class A { $F }", "property_identifier", Tsx).expect("test");
|
|
525
530
|
let cand = pattern_node("let b = 123");
|
|
526
|
-
// should
|
|
527
|
-
assert!(pattern.find_node(cand.root()).
|
|
531
|
+
// it should not match
|
|
532
|
+
assert!(pattern.find_node(cand.root()).is_none());
|
|
528
533
|
}
|
|
529
534
|
|
|
530
535
|
#[test]
|
|
@@ -4,7 +4,7 @@ build-backend = "maturin"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "ast-grep-cli"
|
|
7
|
-
version = "0.27.
|
|
7
|
+
version = "0.27.3"
|
|
8
8
|
description = "Structural Search and Rewrite code at large scale using precise AST pattern."
|
|
9
9
|
authors = [{ name = "Herrington Darkholme", email = "2883231+HerringtonDarkholme@users.noreply.github.com" }]
|
|
10
10
|
maintainers = [{ name = "Herrington Darkholme", email = "2883231+HerringtonDarkholme@users.noreply.github.com" }]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|