mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
7526: Renamed create ssr to ide_ssr.
This commit is contained in:
parent
e4756cb4f6
commit
eb6cfa7f15
16 changed files with 25 additions and 24 deletions
|
@ -28,7 +28,7 @@ cfg = { path = "../cfg", version = "0.0.0" }
|
|||
profile = { path = "../profile", version = "0.0.0" }
|
||||
test_utils = { path = "../test_utils", version = "0.0.0" }
|
||||
ide_assists = { path = "../ide_assists", version = "0.0.0" }
|
||||
ssr = { path = "../ssr", version = "0.0.0" }
|
||||
ide_ssr = { path = "../ide_ssr", version = "0.0.0" }
|
||||
ide_completion = { path = "../ide_completion", version = "0.0.0" }
|
||||
|
||||
# ide should depend only on the top-level `hir` package. if you need
|
||||
|
|
|
@ -101,7 +101,7 @@ pub use ide_db::{
|
|||
symbol_index::Query,
|
||||
RootDatabase,
|
||||
};
|
||||
pub use ssr::SsrError;
|
||||
pub use ide_ssr::SsrError;
|
||||
pub use syntax::{TextRange, TextSize};
|
||||
pub use text_edit::{Indel, TextEdit};
|
||||
|
||||
|
@ -549,8 +549,9 @@ impl Analysis {
|
|||
selections: Vec<FileRange>,
|
||||
) -> Cancelable<Result<SourceChange, SsrError>> {
|
||||
self.with_db(|db| {
|
||||
let rule: ssr::SsrRule = query.parse()?;
|
||||
let mut match_finder = ssr::MatchFinder::in_context(db, resolve_context, selections);
|
||||
let rule: ide_ssr::SsrRule = query.parse()?;
|
||||
let mut match_finder =
|
||||
ide_ssr::MatchFinder::in_context(db, resolve_context, selections);
|
||||
match_finder.add_rule(rule)?;
|
||||
let edits = if parse_only { Default::default() } else { match_finder.edits() };
|
||||
Ok(SourceChange::from(edits))
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[package]
|
||||
name = "ssr"
|
||||
name = "ide_ssr"
|
||||
version = "0.0.0"
|
||||
description = "Structural search and replace of Rust code"
|
||||
license = "MIT OR Apache-2.0"
|
|
@ -53,7 +53,7 @@ cfg = { path = "../cfg", version = "0.0.0" }
|
|||
toolchain = { path = "../toolchain", version = "0.0.0" }
|
||||
|
||||
# This should only be used in CLI
|
||||
ssr = { path = "../ssr", version = "0.0.0" }
|
||||
ide_ssr = { path = "../ide_ssr", version = "0.0.0" }
|
||||
hir = { path = "../hir", version = "0.0.0" }
|
||||
hir_def = { path = "../hir_def", version = "0.0.0" }
|
||||
hir_ty = { path = "../hir_ty", version = "0.0.0" }
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
use std::{env, path::PathBuf};
|
||||
|
||||
use anyhow::{bail, format_err, Result};
|
||||
use ide_ssr::{SsrPattern, SsrRule};
|
||||
use pico_args::Arguments;
|
||||
use rust_analyzer::cli::{AnalysisStatsCmd, BenchCmd, BenchWhat, Position, Verbosity};
|
||||
use ssr::{SsrPattern, SsrRule};
|
||||
use vfs::AbsPathBuf;
|
||||
|
||||
pub(crate) struct Args {
|
||||
|
|
|
@ -4,7 +4,7 @@ use crate::cli::{
|
|||
load_cargo::{load_workspace_at, LoadCargoConfig},
|
||||
Result,
|
||||
};
|
||||
use ssr::{MatchFinder, SsrPattern, SsrRule};
|
||||
use ide_ssr::{MatchFinder, SsrPattern, SsrRule};
|
||||
|
||||
pub fn apply_ssr_rules(rules: Vec<SsrRule>) -> Result<()> {
|
||||
use ide_db::base_db::SourceDatabaseExt;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue