ast-grep-cli 0.27.2__tar.gz → 0.28.0__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.28.0}/Cargo.lock +75 -75
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/Cargo.toml +6 -6
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/PKG-INFO +1 -1
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/cli/src/completions.rs +1 -1
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/cli/src/config.rs +11 -5
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/cli/src/lang/injection.rs +1 -1
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/cli/src/lang/lang_globs.rs +1 -1
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/cli/src/lib.rs +7 -3
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/cli/src/lsp.rs +10 -8
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/cli/src/new.rs +1 -1
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/cli/src/print/interactive_print.rs +1 -1
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/cli/src/run.rs +36 -11
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/cli/src/scan.rs +18 -3
- ast_grep_cli-0.28.0/crates/cli/src/utils/args.rs +237 -0
- ast_grep_cli-0.27.2/crates/cli/src/debug.rs → ast_grep_cli-0.28.0/crates/cli/src/utils/debug_query.rs +94 -8
- ast_grep_cli-0.27.2/crates/cli/src/error.rs → ast_grep_cli-0.28.0/crates/cli/src/utils/error_context.rs +9 -2
- ast_grep_cli-0.28.0/crates/cli/src/utils/mod.rs +226 -0
- ast_grep_cli-0.28.0/crates/cli/src/utils/tracing.rs +184 -0
- ast_grep_cli-0.28.0/crates/cli/src/utils/worker.rs +134 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/cli/src/verify/find_file.rs +1 -1
- ast_grep_cli-0.27.2/crates/cli/src/verify/mod.rs → ast_grep_cli-0.28.0/crates/cli/src/verify.rs +2 -2
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/config/src/rule_collection.rs +6 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/core/src/matcher/pattern.rs +7 -2
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/pyproject.toml +1 -1
- ast_grep_cli-0.27.2/crates/cli/src/utils.rs +0 -502
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/LICENSE +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/README.md +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/cli/Cargo.toml +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/cli/src/bin/ast-grep.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/cli/src/lang/custom_lang.rs +0 -0
- /ast_grep_cli-0.27.2/crates/cli/src/lang.rs → /ast_grep_cli-0.28.0/crates/cli/src/lang/mod.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/cli/src/main.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/cli/src/print/cloud_print.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/cli/src/print/colored_print/test.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/cli/src/print/colored_print.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/cli/src/print/json_print.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/cli/src/print/mod.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/cli/src/verify/case_result.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/cli/src/verify/reporter.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/cli/src/verify/snapshot.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/cli/src/verify/test_case.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/cli/tests/common/mod.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/cli/tests/run_test.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/cli/tests/scan_test.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/cli/tests/verify_test.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/config/Cargo.toml +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/config/src/check_var.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/config/src/combined.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/config/src/fixer.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/config/src/lib.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/config/src/maybe.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/config/src/rule/deserialize_env.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/config/src/rule/mod.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/config/src/rule/nth_child.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/config/src/rule/referent_rule.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/config/src/rule/relational_rule.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/config/src/rule/stop_by.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/config/src/rule_config.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/config/src/rule_core.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/config/src/transform/mod.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/config/src/transform/rewrite.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/config/src/transform/string_case.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/config/src/transform/transformation.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/core/Cargo.toml +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/core/src/language.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/core/src/lib.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/core/src/match_tree/match_node.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/core/src/match_tree/mod.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/core/src/match_tree/strictness.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/core/src/matcher/kind.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/core/src/matcher/node_match.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/core/src/matcher/text.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/core/src/matcher.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/core/src/meta_var.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/core/src/node.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/core/src/ops.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/core/src/pinned.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/core/src/replacer/indent.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/core/src/replacer/structural.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/core/src/replacer/template.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/core/src/replacer.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/core/src/source.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/core/src/traversal.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/dynamic/Cargo.toml +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/dynamic/src/lib.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/language/Cargo.toml +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/language/src/bash.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/language/src/cpp.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/language/src/csharp.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/language/src/css.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/language/src/elixir.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/language/src/go.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/language/src/haskell.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/language/src/html.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/language/src/json.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/language/src/kotlin.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/language/src/lib.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/language/src/lua.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/language/src/parsers.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/language/src/php.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/language/src/python.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/language/src/ruby.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/language/src/rust.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/language/src/scala.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/language/src/swift.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/language/src/yaml.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/lsp/Cargo.toml +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/lsp/src/lib.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/crates/lsp/src/utils.rs +0 -0
- {ast_grep_cli-0.27.2 → ast_grep_cli-0.28.0}/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.
|
|
117
|
+
version = "0.28.0"
|
|
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.
|
|
148
|
+
version = "0.28.0"
|
|
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.
|
|
164
|
+
version = "0.28.0"
|
|
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.
|
|
175
|
+
version = "0.28.0"
|
|
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.
|
|
187
|
+
version = "0.28.0"
|
|
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.
|
|
220
|
+
version = "0.28.0"
|
|
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.
|
|
234
|
+
version = "0.28.0"
|
|
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.
|
|
253
|
+
version = "0.28.0"
|
|
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.
|
|
321
|
+
version = "0.28.0"
|
|
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.19"
|
|
433
433
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
434
|
-
checksum = "
|
|
434
|
+
checksum = "7be5744db7978a28d9df86a214130d106a89ce49644cbc4e3f0c22c3fba30615"
|
|
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.19"
|
|
443
443
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
444
|
-
checksum = "
|
|
444
|
+
checksum = "a5fbc17d3ef8278f55b282b2a2e75ae6f6c7d4bb70ed3d0382375104bfafdb4b"
|
|
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.32"
|
|
455
455
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
456
|
-
checksum = "
|
|
456
|
+
checksum = "74a01f4f9ee6c066d42a1c8dedf0dcddad16c72a8981a309d6398de3a75b0c39"
|
|
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",
|
|
@@ -688,9 +688,9 @@ dependencies = [
|
|
|
688
688
|
|
|
689
689
|
[[package]]
|
|
690
690
|
name = "fastrand"
|
|
691
|
-
version = "2.1.
|
|
691
|
+
version = "2.1.1"
|
|
692
692
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
693
|
-
checksum = "
|
|
693
|
+
checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6"
|
|
694
694
|
|
|
695
695
|
[[package]]
|
|
696
696
|
name = "float-cmp"
|
|
@@ -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",
|
|
@@ -969,9 +969,9 @@ dependencies = [
|
|
|
969
969
|
|
|
970
970
|
[[package]]
|
|
971
971
|
name = "libc"
|
|
972
|
-
version = "0.2.
|
|
972
|
+
version = "0.2.159"
|
|
973
973
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
974
|
-
checksum = "
|
|
974
|
+
checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5"
|
|
975
975
|
|
|
976
976
|
[[package]]
|
|
977
977
|
name = "libloading"
|
|
@@ -980,14 +980,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
980
980
|
checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4"
|
|
981
981
|
dependencies = [
|
|
982
982
|
"cfg-if",
|
|
983
|
-
"windows-targets 0.
|
|
983
|
+
"windows-targets 0.48.5",
|
|
984
984
|
]
|
|
985
985
|
|
|
986
986
|
[[package]]
|
|
987
987
|
name = "linux-raw-sys"
|
|
988
|
-
version = "0.4.
|
|
988
|
+
version = "0.4.14"
|
|
989
989
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
990
|
-
checksum = "
|
|
990
|
+
checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89"
|
|
991
991
|
|
|
992
992
|
[[package]]
|
|
993
993
|
name = "lock_api"
|
|
@@ -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",
|
|
@@ -1430,9 +1430,9 @@ dependencies = [
|
|
|
1430
1430
|
|
|
1431
1431
|
[[package]]
|
|
1432
1432
|
name = "regex"
|
|
1433
|
-
version = "1.
|
|
1433
|
+
version = "1.11.0"
|
|
1434
1434
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1435
|
-
checksum = "
|
|
1435
|
+
checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8"
|
|
1436
1436
|
dependencies = [
|
|
1437
1437
|
"aho-corasick",
|
|
1438
1438
|
"memchr",
|
|
@@ -1442,9 +1442,9 @@ dependencies = [
|
|
|
1442
1442
|
|
|
1443
1443
|
[[package]]
|
|
1444
1444
|
name = "regex-automata"
|
|
1445
|
-
version = "0.4.
|
|
1445
|
+
version = "0.4.8"
|
|
1446
1446
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1447
|
-
checksum = "
|
|
1447
|
+
checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3"
|
|
1448
1448
|
dependencies = [
|
|
1449
1449
|
"aho-corasick",
|
|
1450
1450
|
"memchr",
|
|
@@ -1453,9 +1453,9 @@ dependencies = [
|
|
|
1453
1453
|
|
|
1454
1454
|
[[package]]
|
|
1455
1455
|
name = "regex-syntax"
|
|
1456
|
-
version = "0.8.
|
|
1456
|
+
version = "0.8.5"
|
|
1457
1457
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1458
|
-
checksum = "
|
|
1458
|
+
checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
|
|
1459
1459
|
|
|
1460
1460
|
[[package]]
|
|
1461
1461
|
name = "rustc-demangle"
|
|
@@ -1465,9 +1465,9 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f"
|
|
|
1465
1465
|
|
|
1466
1466
|
[[package]]
|
|
1467
1467
|
name = "rustix"
|
|
1468
|
-
version = "0.38.
|
|
1468
|
+
version = "0.38.37"
|
|
1469
1469
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1470
|
-
checksum = "
|
|
1470
|
+
checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811"
|
|
1471
1471
|
dependencies = [
|
|
1472
1472
|
"bitflags 2.5.0",
|
|
1473
1473
|
"errno",
|
|
@@ -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",
|
|
@@ -1672,9 +1672,9 @@ checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f"
|
|
|
1672
1672
|
|
|
1673
1673
|
[[package]]
|
|
1674
1674
|
name = "tempfile"
|
|
1675
|
-
version = "3.
|
|
1675
|
+
version = "3.13.0"
|
|
1676
1676
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1677
|
-
checksum = "
|
|
1677
|
+
checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b"
|
|
1678
1678
|
dependencies = [
|
|
1679
1679
|
"cfg-if",
|
|
1680
1680
|
"fastrand",
|
|
@@ -1700,18 +1700,18 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76"
|
|
|
1700
1700
|
|
|
1701
1701
|
[[package]]
|
|
1702
1702
|
name = "thiserror"
|
|
1703
|
-
version = "1.0.
|
|
1703
|
+
version = "1.0.64"
|
|
1704
1704
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1705
|
-
checksum = "
|
|
1705
|
+
checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84"
|
|
1706
1706
|
dependencies = [
|
|
1707
1707
|
"thiserror-impl",
|
|
1708
1708
|
]
|
|
1709
1709
|
|
|
1710
1710
|
[[package]]
|
|
1711
1711
|
name = "thiserror-impl"
|
|
1712
|
-
version = "1.0.
|
|
1712
|
+
version = "1.0.64"
|
|
1713
1713
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1714
|
-
checksum = "
|
|
1714
|
+
checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3"
|
|
1715
1715
|
dependencies = [
|
|
1716
1716
|
"proc-macro2",
|
|
1717
1717
|
"quote",
|
|
@@ -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.22"
|
|
1789
1789
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1790
|
-
checksum = "
|
|
1790
|
+
checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5"
|
|
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.
|
|
10
|
+
version = "0.28.0"
|
|
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.
|
|
22
|
-
ast-grep-config = { path = "crates/config", version = "0.
|
|
23
|
-
ast-grep-dynamic = { path = "crates/dynamic", version = "0.
|
|
24
|
-
ast-grep-language = { path = "crates/language", version = "0.
|
|
25
|
-
ast-grep-lsp = { path = "crates/lsp", version = "0.
|
|
21
|
+
ast-grep-core = { path = "crates/core", version = "0.28.0" }
|
|
22
|
+
ast-grep-config = { path = "crates/config", version = "0.28.0" }
|
|
23
|
+
ast-grep-dynamic = { path = "crates/dynamic", version = "0.28.0" }
|
|
24
|
+
ast-grep-language = { path = "crates/language", version = "0.28.0" }
|
|
25
|
+
ast-grep-lsp = { path = "crates/lsp", version = "0.28.0" }
|
|
26
26
|
|
|
27
27
|
bit-set = { version = "0.8.0" }
|
|
28
28
|
ignore = { version = "0.4.22" }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
use crate::error::ErrorContext as EC;
|
|
2
1
|
use crate::lang::{CustomLang, LanguageGlobs, SerializableInjection, SgLang};
|
|
2
|
+
use crate::utils::{ErrorContext as EC, RuleStats};
|
|
3
3
|
|
|
4
4
|
use anyhow::{Context, Result};
|
|
5
5
|
use ast_grep_config::{
|
|
@@ -57,7 +57,7 @@ pub struct AstGrepConfig {
|
|
|
57
57
|
pub fn find_rules(
|
|
58
58
|
config_path: Option<PathBuf>,
|
|
59
59
|
rule_filter: Option<&Regex>,
|
|
60
|
-
) -> Result<RuleCollection<SgLang
|
|
60
|
+
) -> Result<(RuleCollection<SgLang>, RuleStats)> {
|
|
61
61
|
let config_path =
|
|
62
62
|
find_config_path_with_default(config_path, None).context(EC::ReadConfiguration)?;
|
|
63
63
|
let config_str = read_to_string(&config_path).context(EC::ReadConfiguration)?;
|
|
@@ -132,7 +132,7 @@ fn read_directory_yaml(
|
|
|
132
132
|
rule_dirs: Vec<PathBuf>,
|
|
133
133
|
global_rules: GlobalRules<SgLang>,
|
|
134
134
|
rule_filter: Option<&Regex>,
|
|
135
|
-
) -> Result<RuleCollection<SgLang
|
|
135
|
+
) -> Result<(RuleCollection<SgLang>, RuleStats)> {
|
|
136
136
|
let mut configs = vec![];
|
|
137
137
|
for dir in rule_dirs {
|
|
138
138
|
let dir_path = base_dir.join(dir);
|
|
@@ -154,14 +154,20 @@ fn read_directory_yaml(
|
|
|
154
154
|
configs.extend(new_configs);
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
+
let total_rule_count = configs.len();
|
|
157
158
|
|
|
158
159
|
let configs = if let Some(filter) = rule_filter {
|
|
159
160
|
filter_rule_by_regex(configs, filter)?
|
|
160
161
|
} else {
|
|
161
162
|
configs
|
|
162
163
|
};
|
|
163
|
-
|
|
164
|
-
|
|
164
|
+
let collection = RuleCollection::try_new(configs).context(EC::GlobPattern)?;
|
|
165
|
+
let effective_rule_count = collection.total_rule_count();
|
|
166
|
+
let stats = RuleStats {
|
|
167
|
+
effective_rule_count,
|
|
168
|
+
skipped_rule_count: total_rule_count - effective_rule_count,
|
|
169
|
+
};
|
|
170
|
+
Ok((collection, stats))
|
|
165
171
|
}
|
|
166
172
|
|
|
167
173
|
fn filter_rule_by_regex(
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
mod completions;
|
|
2
2
|
mod config;
|
|
3
|
-
mod debug;
|
|
4
|
-
mod error;
|
|
5
3
|
mod lang;
|
|
6
4
|
mod lsp;
|
|
7
5
|
mod new;
|
|
@@ -15,11 +13,11 @@ use anyhow::Result;
|
|
|
15
13
|
use clap::{Parser, Subcommand};
|
|
16
14
|
|
|
17
15
|
use completions::{run_shell_completion, CompletionsArg};
|
|
18
|
-
use error::exit_with_error;
|
|
19
16
|
use lsp::{run_language_server, LspArg};
|
|
20
17
|
use new::{run_create_new, NewArg};
|
|
21
18
|
use run::{register_custom_language_if_is_run, run_with_pattern, RunArg};
|
|
22
19
|
use scan::{run_with_config, ScanArg};
|
|
20
|
+
use utils::exit_with_error;
|
|
23
21
|
use verify::{run_test_rule, TestArg};
|
|
24
22
|
|
|
25
23
|
const LOGO: &str = r#"
|
|
@@ -183,6 +181,9 @@ mod test_cli {
|
|
|
183
181
|
ok("run -p test --selector identifier"); // pattern + selector
|
|
184
182
|
ok("run -p test --selector identifier -l js");
|
|
185
183
|
ok("run -p test --follow");
|
|
184
|
+
ok("run -p test --globs '*.js'");
|
|
185
|
+
ok("run -p test --globs '*.{js, ts}'");
|
|
186
|
+
ok("run -p test --globs '*.js' --globs '*.ts'");
|
|
186
187
|
error("run test");
|
|
187
188
|
error("run --debug-query test"); // missing lang
|
|
188
189
|
error("run -r Test dir");
|
|
@@ -209,6 +210,9 @@ mod test_cli {
|
|
|
209
210
|
ok("scan --interactive");
|
|
210
211
|
ok("scan --follow");
|
|
211
212
|
ok("scan -r test.yml -c test.yml --json dir"); // allow registering custom lang
|
|
213
|
+
ok("scan --globs '*.js'");
|
|
214
|
+
ok("scan --globs '*.{js, ts}'");
|
|
215
|
+
ok("scan --globs '*.js' --globs '*.ts'");
|
|
212
216
|
error("scan -i --json dir"); // conflict
|
|
213
217
|
error("scan --report-style rich --json dir"); // conflict
|
|
214
218
|
error("scan -r test.yml --inline-rules '{}'"); // conflict
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
use crate::config::{find_config_path_with_default, find_rules, register_custom_language};
|
|
2
|
-
use crate::
|
|
2
|
+
use crate::utils::ErrorContext as EC;
|
|
3
3
|
use anyhow::{Context, Result};
|
|
4
4
|
use ast_grep_lsp::{Backend, LspService, Server};
|
|
5
5
|
use clap::Args;
|
|
@@ -25,13 +25,15 @@ async fn run_language_server_impl(arg: LspArg) -> Result<()> {
|
|
|
25
25
|
let stdout = tokio::io::stdout();
|
|
26
26
|
let config_base = find_config_base(arg.config.clone())?;
|
|
27
27
|
let config_result = find_rules(arg.config, None);
|
|
28
|
-
let config_result_std: std::result::Result<_, String> = config_result
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
let config_result_std: std::result::Result<_, String> = config_result
|
|
29
|
+
.map_err(|e| {
|
|
30
|
+
// convert anyhow::Error to String with chain of causes
|
|
31
|
+
e.chain()
|
|
32
|
+
.map(|e| e.to_string())
|
|
33
|
+
.collect::<Vec<_>>()
|
|
34
|
+
.join(". ")
|
|
35
|
+
})
|
|
36
|
+
.map(|r| r.0);
|
|
35
37
|
let (service, socket) =
|
|
36
38
|
LspService::build(|client| Backend::new(client, config_base, config_result_std)).finish();
|
|
37
39
|
Server::new(stdin, stdout, socket).serve(service).await;
|
|
@@ -2,8 +2,8 @@ use crate::config::{
|
|
|
2
2
|
find_config_path_with_default, read_config_from_dir, register_custom_language, AstGrepConfig,
|
|
3
3
|
TestConfig,
|
|
4
4
|
};
|
|
5
|
-
use crate::error::ErrorContext as EC;
|
|
6
5
|
use crate::lang::SgLang;
|
|
6
|
+
use crate::utils::ErrorContext as EC;
|
|
7
7
|
|
|
8
8
|
use anyhow::Result;
|
|
9
9
|
use clap::{Parser, Subcommand};
|