Rename ra_ide_db -> ide_db

This commit is contained in:
Aleksey Kladov 2020-08-13 16:39:16 +02:00
parent ae71a631fd
commit bb5c189b7d
59 changed files with 93 additions and 99 deletions

46
Cargo.lock generated
View file

@ -562,6 +562,25 @@ dependencies = [
"winapi 0.3.9",
]
[[package]]
name = "ide_db"
version = "0.0.0"
dependencies = [
"base_db",
"either",
"fst",
"hir",
"log",
"once_cell",
"profile",
"rayon",
"rustc-hash",
"stdx",
"syntax",
"test_utils",
"text_edit",
]
[[package]]
name = "idna"
version = "0.2.0"
@ -1090,9 +1109,9 @@ dependencies = [
"base_db",
"either",
"hir",
"ide_db",
"itertools",
"profile",
"ra_ide_db",
"rustc-hash",
"stdx",
"syntax",
@ -1109,13 +1128,13 @@ dependencies = [
"either",
"expect",
"hir",
"ide_db",
"indexmap",
"itertools",
"log",
"oorandom",
"profile",
"ra_assists",
"ra_ide_db",
"ra_ssr",
"rustc-hash",
"stdx",
@ -1124,25 +1143,6 @@ dependencies = [
"text_edit",
]
[[package]]
name = "ra_ide_db"
version = "0.1.0"
dependencies = [
"base_db",
"either",
"fst",
"hir",
"log",
"once_cell",
"profile",
"rayon",
"rustc-hash",
"stdx",
"syntax",
"test_utils",
"text_edit",
]
[[package]]
name = "ra_ssr"
version = "0.1.0"
@ -1150,7 +1150,7 @@ dependencies = [
"base_db",
"expect",
"hir",
"ra_ide_db",
"ide_db",
"rustc-hash",
"syntax",
"test_utils",
@ -1239,6 +1239,7 @@ dependencies = [
"hir",
"hir_def",
"hir_ty",
"ide_db",
"itertools",
"jod-thread",
"log",
@ -1253,7 +1254,6 @@ dependencies = [
"profile",
"project_model",
"ra_ide",
"ra_ide_db",
"ra_ssr",
"rayon",
"rustc-hash",

View file

@ -1,9 +1,9 @@
[package]
edition = "2018"
name = "ra_ide_db"
version = "0.1.0"
authors = ["rust-analyzer developers"]
name = "ide_db"
version = "0.0.0"
license = "MIT OR Apache-2.0"
authors = ["rust-analyzer developers"]
edition = "2018"
[lib]
doctest = false
@ -20,13 +20,11 @@ once_cell = "1.3.1"
either = "1.5.3"
stdx = { path = "../stdx" }
syntax = { path = "../syntax" }
text_edit = { path = "../text_edit" }
base_db = { path = "../base_db" }
profile = { path = "../profile" }
test_utils = { path = "../test_utils" }
# ra_ide should depend only on the top-level `hir` package. if you need
# something from some `hir_xxx` subpackage, reexport the API via `hir`.
hir = { path = "../hir" }

View file

@ -19,6 +19,6 @@ syntax = { path = "../syntax" }
text_edit = { path = "../text_edit" }
profile = { path = "../profile" }
base_db = { path = "../base_db" }
ra_ide_db = { path = "../ra_ide_db" }
ide_db = { path = "../ide_db" }
hir = { path = "../hir" }
test_utils = { path = "../test_utils" }

View file

@ -5,7 +5,7 @@ use std::mem;
use algo::find_covering_element;
use base_db::{FileId, FileRange};
use hir::Semantics;
use ra_ide_db::{
use ide_db::{
source_change::{SourceChange, SourceFileEdit},
RootDatabase,
};

View file

@ -1,4 +1,4 @@
use ra_ide_db::defs::{classify_name_ref, Definition, NameRefClass};
use ide_db::defs::{classify_name_ref, Definition, NameRefClass};
use syntax::{ast, AstNode, SyntaxKind, T};
use test_utils::mark;

View file

@ -5,7 +5,7 @@ use hir::{
AsAssocItem, AssocItemContainer, ModPath, Module, ModuleDef, PathResolution, Semantics, Trait,
Type,
};
use ra_ide_db::{imports_locator, RootDatabase};
use ide_db::{imports_locator, RootDatabase};
use rustc_hash::FxHashSet;
use syntax::{
ast::{self, AstNode},

View file

@ -1,5 +1,5 @@
use hir::{AssocItem, MacroDef, ModuleDef, Name, PathResolution, ScopeDef, SemanticsScope};
use ra_ide_db::{
use ide_db::{
defs::{classify_name_ref, Definition, NameRefClass},
RootDatabase,
};

View file

@ -1,6 +1,6 @@
use base_db::FileId;
use hir::{EnumVariant, Module, ModuleDef, Name};
use ra_ide_db::{defs::Definition, search::Reference, RootDatabase};
use ide_db::{defs::Definition, search::Reference, RootDatabase};
use rustc_hash::FxHashSet;
use syntax::{
algo::find_node_at_offset,

View file

@ -1,8 +1,8 @@
use std::iter;
use hir::{Adt, HasSource, ModuleDef, Semantics};
use ide_db::RootDatabase;
use itertools::Itertools;
use ra_ide_db::RootDatabase;
use syntax::ast::{self, make, AstNode, MatchArm, NameOwner, Pat};
use test_utils::mark;

View file

@ -1,4 +1,4 @@
use ra_ide_db::RootDatabase;
use ide_db::RootDatabase;
use syntax::ast::{self, AstNode, NameOwner};
use test_utils::mark;

View file

@ -1,4 +1,4 @@
use ra_ide_db::defs::Definition;
use ide_db::defs::Definition;
use syntax::{
ast::{self, AstNode, AstToken},
TextRange,

View file

@ -2,7 +2,7 @@ use itertools::Itertools;
use rustc_hash::FxHashMap;
use hir::{Adt, ModuleDef, PathResolution, Semantics, Struct};
use ra_ide_db::RootDatabase;
use ide_db::RootDatabase;
use syntax::{algo, ast, match_ast, AstNode, SyntaxKind, SyntaxKind::*, SyntaxNode};
use crate::{AssistContext, AssistId, AssistKind, Assists};

View file

@ -19,7 +19,7 @@ pub mod ast_transform;
use base_db::FileRange;
use hir::Semantics;
use ra_ide_db::{source_change::SourceChange, RootDatabase};
use ide_db::{source_change::SourceChange, RootDatabase};
use syntax::TextRange;
pub(crate) use crate::assist_context::{AssistContext, Assists};

View file

@ -2,7 +2,7 @@ mod generated;
use base_db::{fixture::WithFixture, FileId, FileRange, SourceDatabaseExt};
use hir::Semantics;
use ra_ide_db::RootDatabase;
use ide_db::RootDatabase;
use syntax::TextRange;
use test_utils::{assert_eq_text, extract_offset, extract_range};

View file

@ -4,8 +4,8 @@ pub(crate) mod insert_use;
use std::{iter, ops};
use hir::{Adt, Crate, Enum, ScopeDef, Semantics, Trait, Type};
use ide_db::RootDatabase;
use itertools::Itertools;
use ra_ide_db::RootDatabase;
use rustc_hash::FxHashSet;
use syntax::{
ast::{self, make, NameOwner},

View file

@ -24,7 +24,7 @@ stdx = { path = "../stdx" }
syntax = { path = "../syntax" }
text_edit = { path = "../text_edit" }
base_db = { path = "../base_db" }
ra_ide_db = { path = "../ra_ide_db" }
ide_db = { path = "../ide_db" }
cfg = { path = "../cfg" }
profile = { path = "../profile" }
test_utils = { path = "../test_utils" }

View file

@ -3,7 +3,7 @@
use indexmap::IndexMap;
use hir::Semantics;
use ra_ide_db::RootDatabase;
use ide_db::RootDatabase;
use syntax::{ast, match_ast, AstNode, TextRange};
use crate::{

View file

@ -1,7 +1,7 @@
//! FIXME: write short doc here
use either::Either;
use hir::{Docs, HirDisplay, Semantics, Type};
use ra_ide_db::RootDatabase;
use ide_db::RootDatabase;
use stdx::format_to;
use syntax::{
ast::{self, ArgListOwner},

View file

@ -19,7 +19,7 @@ mod complete_postfix;
mod complete_macro_in_item_position;
mod complete_trait_impl;
use ra_ide_db::RootDatabase;
use ide_db::RootDatabase;
use crate::{
completion::{

View file

@ -2,7 +2,7 @@
use base_db::SourceDatabase;
use hir::{Semantics, SemanticsScope, Type};
use ra_ide_db::RootDatabase;
use ide_db::RootDatabase;
use syntax::{
algo::{find_covering_element, find_node_at_offset},
ast, match_ast, AstNode, NodeOrToken,

View file

@ -8,8 +8,8 @@ use std::cell::RefCell;
use base_db::SourceDatabase;
use hir::{diagnostics::DiagnosticSinkBuilder, Semantics};
use ide_db::RootDatabase;
use itertools::Itertools;
use ra_ide_db::RootDatabase;
use syntax::{
ast::{self, AstNode},
SyntaxNode, TextRange, T,

View file

@ -8,7 +8,7 @@ use hir::{
diagnostics::{Diagnostic, MissingFields, MissingOkInTailExpr, NoSuchField, UnresolvedModule},
HasSource, HirDisplay, Semantics, VariantDef,
};
use ra_ide_db::{
use ide_db::{
source_change::{FileSystemEdit, SourceFileEdit},
RootDatabase,
};

View file

@ -3,7 +3,7 @@
use base_db::{FileId, SourceDatabase};
use either::Either;
use hir::{original_range, AssocItem, FieldSource, HasSource, InFile, ModuleSource};
use ra_ide_db::{defs::Definition, RootDatabase};
use ide_db::{defs::Definition, RootDatabase};
use syntax::{
ast::{self, DocCommentsOwner, NameOwner},
match_ast, AstNode, SmolStr,

View file

@ -1,5 +1,5 @@
use hir::Semantics;
use ra_ide_db::RootDatabase;
use ide_db::RootDatabase;
use syntax::{
algo::{find_node_at_offset, SyntaxRewriter},
ast, AstNode, NodeOrToken, SyntaxKind,

View file

@ -1,7 +1,7 @@
use std::iter::successors;
use hir::Semantics;
use ra_ide_db::RootDatabase;
use ide_db::RootDatabase;
use syntax::{
algo::{self, find_covering_element, skip_trivia_token},
ast::{self, AstNode, AstToken},

View file

@ -1,5 +1,5 @@
use hir::Semantics;
use ra_ide_db::{
use ide_db::{
defs::{classify_name, classify_name_ref},
symbol_index, RootDatabase,
};

View file

@ -1,5 +1,5 @@
use hir::{Crate, ImplDef, Semantics};
use ra_ide_db::RootDatabase;
use ide_db::RootDatabase;
use syntax::{algo::find_node_at_offset, ast, AstNode};
use crate::{display::ToNav, FilePosition, NavigationTarget, RangeInfo};

View file

@ -1,4 +1,4 @@
use ra_ide_db::RootDatabase;
use ide_db::RootDatabase;
use syntax::{ast, match_ast, AstNode, SyntaxKind::*, SyntaxToken, TokenAtOffset, T};
use crate::{display::ToNav, FilePosition, NavigationTarget, RangeInfo};

View file

@ -3,11 +3,11 @@ use hir::{
Adt, AsAssocItem, AssocItemContainer, Documentation, FieldSource, HasSource, HirDisplay,
Module, ModuleDef, ModuleSource, Semantics,
};
use itertools::Itertools;
use ra_ide_db::{
use ide_db::{
defs::{classify_name, classify_name_ref, Definition},
RootDatabase,
};
use itertools::Itertools;
use stdx::format_to;
use syntax::{ast, match_ast, AstNode, SyntaxKind::*, SyntaxToken, TokenAtOffset, T};
use test_utils::mark;

View file

@ -1,5 +1,5 @@
use hir::{Adt, Callable, HirDisplay, Semantics, Type};
use ra_ide_db::RootDatabase;
use ide_db::RootDatabase;
use stdx::to_lower_snake_case;
use syntax::{
ast::{self, ArgListOwner, AstNode},

View file

@ -52,7 +52,7 @@ use base_db::{
CheckCanceled, Env, FileLoader, FileSet, SourceDatabase, VfsPath,
};
use cfg::CfgOptions;
use ra_ide_db::{
use ide_db::{
symbol_index::{self, FileSymbol},
LineIndexDatabase,
};
@ -86,8 +86,7 @@ pub use base_db::{
SourceRootId,
};
pub use hir::{Documentation, Semantics};
pub use ra_assists::{Assist, AssistConfig, AssistId, AssistKind, ResolvedAssist};
pub use ra_ide_db::{
pub use ide_db::{
change::AnalysisChange,
line_index::{LineCol, LineIndex},
search::SearchScope,
@ -95,6 +94,7 @@ pub use ra_ide_db::{
symbol_index::Query,
RootDatabase,
};
pub use ra_assists::{Assist, AssistConfig, AssistId, AssistKind, ResolvedAssist};
pub use ra_ssr::SsrError;
pub use text_edit::{Indel, TextEdit};

View file

@ -1,6 +1,6 @@
use base_db::{CrateId, FileId, FilePosition};
use hir::Semantics;
use ra_ide_db::RootDatabase;
use ide_db::RootDatabase;
use syntax::{
algo::find_node_at_offset,
ast::{self, AstNode},

View file

@ -12,7 +12,7 @@
mod rename;
use hir::Semantics;
use ra_ide_db::{
use ide_db::{
defs::{classify_name, classify_name_ref, Definition},
search::SearchScope,
RootDatabase,
@ -27,7 +27,7 @@ use crate::{display::TryToNav, FilePosition, FileRange, NavigationTarget, RangeI
pub(crate) use self::rename::rename;
pub use ra_ide_db::search::{Reference, ReferenceAccess, ReferenceKind};
pub use ide_db::search::{Reference, ReferenceAccess, ReferenceKind};
#[derive(Debug, Clone)]
pub struct ReferenceSearchResult {

View file

@ -2,7 +2,7 @@
use base_db::SourceDatabaseExt;
use hir::{Module, ModuleDef, ModuleSource, Semantics};
use ra_ide_db::{
use ide_db::{
defs::{classify_name, classify_name_ref, Definition, NameClass, NameRefClass},
RootDatabase,
};

View file

@ -2,8 +2,8 @@ use std::fmt;
use cfg::CfgExpr;
use hir::{AsAssocItem, Attrs, HirFileId, InFile, Semantics};
use ide_db::RootDatabase;
use itertools::Itertools;
use ra_ide_db::RootDatabase;
use syntax::{
ast::{self, AstNode, AttrsOwner, DocCommentsOwner, ModuleItemOwner, NameOwner},
match_ast, SyntaxNode,

View file

@ -1,5 +1,5 @@
use base_db::{FilePosition, FileRange};
use ra_ide_db::RootDatabase;
use ide_db::RootDatabase;
use crate::SourceFileEdit;
use ra_ssr::{MatchFinder, SsrError, SsrRule};

View file

@ -5,11 +5,11 @@ use base_db::{
FileTextQuery, SourceRootId,
};
use hir::MacroFile;
use profile::{memory_usage, Bytes};
use ra_ide_db::{
use ide_db::{
symbol_index::{LibrarySymbolsQuery, SymbolIndex},
RootDatabase,
};
use profile::{memory_usage, Bytes};
use rustc_hash::FxHashMap;
use syntax::{ast, Parse, SyntaxNode};

View file

@ -5,7 +5,7 @@ mod injection;
mod tests;
use hir::{Name, Semantics, VariantDef};
use ra_ide_db::{
use ide_db::{
defs::{classify_name, classify_name_ref, Definition, NameClass, NameRefClass},
RootDatabase,
};

View file

@ -1,5 +1,5 @@
use base_db::{FileId, SourceDatabase};
use ra_ide_db::RootDatabase;
use ide_db::RootDatabase;
use syntax::{
algo, AstNode, NodeOrToken, SourceFile,
SyntaxKind::{RAW_STRING, STRING},

View file

@ -16,7 +16,7 @@
mod on_enter;
use base_db::{FilePosition, SourceDatabase};
use ra_ide_db::{source_change::SourceFileEdit, RootDatabase};
use ide_db::{source_change::SourceFileEdit, RootDatabase};
use syntax::{
algo::find_node_at_offset,
ast::{self, edit::IndentLevel, AstToken},

View file

@ -2,7 +2,7 @@
//! comments, but should handle indent some time in the future as well.
use base_db::{FilePosition, SourceDatabase};
use ra_ide_db::RootDatabase;
use ide_db::RootDatabase;
use syntax::{
ast::{self, AstToken},
AstNode, SmolStr, SourceFile,

View file

@ -14,7 +14,7 @@ doctest = false
text_edit = { path = "../text_edit" }
syntax = { path = "../syntax" }
base_db = { path = "../base_db" }
ra_ide_db = { path = "../ra_ide_db" }
ide_db = { path = "../ide_db" }
hir = { path = "../hir" }
rustc-hash = "1.1.0"
test_utils = { path = "../test_utils" }

View file

@ -20,7 +20,7 @@ pub use crate::matching::Match;
use crate::matching::MatchFailureReason;
use base_db::{FileId, FilePosition, FileRange};
use hir::Semantics;
use ra_ide_db::source_change::SourceFileEdit;
use ide_db::source_change::SourceFileEdit;
use resolving::ResolvedRule;
use rustc_hash::FxHashMap;
use syntax::{ast, AstNode, SyntaxNode, TextRange};
@ -49,7 +49,7 @@ pub struct SsrMatches {
/// Searches a crate for pattern matches and possibly replaces them with something else.
pub struct MatchFinder<'db> {
/// Our source of information about the user's code.
sema: Semantics<'db, ra_ide_db::RootDatabase>,
sema: Semantics<'db, ide_db::RootDatabase>,
rules: Vec<ResolvedRule>,
resolution_scope: resolving::ResolutionScope<'db>,
restrict_ranges: Vec<FileRange>,
@ -59,7 +59,7 @@ impl<'db> MatchFinder<'db> {
/// Constructs a new instance where names will be looked up as if they appeared at
/// `lookup_context`.
pub fn in_context(
db: &'db ra_ide_db::RootDatabase,
db: &'db ide_db::RootDatabase,
lookup_context: FilePosition,
mut restrict_ranges: Vec<FileRange>,
) -> MatchFinder<'db> {
@ -70,9 +70,9 @@ impl<'db> MatchFinder<'db> {
}
/// Constructs an instance using the start of the first file in `db` as the lookup context.
pub fn at_first_file(db: &'db ra_ide_db::RootDatabase) -> Result<MatchFinder<'db>, SsrError> {
pub fn at_first_file(db: &'db ide_db::RootDatabase) -> Result<MatchFinder<'db>, SsrError> {
use base_db::SourceDatabaseExt;
use ra_ide_db::symbol_index::SymbolsDatabase;
use ide_db::symbol_index::SymbolsDatabase;
if let Some(first_file_id) = db
.local_roots()
.iter()

View file

@ -92,7 +92,7 @@ pub(crate) fn get_match(
rule: &ResolvedRule,
code: &SyntaxNode,
restrict_range: &Option<FileRange>,
sema: &Semantics<ra_ide_db::RootDatabase>,
sema: &Semantics<ide_db::RootDatabase>,
) -> Result<Match, MatchFailed> {
record_match_fails_reasons_scope(debug_active, || {
Matcher::try_match(rule, code, restrict_range, sema)
@ -101,7 +101,7 @@ pub(crate) fn get_match(
/// Checks if our search pattern matches a particular node of the AST.
struct Matcher<'db, 'sema> {
sema: &'sema Semantics<'db, ra_ide_db::RootDatabase>,
sema: &'sema Semantics<'db, ide_db::RootDatabase>,
/// If any placeholders come from anywhere outside of this range, then the match will be
/// rejected.
restrict_range: Option<FileRange>,
@ -123,7 +123,7 @@ impl<'db, 'sema> Matcher<'db, 'sema> {
rule: &ResolvedRule,
code: &SyntaxNode,
restrict_range: &Option<FileRange>,
sema: &'sema Semantics<'db, ra_ide_db::RootDatabase>,
sema: &'sema Semantics<'db, ide_db::RootDatabase>,
) -> Result<Match, MatchFailed> {
let match_state = Matcher { sema, restrict_range: restrict_range.clone(), rule };
// First pass at matching, where we check that node types and idents match.
@ -606,7 +606,7 @@ impl Match {
fn render_template_paths(
&mut self,
template: &ResolvedPattern,
sema: &Semantics<ra_ide_db::RootDatabase>,
sema: &Semantics<ide_db::RootDatabase>,
) -> Result<(), MatchFailed> {
let module = sema
.scope(&self.matched_node)

View file

@ -13,7 +13,7 @@ use syntax::SyntaxNode;
pub(crate) fn nest_and_remove_collisions(
mut matches: Vec<Match>,
sema: &hir::Semantics<ra_ide_db::RootDatabase>,
sema: &hir::Semantics<ide_db::RootDatabase>,
) -> SsrMatches {
// We sort the matches by depth then by rule index. Sorting by depth means that by the time we
// see a match, any parent matches or conflicting matches will have already been seen. Sorting
@ -36,7 +36,7 @@ impl MatchCollector {
/// Attempts to add `m` to matches. If it conflicts with an existing match, it is discarded. If
/// it is entirely within the a placeholder of an existing match, then it is added as a child
/// match of the existing match.
fn add_match(&mut self, m: Match, sema: &hir::Semantics<ra_ide_db::RootDatabase>) {
fn add_match(&mut self, m: Match, sema: &hir::Semantics<ide_db::RootDatabase>) {
let matched_node = m.matched_node.clone();
if let Some(existing) = self.matches_by_node.get_mut(&matched_node) {
try_add_sub_match(m, existing, sema);
@ -53,11 +53,7 @@ impl MatchCollector {
}
/// Attempts to add `m` as a sub-match of `existing`.
fn try_add_sub_match(
m: Match,
existing: &mut Match,
sema: &hir::Semantics<ra_ide_db::RootDatabase>,
) {
fn try_add_sub_match(m: Match, existing: &mut Match, sema: &hir::Semantics<ide_db::RootDatabase>) {
for p in existing.placeholder_values.values_mut() {
// Note, no need to check if p.range.file is equal to m.range.file, since we
// already know we're within `existing`.

View file

@ -187,7 +187,7 @@ impl Resolver<'_, '_> {
impl<'db> ResolutionScope<'db> {
pub(crate) fn new(
sema: &hir::Semantics<'db, ra_ide_db::RootDatabase>,
sema: &hir::Semantics<'db, ide_db::RootDatabase>,
resolve_context: FilePosition,
) -> ResolutionScope<'db> {
use syntax::ast::AstNode;

View file

@ -6,7 +6,7 @@ use crate::{
Match, MatchFinder,
};
use base_db::{FileId, FileRange};
use ra_ide_db::{
use ide_db::{
defs::Definition,
search::{Reference, SearchScope},
};
@ -146,7 +146,7 @@ impl<'db> MatchFinder<'db> {
if self.restrict_ranges.is_empty() {
// Unrestricted search.
use base_db::SourceDatabaseExt;
use ra_ide_db::symbol_index::SymbolsDatabase;
use ide_db::symbol_index::SymbolsDatabase;
for &root in self.sema.db.local_roots().iter() {
let sr = self.sema.db.source_root(root);
for file_id in sr.iter() {

View file

@ -61,13 +61,13 @@ fn parser_undefined_placeholder_in_replacement() {
/// `code` may optionally contain a cursor marker `<|>`. If it doesn't, then the position will be
/// the start of the file. If there's a second cursor marker, then we'll return a single range.
pub(crate) fn single_file(code: &str) -> (ra_ide_db::RootDatabase, FilePosition, Vec<FileRange>) {
pub(crate) fn single_file(code: &str) -> (ide_db::RootDatabase, FilePosition, Vec<FileRange>) {
use base_db::fixture::WithFixture;
use ra_ide_db::symbol_index::SymbolsDatabase;
use ide_db::symbol_index::SymbolsDatabase;
let (mut db, file_id, range_or_offset) = if code.contains(test_utils::CURSOR_MARKER) {
ra_ide_db::RootDatabase::with_range_or_offset(code)
ide_db::RootDatabase::with_range_or_offset(code)
} else {
let (db, file_id) = ra_ide_db::RootDatabase::with_single_file(code);
let (db, file_id) = ide_db::RootDatabase::with_single_file(code);
(db, file_id, RangeOrOffset::Offset(0.into()))
};
let selections;

View file

@ -47,7 +47,7 @@ toolchain = { path = "../toolchain" }
# This should only be used in CLI
base_db = { path = "../base_db" }
ra_ide_db = { path = "../ra_ide_db" }
ide_db = { path = "../ide_db" }
ra_ssr = { path = "../ra_ssr" }
hir = { path = "../hir" }
hir_def = { path = "../hir_def" }

View file

@ -27,7 +27,7 @@ pub fn apply_ssr_rules(rules: Vec<SsrRule>) -> Result<()> {
/// for much else.
pub fn search_for_patterns(patterns: Vec<SsrPattern>, debug_snippet: Option<String>) -> Result<()> {
use base_db::SourceDatabaseExt;
use ra_ide_db::symbol_index::SymbolsDatabase;
use ide_db::symbol_index::SymbolsDatabase;
let (host, _vfs) = load_cargo(&std::env::current_dir()?, true, true)?;
let db = host.raw_database();
let mut match_finder = MatchFinder::at_first_file(db)?;