ast-grep-cli 0.36.0__tar.gz → 0.36.2__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.36.0 → ast_grep_cli-0.36.2}/Cargo.lock +54 -73
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/Cargo.toml +6 -6
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/PKG-INFO +1 -1
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/Cargo.toml +1 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/print/colored_print/test.rs +46 -26
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/print/colored_print.rs +31 -15
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/run.rs +37 -25
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/scan.rs +3 -4
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/utils/args.rs +29 -37
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/utils/debug_query.rs +4 -4
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/utils/mod.rs +19 -22
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/utils/worker.rs +2 -5
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/Cargo.toml +1 -1
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/combined.rs +4 -2
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/lib.rs +1 -1
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/rule/deserialize_env.rs +1 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/rule/nth_child.rs +2 -1
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/rule/range.rs +1 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/Cargo.toml +1 -1
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/language.rs +1 -1
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/matcher/kind.rs +1 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/matcher/pattern.rs +1 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/matcher.rs +12 -14
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/node.rs +14 -17
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/ops.rs +1 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/traversal.rs +1 -1
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/Cargo.toml +1 -1
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/lib.rs +1 -1
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/pyproject.toml +1 -1
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/LICENSE +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/README.md +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/README.md +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/bin/alias.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/completions.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/config.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/lang/injection.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/lang/lang_globs.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/lang/mod.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/lib.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/lsp.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/main.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/new.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/print/cloud_print.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/print/colored_print/match_merger.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/print/colored_print/styles.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/print/interactive_print.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/print/json_print.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/print/mod.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/utils/error_context.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/utils/inspect.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/utils/print_diff.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/utils/rule_overwrite.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/verify/case_result.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/verify/find_file.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/verify/reporter.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/verify/snapshot.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/verify/test_case.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/src/verify.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/tests/common/mod.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/tests/run_test.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/tests/scan_test.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/cli/tests/verify_test.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/check_var.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/fixer.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/maybe.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/rule/mod.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/rule/referent_rule.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/rule/relational_rule.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/rule/stop_by.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/rule_collection.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/rule_config.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/rule_core.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/transform/mod.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/transform/rewrite.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/transform/string_case.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/config/src/transform/transformation.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/lib.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/match_tree/match_node.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/match_tree/mod.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/match_tree/strictness.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/matcher/node_match.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/matcher/text.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/meta_var.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/pinned.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/replacer/indent.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/replacer/structural.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/replacer/template.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/replacer.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/core/src/source.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/dynamic/Cargo.toml +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/dynamic/src/custom_lang.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/dynamic/src/lib.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/bash.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/cpp.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/csharp.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/css.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/elixir.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/go.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/haskell.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/html.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/json.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/kotlin.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/lua.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/parsers.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/php.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/python.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/ruby.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/rust.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/scala.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/swift.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/language/src/yaml.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/lsp/Cargo.toml +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/lsp/src/lib.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/crates/lsp/src/utils.rs +0 -0
- {ast_grep_cli-0.36.0 → ast_grep_cli-0.36.2}/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.97"
|
|
96
96
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
97
|
-
checksum = "
|
|
97
|
+
checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f"
|
|
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.36.
|
|
117
|
+
version = "0.36.2"
|
|
118
118
|
dependencies = [
|
|
119
119
|
"ansi_term",
|
|
120
120
|
"anyhow",
|
|
@@ -137,6 +137,7 @@ dependencies = [
|
|
|
137
137
|
"serde_json",
|
|
138
138
|
"serde_yaml",
|
|
139
139
|
"similar",
|
|
140
|
+
"smallvec",
|
|
140
141
|
"tempfile",
|
|
141
142
|
"tokio",
|
|
142
143
|
"tree-sitter-facade-sg",
|
|
@@ -144,7 +145,7 @@ dependencies = [
|
|
|
144
145
|
|
|
145
146
|
[[package]]
|
|
146
147
|
name = "ast-grep-config"
|
|
147
|
-
version = "0.36.
|
|
148
|
+
version = "0.36.2"
|
|
148
149
|
dependencies = [
|
|
149
150
|
"anyhow",
|
|
150
151
|
"ast-grep-core",
|
|
@@ -155,23 +156,23 @@ dependencies = [
|
|
|
155
156
|
"serde",
|
|
156
157
|
"serde_yaml",
|
|
157
158
|
"thiserror",
|
|
158
|
-
"tree-sitter-typescript
|
|
159
|
+
"tree-sitter-typescript",
|
|
159
160
|
]
|
|
160
161
|
|
|
161
162
|
[[package]]
|
|
162
163
|
name = "ast-grep-core"
|
|
163
|
-
version = "0.36.
|
|
164
|
+
version = "0.36.2"
|
|
164
165
|
dependencies = [
|
|
165
166
|
"bit-set",
|
|
166
167
|
"regex",
|
|
167
168
|
"thiserror",
|
|
168
169
|
"tree-sitter-facade-sg",
|
|
169
|
-
"tree-sitter-typescript
|
|
170
|
+
"tree-sitter-typescript",
|
|
170
171
|
]
|
|
171
172
|
|
|
172
173
|
[[package]]
|
|
173
174
|
name = "ast-grep-dynamic"
|
|
174
|
-
version = "0.36.
|
|
175
|
+
version = "0.36.2"
|
|
175
176
|
dependencies = [
|
|
176
177
|
"ast-grep-core",
|
|
177
178
|
"ignore",
|
|
@@ -184,7 +185,7 @@ dependencies = [
|
|
|
184
185
|
|
|
185
186
|
[[package]]
|
|
186
187
|
name = "ast-grep-language"
|
|
187
|
-
version = "0.36.
|
|
188
|
+
version = "0.36.2"
|
|
188
189
|
dependencies = [
|
|
189
190
|
"ast-grep-core",
|
|
190
191
|
"ignore",
|
|
@@ -209,13 +210,13 @@ dependencies = [
|
|
|
209
210
|
"tree-sitter-rust",
|
|
210
211
|
"tree-sitter-scala",
|
|
211
212
|
"tree-sitter-swift",
|
|
212
|
-
"tree-sitter-typescript
|
|
213
|
+
"tree-sitter-typescript",
|
|
213
214
|
"tree-sitter-yaml",
|
|
214
215
|
]
|
|
215
216
|
|
|
216
217
|
[[package]]
|
|
217
218
|
name = "ast-grep-lsp"
|
|
218
|
-
version = "0.36.
|
|
219
|
+
version = "0.36.2"
|
|
219
220
|
dependencies = [
|
|
220
221
|
"ast-grep-config",
|
|
221
222
|
"ast-grep-core",
|
|
@@ -229,7 +230,7 @@ dependencies = [
|
|
|
229
230
|
|
|
230
231
|
[[package]]
|
|
231
232
|
name = "ast-grep-napi"
|
|
232
|
-
version = "0.36.
|
|
233
|
+
version = "0.36.2"
|
|
233
234
|
dependencies = [
|
|
234
235
|
"ast-grep-config",
|
|
235
236
|
"ast-grep-core",
|
|
@@ -245,7 +246,7 @@ dependencies = [
|
|
|
245
246
|
|
|
246
247
|
[[package]]
|
|
247
248
|
name = "ast-grep-py"
|
|
248
|
-
version = "0.36.
|
|
249
|
+
version = "0.36.2"
|
|
249
250
|
dependencies = [
|
|
250
251
|
"anyhow",
|
|
251
252
|
"ast-grep-config",
|
|
@@ -313,7 +314,7 @@ dependencies = [
|
|
|
313
314
|
|
|
314
315
|
[[package]]
|
|
315
316
|
name = "benches"
|
|
316
|
-
version = "0.36.
|
|
317
|
+
version = "0.36.2"
|
|
317
318
|
dependencies = [
|
|
318
319
|
"ast-grep-config",
|
|
319
320
|
"ast-grep-core",
|
|
@@ -427,9 +428,9 @@ dependencies = [
|
|
|
427
428
|
|
|
428
429
|
[[package]]
|
|
429
430
|
name = "clap"
|
|
430
|
-
version = "4.5.
|
|
431
|
+
version = "4.5.32"
|
|
431
432
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
432
|
-
checksum = "
|
|
433
|
+
checksum = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83"
|
|
433
434
|
dependencies = [
|
|
434
435
|
"clap_builder",
|
|
435
436
|
"clap_derive",
|
|
@@ -437,9 +438,9 @@ dependencies = [
|
|
|
437
438
|
|
|
438
439
|
[[package]]
|
|
439
440
|
name = "clap_builder"
|
|
440
|
-
version = "4.5.
|
|
441
|
+
version = "4.5.32"
|
|
441
442
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
442
|
-
checksum = "
|
|
443
|
+
checksum = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8"
|
|
443
444
|
dependencies = [
|
|
444
445
|
"anstream",
|
|
445
446
|
"anstyle",
|
|
@@ -458,9 +459,9 @@ dependencies = [
|
|
|
458
459
|
|
|
459
460
|
[[package]]
|
|
460
461
|
name = "clap_derive"
|
|
461
|
-
version = "4.5.
|
|
462
|
+
version = "4.5.32"
|
|
462
463
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
463
|
-
checksum = "
|
|
464
|
+
checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7"
|
|
464
465
|
dependencies = [
|
|
465
466
|
"heck",
|
|
466
467
|
"proc-macro2",
|
|
@@ -681,7 +682,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
681
682
|
checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d"
|
|
682
683
|
dependencies = [
|
|
683
684
|
"libc",
|
|
684
|
-
"windows-sys 0.
|
|
685
|
+
"windows-sys 0.52.0",
|
|
685
686
|
]
|
|
686
687
|
|
|
687
688
|
[[package]]
|
|
@@ -823,9 +824,9 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
|
|
|
823
824
|
|
|
824
825
|
[[package]]
|
|
825
826
|
name = "globset"
|
|
826
|
-
version = "0.4.
|
|
827
|
+
version = "0.4.16"
|
|
827
828
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
828
|
-
checksum = "
|
|
829
|
+
checksum = "54a1028dfc5f5df5da8a56a73e6c153c9a9708ec57232470703592a3f18e49f5"
|
|
829
830
|
dependencies = [
|
|
830
831
|
"aho-corasick",
|
|
831
832
|
"bstr",
|
|
@@ -1324,9 +1325,9 @@ dependencies = [
|
|
|
1324
1325
|
|
|
1325
1326
|
[[package]]
|
|
1326
1327
|
name = "pyo3"
|
|
1327
|
-
version = "0.23.
|
|
1328
|
+
version = "0.23.5"
|
|
1328
1329
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1329
|
-
checksum = "
|
|
1330
|
+
checksum = "7778bffd85cf38175ac1f545509665d0b9b92a198ca7941f131f85f7a4f9a872"
|
|
1330
1331
|
dependencies = [
|
|
1331
1332
|
"anyhow",
|
|
1332
1333
|
"cfg-if",
|
|
@@ -1343,9 +1344,9 @@ dependencies = [
|
|
|
1343
1344
|
|
|
1344
1345
|
[[package]]
|
|
1345
1346
|
name = "pyo3-build-config"
|
|
1346
|
-
version = "0.23.
|
|
1347
|
+
version = "0.23.5"
|
|
1347
1348
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1348
|
-
checksum = "
|
|
1349
|
+
checksum = "94f6cbe86ef3bf18998d9df6e0f3fc1050a8c5efa409bf712e661a4366e010fb"
|
|
1349
1350
|
dependencies = [
|
|
1350
1351
|
"once_cell",
|
|
1351
1352
|
"target-lexicon",
|
|
@@ -1353,9 +1354,9 @@ dependencies = [
|
|
|
1353
1354
|
|
|
1354
1355
|
[[package]]
|
|
1355
1356
|
name = "pyo3-ffi"
|
|
1356
|
-
version = "0.23.
|
|
1357
|
+
version = "0.23.5"
|
|
1357
1358
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1358
|
-
checksum = "
|
|
1359
|
+
checksum = "e9f1b4c431c0bb1c8fb0a338709859eed0d030ff6daa34368d3b152a63dfdd8d"
|
|
1359
1360
|
dependencies = [
|
|
1360
1361
|
"libc",
|
|
1361
1362
|
"pyo3-build-config",
|
|
@@ -1363,9 +1364,9 @@ dependencies = [
|
|
|
1363
1364
|
|
|
1364
1365
|
[[package]]
|
|
1365
1366
|
name = "pyo3-macros"
|
|
1366
|
-
version = "0.23.
|
|
1367
|
+
version = "0.23.5"
|
|
1367
1368
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1368
|
-
checksum = "
|
|
1369
|
+
checksum = "fbc2201328f63c4710f68abdf653c89d8dbc2858b88c5d88b0ff38a75288a9da"
|
|
1369
1370
|
dependencies = [
|
|
1370
1371
|
"proc-macro2",
|
|
1371
1372
|
"pyo3-macros-backend",
|
|
@@ -1375,9 +1376,9 @@ dependencies = [
|
|
|
1375
1376
|
|
|
1376
1377
|
[[package]]
|
|
1377
1378
|
name = "pyo3-macros-backend"
|
|
1378
|
-
version = "0.23.
|
|
1379
|
+
version = "0.23.5"
|
|
1379
1380
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1380
|
-
checksum = "
|
|
1381
|
+
checksum = "fca6726ad0f3da9c9de093d6f116a93c1a38e417ed73bf138472cf4064f72028"
|
|
1381
1382
|
dependencies = [
|
|
1382
1383
|
"heck",
|
|
1383
1384
|
"proc-macro2",
|
|
@@ -1492,7 +1493,7 @@ dependencies = [
|
|
|
1492
1493
|
"errno",
|
|
1493
1494
|
"libc",
|
|
1494
1495
|
"linux-raw-sys 0.9.2",
|
|
1495
|
-
"windows-sys 0.
|
|
1496
|
+
"windows-sys 0.52.0",
|
|
1496
1497
|
]
|
|
1497
1498
|
|
|
1498
1499
|
[[package]]
|
|
@@ -1512,9 +1513,9 @@ dependencies = [
|
|
|
1512
1513
|
|
|
1513
1514
|
[[package]]
|
|
1514
1515
|
name = "schemars"
|
|
1515
|
-
version = "0.8.
|
|
1516
|
+
version = "0.8.22"
|
|
1516
1517
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1517
|
-
checksum = "
|
|
1518
|
+
checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615"
|
|
1518
1519
|
dependencies = [
|
|
1519
1520
|
"dyn-clone",
|
|
1520
1521
|
"schemars_derive",
|
|
@@ -1524,9 +1525,9 @@ dependencies = [
|
|
|
1524
1525
|
|
|
1525
1526
|
[[package]]
|
|
1526
1527
|
name = "schemars_derive"
|
|
1527
|
-
version = "0.8.
|
|
1528
|
+
version = "0.8.22"
|
|
1528
1529
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1529
|
-
checksum = "
|
|
1530
|
+
checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d"
|
|
1530
1531
|
dependencies = [
|
|
1531
1532
|
"proc-macro2",
|
|
1532
1533
|
"quote",
|
|
@@ -1548,18 +1549,18 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b"
|
|
|
1548
1549
|
|
|
1549
1550
|
[[package]]
|
|
1550
1551
|
name = "serde"
|
|
1551
|
-
version = "1.0.
|
|
1552
|
+
version = "1.0.219"
|
|
1552
1553
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1553
|
-
checksum = "
|
|
1554
|
+
checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
|
|
1554
1555
|
dependencies = [
|
|
1555
1556
|
"serde_derive",
|
|
1556
1557
|
]
|
|
1557
1558
|
|
|
1558
1559
|
[[package]]
|
|
1559
1560
|
name = "serde_derive"
|
|
1560
|
-
version = "1.0.
|
|
1561
|
+
version = "1.0.219"
|
|
1561
1562
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1562
|
-
checksum = "
|
|
1563
|
+
checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
|
|
1563
1564
|
dependencies = [
|
|
1564
1565
|
"proc-macro2",
|
|
1565
1566
|
"quote",
|
|
@@ -1668,9 +1669,9 @@ dependencies = [
|
|
|
1668
1669
|
|
|
1669
1670
|
[[package]]
|
|
1670
1671
|
name = "smallvec"
|
|
1671
|
-
version = "1.
|
|
1672
|
+
version = "1.14.0"
|
|
1672
1673
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1673
|
-
checksum = "
|
|
1674
|
+
checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd"
|
|
1674
1675
|
|
|
1675
1676
|
[[package]]
|
|
1676
1677
|
name = "streaming-iterator"
|
|
@@ -1703,16 +1704,15 @@ checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f"
|
|
|
1703
1704
|
|
|
1704
1705
|
[[package]]
|
|
1705
1706
|
name = "tempfile"
|
|
1706
|
-
version = "3.
|
|
1707
|
+
version = "3.19.0"
|
|
1707
1708
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1708
|
-
checksum = "
|
|
1709
|
+
checksum = "488960f40a3fd53d72c2a29a58722561dee8afdd175bd88e3db4677d7b2ba600"
|
|
1709
1710
|
dependencies = [
|
|
1710
|
-
"cfg-if",
|
|
1711
1711
|
"fastrand",
|
|
1712
1712
|
"getrandom",
|
|
1713
1713
|
"once_cell",
|
|
1714
1714
|
"rustix 1.0.0",
|
|
1715
|
-
"windows-sys 0.
|
|
1715
|
+
"windows-sys 0.52.0",
|
|
1716
1716
|
]
|
|
1717
1717
|
|
|
1718
1718
|
[[package]]
|
|
@@ -1732,18 +1732,18 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76"
|
|
|
1732
1732
|
|
|
1733
1733
|
[[package]]
|
|
1734
1734
|
name = "thiserror"
|
|
1735
|
-
version = "2.0.
|
|
1735
|
+
version = "2.0.12"
|
|
1736
1736
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1737
|
-
checksum = "
|
|
1737
|
+
checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708"
|
|
1738
1738
|
dependencies = [
|
|
1739
1739
|
"thiserror-impl",
|
|
1740
1740
|
]
|
|
1741
1741
|
|
|
1742
1742
|
[[package]]
|
|
1743
1743
|
name = "thiserror-impl"
|
|
1744
|
-
version = "2.0.
|
|
1744
|
+
version = "2.0.12"
|
|
1745
1745
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1746
|
-
checksum = "
|
|
1746
|
+
checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d"
|
|
1747
1747
|
dependencies = [
|
|
1748
1748
|
"proc-macro2",
|
|
1749
1749
|
"quote",
|
|
@@ -1787,9 +1787,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
|
|
|
1787
1787
|
|
|
1788
1788
|
[[package]]
|
|
1789
1789
|
name = "tokio"
|
|
1790
|
-
version = "1.
|
|
1790
|
+
version = "1.44.1"
|
|
1791
1791
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1792
|
-
checksum = "
|
|
1792
|
+
checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a"
|
|
1793
1793
|
dependencies = [
|
|
1794
1794
|
"backtrace",
|
|
1795
1795
|
"bytes",
|
|
@@ -2150,16 +2150,6 @@ dependencies = [
|
|
|
2150
2150
|
"tree-sitter-language",
|
|
2151
2151
|
]
|
|
2152
2152
|
|
|
2153
|
-
[[package]]
|
|
2154
|
-
name = "tree-sitter-typescript"
|
|
2155
|
-
version = "0.21.2"
|
|
2156
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2157
|
-
checksum = "ecb35d98a688378e56c18c9c159824fd16f730ccbea19aacf4f206e5d5438ed9"
|
|
2158
|
-
dependencies = [
|
|
2159
|
-
"cc",
|
|
2160
|
-
"tree-sitter",
|
|
2161
|
-
]
|
|
2162
|
-
|
|
2163
2153
|
[[package]]
|
|
2164
2154
|
name = "tree-sitter-typescript"
|
|
2165
2155
|
version = "0.23.2"
|
|
@@ -2413,15 +2403,6 @@ dependencies = [
|
|
|
2413
2403
|
"windows-targets 0.52.6",
|
|
2414
2404
|
]
|
|
2415
2405
|
|
|
2416
|
-
[[package]]
|
|
2417
|
-
name = "windows-sys"
|
|
2418
|
-
version = "0.59.0"
|
|
2419
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2420
|
-
checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
|
|
2421
|
-
dependencies = [
|
|
2422
|
-
"windows-targets 0.52.6",
|
|
2423
|
-
]
|
|
2424
|
-
|
|
2425
2406
|
[[package]]
|
|
2426
2407
|
name = "windows-targets"
|
|
2427
2408
|
version = "0.48.5"
|
|
@@ -7,7 +7,7 @@ resolver = "2"
|
|
|
7
7
|
lto = true
|
|
8
8
|
|
|
9
9
|
[workspace.package]
|
|
10
|
-
version = "0.36.
|
|
10
|
+
version = "0.36.2"
|
|
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.70"
|
|
|
18
18
|
readme = "README.md"
|
|
19
19
|
|
|
20
20
|
[workspace.dependencies]
|
|
21
|
-
ast-grep-core = { path = "crates/core", version = "0.36.
|
|
22
|
-
ast-grep-config = { path = "crates/config", version = "0.36.
|
|
23
|
-
ast-grep-dynamic = { path = "crates/dynamic", version = "0.36.
|
|
24
|
-
ast-grep-language = { path = "crates/language", version = "0.36.
|
|
25
|
-
ast-grep-lsp = { path = "crates/lsp", version = "0.36.
|
|
21
|
+
ast-grep-core = { path = "crates/core", version = "0.36.2" }
|
|
22
|
+
ast-grep-config = { path = "crates/config", version = "0.36.2" }
|
|
23
|
+
ast-grep-dynamic = { path = "crates/dynamic", version = "0.36.2" }
|
|
24
|
+
ast-grep-language = { path = "crates/language", version = "0.36.2" }
|
|
25
|
+
ast-grep-lsp = { path = "crates/lsp", version = "0.36.2" }
|
|
26
26
|
|
|
27
27
|
bit-set = { version = "0.8.0" }
|
|
28
28
|
ignore = { version = "0.4.22" }
|
|
@@ -46,6 +46,7 @@ serde.workspace = true
|
|
|
46
46
|
serde_json = "1.0.116"
|
|
47
47
|
serde_yaml.workspace = true
|
|
48
48
|
similar = { version = "2.5.0", features = ["inline"] }
|
|
49
|
+
smallvec = "1.13.2"
|
|
49
50
|
tokio = { version = "1.37.0", features = ["rt-multi-thread", "io-std"] }
|
|
50
51
|
clap_complete = "4.5.2"
|
|
51
52
|
|
|
@@ -239,17 +239,13 @@ fn test_non_overlap_print() {
|
|
|
239
239
|
test_non_overlap_print_impl(Heading::Auto);
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
fn get_printed_text(mut printer: ColoredPrinter<Buffer>, diff_case: &DiffCase) -> String {
|
|
243
|
+
let (source, pattern, rewrite, _) = diff_case;
|
|
244
244
|
let globals = GlobalRules::default();
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
let grep = SgLang::from(SupportLang::TypeScript).ast_grep(source);
|
|
250
|
-
let rule = from_yaml_string(
|
|
251
|
-
&format!(
|
|
252
|
-
r"
|
|
245
|
+
let grep = SgLang::from(SupportLang::TypeScript).ast_grep(source);
|
|
246
|
+
let rule = from_yaml_string(
|
|
247
|
+
&format!(
|
|
248
|
+
r"
|
|
253
249
|
id: test-id
|
|
254
250
|
message: test rule
|
|
255
251
|
severity: info
|
|
@@ -257,28 +253,52 @@ language: TypeScript
|
|
|
257
253
|
rule:
|
|
258
254
|
pattern: {pattern}
|
|
259
255
|
fix: '{rewrite}'"
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
256
|
+
),
|
|
257
|
+
&globals,
|
|
258
|
+
)
|
|
259
|
+
.expect("should parse")
|
|
260
|
+
.pop()
|
|
261
|
+
.unwrap();
|
|
262
|
+
let matcher = rule.get_matcher(&globals).expect("should parse");
|
|
263
|
+
let fixer = matcher.fixer.as_ref().expect("should have fixer");
|
|
264
|
+
let matches = grep.root().find_all(&matcher);
|
|
265
|
+
let diffs = matches.map(|n| (Diff::generate(n, &pattern, fixer), &rule));
|
|
266
|
+
let buffer = printer
|
|
267
|
+
.get_processor()
|
|
268
|
+
.print_rule_diffs(diffs.collect(), Path::new("test.tsx"))
|
|
269
|
+
.expect("test only");
|
|
270
|
+
printer.process(buffer).expect("test only");
|
|
271
|
+
get_text(&printer)
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
#[test]
|
|
275
|
+
fn test_print_rule_diffs() {
|
|
276
|
+
for diff_case in DIFF_CASES {
|
|
277
|
+
let printer = make_test_printer()
|
|
278
|
+
.heading(Heading::Never)
|
|
279
|
+
.style(ReportStyle::Rich);
|
|
280
|
+
let text = get_printed_text(printer, diff_case);
|
|
281
|
+
let (_, _, rewrite, note) = diff_case;
|
|
276
282
|
assert!(text.contains("test.tsx"), "{note}");
|
|
277
283
|
assert!(text.contains("note[test-id]"), "{note}");
|
|
278
284
|
assert!(text.contains(rewrite), "{note}");
|
|
279
285
|
}
|
|
280
286
|
}
|
|
281
287
|
|
|
288
|
+
#[test]
|
|
289
|
+
fn test_print_rule_diffs_short() {
|
|
290
|
+
for diff_case in DIFF_CASES {
|
|
291
|
+
let printer = make_test_printer()
|
|
292
|
+
.heading(Heading::Never)
|
|
293
|
+
.style(ReportStyle::Short);
|
|
294
|
+
let text = get_printed_text(printer, diff_case);
|
|
295
|
+
let (_, _, rewrite, note) = diff_case;
|
|
296
|
+
assert!(text.contains("test.tsx:"), "{note}");
|
|
297
|
+
assert!(text.contains("note[test-id]"), "{note}");
|
|
298
|
+
assert!(rewrite.is_empty() || !text.contains(rewrite), "{note}");
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
282
302
|
#[test]
|
|
283
303
|
fn test_before_after() {
|
|
284
304
|
let src = "
|
|
@@ -217,7 +217,7 @@ impl PrintProcessor<Buffer> for ColoredProcessor {
|
|
|
217
217
|
let mut buffer = create_buffer(self.color);
|
|
218
218
|
let writer = &mut buffer;
|
|
219
219
|
let mut start = 0;
|
|
220
|
-
self.
|
|
220
|
+
let display_style = &self.config.display_style;
|
|
221
221
|
for (diff, rule) in diffs {
|
|
222
222
|
let range = &diff.range;
|
|
223
223
|
// skip overlapping diff
|
|
@@ -225,21 +225,37 @@ impl PrintProcessor<Buffer> for ColoredProcessor {
|
|
|
225
225
|
continue;
|
|
226
226
|
}
|
|
227
227
|
start = range.end;
|
|
228
|
+
if matches!(display_style, DisplayStyle::Rich) {
|
|
229
|
+
self.styles.print_prelude(path, writer)?;
|
|
230
|
+
} else {
|
|
231
|
+
let pos = diff.node_match.start_pos();
|
|
232
|
+
write!(
|
|
233
|
+
writer,
|
|
234
|
+
"{}:{}:{}: ",
|
|
235
|
+
path.display(),
|
|
236
|
+
pos.line() + 1,
|
|
237
|
+
pos.column(&diff.node_match) + 1
|
|
238
|
+
)?;
|
|
239
|
+
}
|
|
228
240
|
print_rule_title(rule, &diff.node_match, &self.styles.rule, writer)?;
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
241
|
+
if matches!(display_style, DisplayStyle::Rich) {
|
|
242
|
+
let source = diff.get_root_text();
|
|
243
|
+
let new_str = format!(
|
|
244
|
+
"{}{}{}",
|
|
245
|
+
&source[..range.start],
|
|
246
|
+
diff.replacement,
|
|
247
|
+
&source[start..],
|
|
248
|
+
);
|
|
249
|
+
self
|
|
250
|
+
.styles
|
|
251
|
+
.diff
|
|
252
|
+
.print_diff(source, &new_str, writer, context)?;
|
|
253
|
+
}
|
|
254
|
+
if matches!(display_style, DisplayStyle::Medium | DisplayStyle::Rich) {
|
|
255
|
+
if let Some(note) = &rule.note {
|
|
256
|
+
writeln!(writer, "{}", self.styles.rule.note.paint("Note:"))?;
|
|
257
|
+
writeln!(writer, "{note}")?;
|
|
258
|
+
}
|
|
243
259
|
}
|
|
244
260
|
}
|
|
245
261
|
Ok(buffer)
|