Skip to content

minor: Re-export FxHashMap and FxHashSet from ide_db #12078

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion crates/ide/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ crossbeam-channel = "0.5.4"
either = "1.6.1"
itertools = "0.10.3"
tracing = "0.1.32"
rustc-hash = "1.1.0"
oorandom = "11.1.3"
pulldown-cmark-to-cmark = "10.0.1"
pulldown-cmark = { version = "0.9.1", default-features = false }
Expand Down
4 changes: 1 addition & 3 deletions crates/ide/src/folding_ranges.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
use ide_db::syntax_helpers::node_ext::vis_eq;
use rustc_hash::FxHashSet;

use ide_db::{syntax_helpers::node_ext::vis_eq, FxHashSet};
use syntax::{
ast::{self, AstNode, AstToken},
match_ast, Direction, NodeOrToken, SourceFile,
Expand Down
3 changes: 1 addition & 2 deletions crates/ide/src/highlight_related.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ use ide_db::{
helpers::pick_best_token,
search::{FileReference, ReferenceCategory, SearchScope},
syntax_helpers::node_ext::{for_each_break_and_continue_expr, for_each_tail_expr, walk_expr},
RootDatabase,
FxHashSet, RootDatabase,
};
use rustc_hash::FxHashSet;
use syntax::{
ast::{self, HasLoopBody},
match_ast, AstNode,
Expand Down
4 changes: 2 additions & 2 deletions crates/ide/src/inlay_hints.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use either::Either;
use hir::{known, Callable, HasVisibility, HirDisplay, Semantics, TypeInfo};
use ide_db::{
base_db::FileRange, famous_defs::FamousDefs, syntax_helpers::node_ext::walk_ty, RootDatabase,
base_db::FileRange, famous_defs::FamousDefs, syntax_helpers::node_ext::walk_ty, FxHashMap,
RootDatabase,
};
use itertools::Itertools;
use rustc_hash::FxHashMap;
use stdx::to_lower_snake_case;
use syntax::{
ast::{self, AstNode, HasArgList, HasGenericParams, HasName, UnaryOp},
Expand Down
3 changes: 1 addition & 2 deletions crates/ide/src/prime_caches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ use ide_db::{
salsa::{Database, ParallelDatabase, Snapshot},
Cancelled, CrateGraph, CrateId, SourceDatabase, SourceDatabaseExt,
},
FxIndexMap,
FxHashSet, FxIndexMap,
};
use rustc_hash::FxHashSet;

use crate::RootDatabase;

Expand Down
2 changes: 1 addition & 1 deletion crates/ide/src/prime_caches/topologic_sort.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! helper data structure to schedule work for parallel prime caches.
use std::{collections::VecDeque, hash::Hash};

use rustc_hash::FxHashMap;
use ide_db::FxHashMap;

pub(crate) struct TopologicSortIterBuilder<T> {
nodes: FxHashMap<T, Entry<T>>,
Expand Down
3 changes: 1 addition & 2 deletions crates/ide/src/references.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ use ide_db::{
base_db::FileId,
defs::{Definition, NameClass, NameRefClass},
search::{ReferenceCategory, SearchScope, UsageSearchResult},
RootDatabase,
FxHashMap, RootDatabase,
};
use rustc_hash::FxHashMap;
use syntax::{
algo::find_node_at_offset,
ast::{self, HasName},
Expand Down
3 changes: 1 addition & 2 deletions crates/ide/src/runnables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ use ide_db::{
defs::Definition,
helpers::visit_file_defs,
search::SearchScope,
RootDatabase, SymbolKind,
FxHashMap, FxHashSet, RootDatabase, SymbolKind,
};
use itertools::Itertools;
use rustc_hash::{FxHashMap, FxHashSet};
use stdx::{always, format_to};
use syntax::{
ast::{self, AstNode, HasAttrs as _},
Expand Down
8 changes: 4 additions & 4 deletions crates/ide/src/shuffle_crate_graph.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use std::sync::Arc;

use ide_db::base_db::salsa::Durability;
use ide_db::base_db::{CrateGraph, SourceDatabase};
use ide_db::RootDatabase;
use rustc_hash::FxHashMap;
use ide_db::{
base_db::{salsa::Durability, CrateGraph, SourceDatabase},
FxHashMap, RootDatabase,
};

// Feature: Shuffle Crate Graph
//
Expand Down
3 changes: 1 addition & 2 deletions crates/ide/src/ssr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,8 @@ mod tests {
use ide_db::{
base_db::{fixture::WithFixture, salsa::Durability, FileRange},
symbol_index::SymbolsDatabase,
RootDatabase,
FxHashSet, RootDatabase,
};
use rustc_hash::FxHashSet;

use super::ssr_assists;

Expand Down
3 changes: 1 addition & 2 deletions crates/ide/src/static_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ use hir::{db::HirDatabase, Crate, Module, Semantics};
use ide_db::{
base_db::{FileId, FileRange, SourceDatabaseExt},
defs::{Definition, IdentClass},
RootDatabase,
FxHashSet, RootDatabase,
};
use rustc_hash::FxHashSet;
use syntax::{AstNode, SyntaxKind::*, SyntaxToken, TextRange, T};

use crate::{
Expand Down
3 changes: 1 addition & 2 deletions crates/ide/src/syntax_highlighting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ mod html;
mod tests;

use hir::{InFile, Name, Semantics};
use ide_db::RootDatabase;
use rustc_hash::FxHashMap;
use ide_db::{FxHashMap, RootDatabase};
use syntax::{
ast, AstNode, AstToken, NodeOrToken, SyntaxKind::*, SyntaxNode, TextRange, WalkEvent, T,
};
Expand Down
3 changes: 1 addition & 2 deletions crates/ide/src/syntax_highlighting/highlight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
use hir::{AsAssocItem, HasVisibility, Semantics};
use ide_db::{
defs::{Definition, IdentClass, NameClass, NameRefClass},
RootDatabase, SymbolKind,
FxHashMap, RootDatabase, SymbolKind,
};
use rustc_hash::FxHashMap;
use syntax::{
ast, match_ast, AstNode, AstToken, NodeOrToken,
SyntaxKind::{self, *},
Expand Down
3 changes: 1 addition & 2 deletions crates/ide/src/view_crate_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ use std::sync::Arc;
use dot::{Id, LabelText};
use ide_db::{
base_db::{CrateGraph, CrateId, Dependency, SourceDatabase, SourceDatabaseExt},
RootDatabase,
FxHashSet, RootDatabase,
};
use rustc_hash::FxHashSet;

// Feature: View Crate Graph
//
Expand Down
2 changes: 1 addition & 1 deletion crates/ide_assists/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ doctest = false

[dependencies]
cov-mark = "2.0.0-pre.1"
rustc-hash = "1.1.0"

itertools = "0.10.3"
either = "1.6.1"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ use ide_db::{
helpers::mod_path_to_ast,
imports::insert_use::{insert_use, ImportScope, InsertUseConfig},
search::FileReference,
RootDatabase,
FxHashSet, RootDatabase,
};
use itertools::{Itertools, Position};
use rustc_hash::FxHashSet;
use syntax::{
ast::{
self, edit::IndentLevel, edit_in_place::Indent, make, AstNode, HasAttrs, HasGenericParams,
Expand Down
4 changes: 1 addition & 3 deletions crates/ide_assists/src/handlers/generate_function.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
use rustc_hash::{FxHashMap, FxHashSet};

use hir::{HasSource, HirDisplay, Module, Semantics, TypeInfo};
use ide_db::{
base_db::FileId,
defs::{Definition, NameRefClass},
famous_defs::FamousDefs,
RootDatabase, SnippetCap,
FxHashMap, FxHashSet, RootDatabase, SnippetCap,
};
use stdx::to_lower_snake_case;
use syntax::{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use rustc_hash::FxHashSet;
use ide_db::FxHashSet;
use syntax::{
ast::{self, edit_in_place::GenericParamsOwnerEdit, make, HasGenericParams},
ted::{self, Position},
Expand Down
3 changes: 1 addition & 2 deletions crates/ide_assists/src/handlers/reorder_fields.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use either::Either;
use ide_db::FxHashMap;
use itertools::Itertools;
use rustc_hash::FxHashMap;

use syntax::{ast, ted, AstNode};

use crate::{AssistContext, AssistId, AssistKind, Assists};
Expand Down
6 changes: 2 additions & 4 deletions crates/ide_assists/src/handlers/reorder_impl.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use itertools::Itertools;
use rustc_hash::FxHashMap;

use hir::{PathResolution, Semantics};
use ide_db::RootDatabase;
use ide_db::{FxHashMap, RootDatabase};
use itertools::Itertools;
use syntax::{
ast::{self, HasName},
ted, AstNode,
Expand Down
2 changes: 1 addition & 1 deletion crates/ide_completion/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ doctest = false
[dependencies]
cov-mark = "2.0.0-pre.1"
itertools = "0.10.3"
rustc-hash = "1.1.0"

once_cell = "1.10.0"
smallvec = "1.8.0"

Expand Down
3 changes: 1 addition & 2 deletions crates/ide_completion/src/completions/attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ use ide_db::{
Lint, CLIPPY_LINTS, CLIPPY_LINT_GROUPS, DEFAULT_LINTS, FEATURES, RUSTDOC_LINTS,
},
syntax_helpers::node_ext::parse_tt_as_comma_sep_paths,
SymbolKind,
FxHashMap, SymbolKind,
};
use itertools::Itertools;
use once_cell::sync::Lazy;
use rustc_hash::FxHashMap;
use syntax::{
ast::{self, AttrKind},
AstNode, SyntaxKind, T,
Expand Down
2 changes: 1 addition & 1 deletion crates/ide_completion/src/completions/dot.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Completes references after dot (fields and method calls).

use rustc_hash::FxHashSet;
use ide_db::FxHashSet;

use crate::{context::CompletionContext, patterns::ImmediateLocation, Completions};

Expand Down
2 changes: 1 addition & 1 deletion crates/ide_completion/src/completions/fn_param.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! See [`complete_fn_param`].

use hir::HirDisplay;
use rustc_hash::FxHashMap;
use ide_db::FxHashMap;
use syntax::{
algo,
ast::{self, HasModuleItem},
Expand Down
2 changes: 1 addition & 1 deletion crates/ide_completion/src/completions/mod_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
use std::iter;

use hir::{Module, ModuleSource};
use ide_db::FxHashSet;
use ide_db::{
base_db::{SourceDatabaseExt, VfsPath},
RootDatabase, SymbolKind,
};
use rustc_hash::FxHashSet;

use crate::{context::NameContext, CompletionItem};

Expand Down
2 changes: 1 addition & 1 deletion crates/ide_completion/src/completions/pattern.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Completes constants and paths in unqualified patterns.

use hir::{db::DefDatabase, AssocItem, ScopeDef};
use rustc_hash::FxHashSet;
use ide_db::FxHashSet;
use syntax::ast::Pat;

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion crates/ide_completion/src/completions/qualified_path.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Completion of paths, i.e. `some::prefix::$0`.

use hir::{ScopeDef, Trait};
use rustc_hash::FxHashSet;
use ide_db::FxHashSet;
use syntax::ast;

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion crates/ide_completion/src/completions/use_.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Completion for use trees

use hir::ScopeDef;
use rustc_hash::FxHashSet;
use ide_db::FxHashSet;
use syntax::{ast, AstNode};

use crate::{
Expand Down
3 changes: 1 addition & 2 deletions crates/ide_completion/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ use ide_db::{
active_parameter::ActiveParameter,
base_db::{FilePosition, SourceDatabase},
famous_defs::FamousDefs,
RootDatabase,
FxHashMap, FxHashSet, RootDatabase,
};
use rustc_hash::{FxHashMap, FxHashSet};
use syntax::{
algo::{find_node_at_offset, non_trivia_sibling},
ast::{self, AttrKind, HasName, NameOrNameRef},
Expand Down
2 changes: 1 addition & 1 deletion crates/ide_db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ use hir::{
db::{AstDatabase, DefDatabase, HirDatabase},
symbols::FileSymbolKind,
};
use rustc_hash::FxHashSet;

use crate::{line_index::LineIndex, symbol_index::SymbolsDatabase};
pub use rustc_hash::{FxHashMap, FxHashSet, FxHasher};

/// `base_db` is normally also needed in places where `ide_db` is used, so this re-export is for convenience.
pub use base_db;
Expand Down
3 changes: 2 additions & 1 deletion crates/ide_diagnostics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ doctest = false
[dependencies]
cov-mark = "2.0.0-pre.1"
itertools = "0.10.3"
rustc-hash = "1.1.0"


either = "1.6.1"

profile = { path = "../profile", version = "0.0.0" }
Expand Down
3 changes: 1 addition & 2 deletions crates/ide_diagnostics/src/handlers/missing_fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ use hir::{
db::{AstDatabase, HirDatabase},
known, AssocItem, HirDisplay, InFile, Type,
};
use ide_db::{assists::Assist, famous_defs::FamousDefs, source_change::SourceChange};
use rustc_hash::FxHashMap;
use ide_db::{assists::Assist, famous_defs::FamousDefs, source_change::SourceChange, FxHashMap};
use stdx::format_to;
use syntax::{
algo,
Expand Down
3 changes: 1 addition & 2 deletions crates/ide_diagnostics/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ use ide_db::{
base_db::{FileId, SourceDatabase},
label::Label,
source_change::SourceChange,
RootDatabase,
FxHashSet, RootDatabase,
};
use rustc_hash::FxHashSet;
use syntax::{ast::AstNode, TextRange};

#[derive(Copy, Clone, Debug, PartialEq)]
Expand Down
2 changes: 1 addition & 1 deletion crates/ide_ssr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ doctest = false

[dependencies]
cov-mark = "2.0.0-pre.1"
rustc-hash = "1.1.0"

itertools = "0.10.3"

text_edit = { path = "../text_edit", version = "0.0.0" }
Expand Down
Loading