diff options
author | Chetan Khilosiya <[email protected]> | 2021-02-22 19:14:58 +0000 |
---|---|---|
committer | Chetan Khilosiya <[email protected]> | 2021-02-22 19:29:16 +0000 |
commit | eb6cfa7f157690480fca5d55c69dba3fae87ad4f (patch) | |
tree | a49a763fee848041fd607f449ad13a0b1040636e /crates | |
parent | e4756cb4f6e66097638b9d101589358976be2ba8 (diff) |
7526: Renamed create ssr to ide_ssr.
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ide/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/ide/src/lib.rs | 7 | ||||
-rw-r--r-- | crates/ide_ssr/Cargo.toml (renamed from crates/ssr/Cargo.toml) | 2 | ||||
-rw-r--r-- | crates/ide_ssr/src/errors.rs (renamed from crates/ssr/src/errors.rs) | 0 | ||||
-rw-r--r-- | crates/ide_ssr/src/lib.rs (renamed from crates/ssr/src/lib.rs) | 0 | ||||
-rw-r--r-- | crates/ide_ssr/src/matching.rs (renamed from crates/ssr/src/matching.rs) | 0 | ||||
-rw-r--r-- | crates/ide_ssr/src/nester.rs (renamed from crates/ssr/src/nester.rs) | 0 | ||||
-rw-r--r-- | crates/ide_ssr/src/parsing.rs (renamed from crates/ssr/src/parsing.rs) | 0 | ||||
-rw-r--r-- | crates/ide_ssr/src/replacing.rs (renamed from crates/ssr/src/replacing.rs) | 0 | ||||
-rw-r--r-- | crates/ide_ssr/src/resolving.rs (renamed from crates/ssr/src/resolving.rs) | 0 | ||||
-rw-r--r-- | crates/ide_ssr/src/search.rs (renamed from crates/ssr/src/search.rs) | 0 | ||||
-rw-r--r-- | crates/ide_ssr/src/tests.rs (renamed from crates/ssr/src/tests.rs) | 0 | ||||
-rw-r--r-- | crates/rust-analyzer/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/bin/args.rs | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/cli/ssr.rs | 2 |
15 files changed, 9 insertions, 8 deletions
diff --git a/crates/ide/Cargo.toml b/crates/ide/Cargo.toml index b7152c839..f6aaaeda4 100644 --- a/crates/ide/Cargo.toml +++ b/crates/ide/Cargo.toml | |||
@@ -28,7 +28,7 @@ cfg = { path = "../cfg", version = "0.0.0" } | |||
28 | profile = { path = "../profile", version = "0.0.0" } | 28 | profile = { path = "../profile", version = "0.0.0" } |
29 | test_utils = { path = "../test_utils", version = "0.0.0" } | 29 | test_utils = { path = "../test_utils", version = "0.0.0" } |
30 | ide_assists = { path = "../ide_assists", version = "0.0.0" } | 30 | ide_assists = { path = "../ide_assists", version = "0.0.0" } |
31 | ssr = { path = "../ssr", version = "0.0.0" } | 31 | ide_ssr = { path = "../ide_ssr", version = "0.0.0" } |
32 | ide_completion = { path = "../ide_completion", version = "0.0.0" } | 32 | ide_completion = { path = "../ide_completion", version = "0.0.0" } |
33 | 33 | ||
34 | # ide should depend only on the top-level `hir` package. if you need | 34 | # ide should depend only on the top-level `hir` package. if you need |
diff --git a/crates/ide/src/lib.rs b/crates/ide/src/lib.rs index eb26d13b9..b600178ee 100644 --- a/crates/ide/src/lib.rs +++ b/crates/ide/src/lib.rs | |||
@@ -101,7 +101,7 @@ pub use ide_db::{ | |||
101 | symbol_index::Query, | 101 | symbol_index::Query, |
102 | RootDatabase, | 102 | RootDatabase, |
103 | }; | 103 | }; |
104 | pub use ssr::SsrError; | 104 | pub use ide_ssr::SsrError; |
105 | pub use syntax::{TextRange, TextSize}; | 105 | pub use syntax::{TextRange, TextSize}; |
106 | pub use text_edit::{Indel, TextEdit}; | 106 | pub use text_edit::{Indel, TextEdit}; |
107 | 107 | ||
@@ -549,8 +549,9 @@ impl Analysis { | |||
549 | selections: Vec<FileRange>, | 549 | selections: Vec<FileRange>, |
550 | ) -> Cancelable<Result<SourceChange, SsrError>> { | 550 | ) -> Cancelable<Result<SourceChange, SsrError>> { |
551 | self.with_db(|db| { | 551 | self.with_db(|db| { |
552 | let rule: ssr::SsrRule = query.parse()?; | 552 | let rule: ide_ssr::SsrRule = query.parse()?; |
553 | let mut match_finder = ssr::MatchFinder::in_context(db, resolve_context, selections); | 553 | let mut match_finder = |
554 | ide_ssr::MatchFinder::in_context(db, resolve_context, selections); | ||
554 | match_finder.add_rule(rule)?; | 555 | match_finder.add_rule(rule)?; |
555 | let edits = if parse_only { Default::default() } else { match_finder.edits() }; | 556 | let edits = if parse_only { Default::default() } else { match_finder.edits() }; |
556 | Ok(SourceChange::from(edits)) | 557 | Ok(SourceChange::from(edits)) |
diff --git a/crates/ssr/Cargo.toml b/crates/ide_ssr/Cargo.toml index cc8136d22..edbc1846b 100644 --- a/crates/ssr/Cargo.toml +++ b/crates/ide_ssr/Cargo.toml | |||
@@ -1,5 +1,5 @@ | |||
1 | [package] | 1 | [package] |
2 | name = "ssr" | 2 | name = "ide_ssr" |
3 | version = "0.0.0" | 3 | version = "0.0.0" |
4 | description = "Structural search and replace of Rust code" | 4 | description = "Structural search and replace of Rust code" |
5 | license = "MIT OR Apache-2.0" | 5 | license = "MIT OR Apache-2.0" |
diff --git a/crates/ssr/src/errors.rs b/crates/ide_ssr/src/errors.rs index c02bacae6..c02bacae6 100644 --- a/crates/ssr/src/errors.rs +++ b/crates/ide_ssr/src/errors.rs | |||
diff --git a/crates/ssr/src/lib.rs b/crates/ide_ssr/src/lib.rs index a97fc8bca..a97fc8bca 100644 --- a/crates/ssr/src/lib.rs +++ b/crates/ide_ssr/src/lib.rs | |||
diff --git a/crates/ssr/src/matching.rs b/crates/ide_ssr/src/matching.rs index df013bae9..df013bae9 100644 --- a/crates/ssr/src/matching.rs +++ b/crates/ide_ssr/src/matching.rs | |||
diff --git a/crates/ssr/src/nester.rs b/crates/ide_ssr/src/nester.rs index 6ac355dfc..6ac355dfc 100644 --- a/crates/ssr/src/nester.rs +++ b/crates/ide_ssr/src/nester.rs | |||
diff --git a/crates/ssr/src/parsing.rs b/crates/ide_ssr/src/parsing.rs index 3d5e4feb7..3d5e4feb7 100644 --- a/crates/ssr/src/parsing.rs +++ b/crates/ide_ssr/src/parsing.rs | |||
diff --git a/crates/ssr/src/replacing.rs b/crates/ide_ssr/src/replacing.rs index 06a94a46c..06a94a46c 100644 --- a/crates/ssr/src/replacing.rs +++ b/crates/ide_ssr/src/replacing.rs | |||
diff --git a/crates/ssr/src/resolving.rs b/crates/ide_ssr/src/resolving.rs index 14e5a3b69..14e5a3b69 100644 --- a/crates/ssr/src/resolving.rs +++ b/crates/ide_ssr/src/resolving.rs | |||
diff --git a/crates/ssr/src/search.rs b/crates/ide_ssr/src/search.rs index 836eb94b2..836eb94b2 100644 --- a/crates/ssr/src/search.rs +++ b/crates/ide_ssr/src/search.rs | |||
diff --git a/crates/ssr/src/tests.rs b/crates/ide_ssr/src/tests.rs index a3ea44f23..a3ea44f23 100644 --- a/crates/ssr/src/tests.rs +++ b/crates/ide_ssr/src/tests.rs | |||
diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml index 2a5cd59f9..b881cc229 100644 --- a/crates/rust-analyzer/Cargo.toml +++ b/crates/rust-analyzer/Cargo.toml | |||
@@ -53,7 +53,7 @@ cfg = { path = "../cfg", version = "0.0.0" } | |||
53 | toolchain = { path = "../toolchain", version = "0.0.0" } | 53 | toolchain = { path = "../toolchain", version = "0.0.0" } |
54 | 54 | ||
55 | # This should only be used in CLI | 55 | # This should only be used in CLI |
56 | ssr = { path = "../ssr", version = "0.0.0" } | 56 | ide_ssr = { path = "../ide_ssr", version = "0.0.0" } |
57 | hir = { path = "../hir", version = "0.0.0" } | 57 | hir = { path = "../hir", version = "0.0.0" } |
58 | hir_def = { path = "../hir_def", version = "0.0.0" } | 58 | hir_def = { path = "../hir_def", version = "0.0.0" } |
59 | hir_ty = { path = "../hir_ty", version = "0.0.0" } | 59 | hir_ty = { path = "../hir_ty", version = "0.0.0" } |
diff --git a/crates/rust-analyzer/src/bin/args.rs b/crates/rust-analyzer/src/bin/args.rs index 3a7db6a18..164d94a30 100644 --- a/crates/rust-analyzer/src/bin/args.rs +++ b/crates/rust-analyzer/src/bin/args.rs | |||
@@ -6,9 +6,9 @@ | |||
6 | use std::{env, path::PathBuf}; | 6 | use std::{env, path::PathBuf}; |
7 | 7 | ||
8 | use anyhow::{bail, format_err, Result}; | 8 | use anyhow::{bail, format_err, Result}; |
9 | use ide_ssr::{SsrPattern, SsrRule}; | ||
9 | use pico_args::Arguments; | 10 | use pico_args::Arguments; |
10 | use rust_analyzer::cli::{AnalysisStatsCmd, BenchCmd, BenchWhat, Position, Verbosity}; | 11 | use rust_analyzer::cli::{AnalysisStatsCmd, BenchCmd, BenchWhat, Position, Verbosity}; |
11 | use ssr::{SsrPattern, SsrRule}; | ||
12 | use vfs::AbsPathBuf; | 12 | use vfs::AbsPathBuf; |
13 | 13 | ||
14 | pub(crate) struct Args { | 14 | pub(crate) struct Args { |
diff --git a/crates/rust-analyzer/src/cli/ssr.rs b/crates/rust-analyzer/src/cli/ssr.rs index 71c61ed58..71a8f8fb9 100644 --- a/crates/rust-analyzer/src/cli/ssr.rs +++ b/crates/rust-analyzer/src/cli/ssr.rs | |||
@@ -4,7 +4,7 @@ use crate::cli::{ | |||
4 | load_cargo::{load_workspace_at, LoadCargoConfig}, | 4 | load_cargo::{load_workspace_at, LoadCargoConfig}, |
5 | Result, | 5 | Result, |
6 | }; | 6 | }; |
7 | use ssr::{MatchFinder, SsrPattern, SsrRule}; | 7 | use ide_ssr::{MatchFinder, SsrPattern, SsrRule}; |
8 | 8 | ||
9 | pub fn apply_ssr_rules(rules: Vec<SsrRule>) -> Result<()> { | 9 | pub fn apply_ssr_rules(rules: Vec<SsrRule>) -> Result<()> { |
10 | use ide_db::base_db::SourceDatabaseExt; | 10 | use ide_db::base_db::SourceDatabaseExt; |