minor: Lift out FxIndex{Map/Set} types into ide_db
This commit is contained in:
parent
d2513deb62
commit
92f7db447c
3
Cargo.lock
generated
3
Cargo.lock
generated
@ -585,7 +585,6 @@ dependencies = [
|
||||
"ide_db",
|
||||
"ide_diagnostics",
|
||||
"ide_ssr",
|
||||
"indexmap",
|
||||
"itertools",
|
||||
"oorandom",
|
||||
"profile",
|
||||
@ -609,7 +608,6 @@ dependencies = [
|
||||
"expect-test",
|
||||
"hir",
|
||||
"ide_db",
|
||||
"indexmap",
|
||||
"itertools",
|
||||
"profile",
|
||||
"rustc-hash",
|
||||
@ -654,6 +652,7 @@ dependencies = [
|
||||
"expect-test",
|
||||
"fst",
|
||||
"hir",
|
||||
"indexmap",
|
||||
"itertools",
|
||||
"limit",
|
||||
"once_cell",
|
||||
|
@ -20,7 +20,7 @@ anymap = "0.12.1"
|
||||
drop_bomb = "0.1.4"
|
||||
fst = { version = "0.4", default-features = false }
|
||||
itertools = "0.10.0"
|
||||
indexmap = "1.4.0"
|
||||
indexmap = "1.7.0"
|
||||
smallvec = "1.4.0"
|
||||
la-arena = { version = "0.3.0", path = "../../lib/arena" }
|
||||
|
||||
|
@ -12,7 +12,6 @@ doctest = false
|
||||
[dependencies]
|
||||
cov-mark = "2.0.0-pre.1"
|
||||
either = "1.5.3"
|
||||
indexmap = "1.4.0"
|
||||
itertools = "0.10.0"
|
||||
tracing = "0.1"
|
||||
rustc-hash = "1.1.0"
|
||||
|
@ -1,13 +1,11 @@
|
||||
//! Entry point for call-hierarchy
|
||||
|
||||
use indexmap::IndexMap;
|
||||
|
||||
use hir::Semantics;
|
||||
use ide_db::{
|
||||
defs::{Definition, NameClass, NameRefClass},
|
||||
helpers::pick_best_token,
|
||||
search::FileReference,
|
||||
RootDatabase,
|
||||
FxIndexMap, RootDatabase,
|
||||
};
|
||||
use syntax::{ast, AstNode, SyntaxKind::NAME, TextRange};
|
||||
|
||||
@ -125,7 +123,7 @@ pub(crate) fn outgoing_calls(db: &RootDatabase, position: FilePosition) -> Optio
|
||||
|
||||
#[derive(Default)]
|
||||
struct CallLocations {
|
||||
funcs: IndexMap<NavigationTarget, Vec<TextRange>>,
|
||||
funcs: FxIndexMap<NavigationTarget, Vec<TextRange>>,
|
||||
}
|
||||
|
||||
impl CallLocations {
|
||||
|
@ -14,7 +14,6 @@ cov-mark = "2.0.0-pre.1"
|
||||
rustc-hash = "1.1.0"
|
||||
itertools = "0.10.0"
|
||||
either = "1.6.1"
|
||||
indexmap = "1.6.2"
|
||||
|
||||
stdx = { path = "../stdx", version = "0.0.0" }
|
||||
syntax = { path = "../syntax", version = "0.0.0" }
|
||||
|
@ -1,4 +1,4 @@
|
||||
use std::{hash::BuildHasherDefault, iter};
|
||||
use std::iter;
|
||||
|
||||
use ast::make;
|
||||
use either::Either;
|
||||
@ -12,10 +12,9 @@
|
||||
FamousDefs,
|
||||
},
|
||||
search::{FileReference, ReferenceCategory, SearchScope},
|
||||
RootDatabase,
|
||||
FxIndexSet, RootDatabase,
|
||||
};
|
||||
use itertools::Itertools;
|
||||
use rustc_hash::FxHasher;
|
||||
use stdx::format_to;
|
||||
use syntax::{
|
||||
ast::{
|
||||
@ -33,8 +32,6 @@
|
||||
AssistId,
|
||||
};
|
||||
|
||||
type FxIndexSet<T> = indexmap::IndexSet<T, BuildHasherDefault<FxHasher>>;
|
||||
|
||||
// Assist: extract_function
|
||||
//
|
||||
// Extracts selected statements into new function.
|
||||
|
@ -19,6 +19,7 @@ once_cell = "1.3.1"
|
||||
either = "1.6.1"
|
||||
itertools = "0.10.0"
|
||||
arrayvec = "0.7"
|
||||
indexmap = "1.7"
|
||||
|
||||
stdx = { path = "../stdx", version = "0.0.0" }
|
||||
syntax = { path = "../syntax", version = "0.0.0" }
|
||||
|
@ -34,6 +34,10 @@
|
||||
/// `base_db` is normally also needed in places where `ide_db` is used, so this re-export is for convenience.
|
||||
pub use base_db;
|
||||
|
||||
pub type FxIndexSet<T> = indexmap::IndexSet<T, std::hash::BuildHasherDefault<rustc_hash::FxHasher>>;
|
||||
pub type FxIndexMap<K, V> =
|
||||
indexmap::IndexMap<K, V, std::hash::BuildHasherDefault<rustc_hash::FxHasher>>;
|
||||
|
||||
#[salsa::database(
|
||||
base_db::SourceDatabaseStorage,
|
||||
base_db::SourceDatabaseExtStorage,
|
||||
|
@ -17,7 +17,7 @@ rowan = "0.14.0"
|
||||
rustc_lexer = { version = "725.0.0", package = "rustc-ap-rustc_lexer" }
|
||||
rustc-hash = "1.1.0"
|
||||
once_cell = "1.3.1"
|
||||
indexmap = "1.4.0"
|
||||
indexmap = "1.7.0"
|
||||
smol_str = "0.1.21"
|
||||
|
||||
stdx = { path = "../stdx", version = "0.0.0" }
|
||||
|
@ -14,4 +14,4 @@ rustc-hash = "1.0"
|
||||
fst = "0.4"
|
||||
|
||||
paths = { path = "../paths", version = "0.0.0" }
|
||||
indexmap = "1.6.2"
|
||||
indexmap = "1.7"
|
||||
|
Loading…
Reference in New Issue
Block a user