aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/nameres
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/nameres')
-rw-r--r--crates/ra_hir/src/nameres/collector.rs25
-rw-r--r--crates/ra_hir/src/nameres/raw.rs15
-rw-r--r--crates/ra_hir/src/nameres/tests.rs6
3 files changed, 23 insertions, 23 deletions
diff --git a/crates/ra_hir/src/nameres/collector.rs b/crates/ra_hir/src/nameres/collector.rs
index ef4d1ed70..2b07ebf4a 100644
--- a/crates/ra_hir/src/nameres/collector.rs
+++ b/crates/ra_hir/src/nameres/collector.rs
@@ -1,22 +1,19 @@
1use arrayvec::ArrayVec; 1use arrayvec::ArrayVec;
2use rustc_hash::FxHashMap;
3use relative_path::RelativePathBuf;
4use test_utils::tested_by;
5use ra_db::FileId; 2use ra_db::FileId;
6use ra_syntax::ast; 3use ra_syntax::ast;
4use relative_path::RelativePathBuf;
5use rustc_hash::FxHashMap;
6use test_utils::tested_by;
7 7
8use crate::{ 8use crate::{
9 Function, Module, Struct, Union, Enum, Const, Static, Trait, TypeAlias, MacroDef, 9 either::Either,
10 DefDatabase, HirFileId, Name, Path, 10 ids::{AstItemDef, LocationCtx, MacroCallId, MacroCallLoc, MacroDefId, MacroFileKind},
11 KnownName, AstId,
12 nameres::{ 11 nameres::{
13 Resolution, PerNs, ModuleDef, ReachedFixedPoint, ResolveMode, 12 diagnostics::DefDiagnostic, raw, CrateDefMap, CrateModuleId, ItemOrMacro, ModuleData,
14 CrateDefMap, CrateModuleId, ModuleData, ItemOrMacro, 13 ModuleDef, PerNs, ReachedFixedPoint, Resolution, ResolveMode,
15 diagnostics::DefDiagnostic,
16 raw,
17 }, 14 },
18 ids::{AstItemDef, LocationCtx, MacroCallLoc, MacroCallId, MacroDefId, MacroFileKind}, 15 AstId, Const, DefDatabase, Enum, Function, HirFileId, KnownName, MacroDef, Module, Name, Path,
19 either::Either, 16 Static, Struct, Trait, TypeAlias, Union,
20}; 17};
21 18
22pub(super) fn collect_defs(db: &impl DefDatabase, mut def_map: CrateDefMap) -> CrateDefMap { 19pub(super) fn collect_defs(db: &impl DefDatabase, mut def_map: CrateDefMap) -> CrateDefMap {
@@ -666,9 +663,9 @@ fn resolve_submodule(
666mod tests { 663mod tests {
667 use ra_db::SourceDatabase; 664 use ra_db::SourceDatabase;
668 665
669 use crate::{Crate, mock::MockDatabase, DefDatabase};
670 use ra_arena::{Arena};
671 use super::*; 666 use super::*;
667 use crate::{mock::MockDatabase, Crate, DefDatabase};
668 use ra_arena::Arena;
672 use rustc_hash::FxHashSet; 669 use rustc_hash::FxHashSet;
673 670
674 fn do_collect_defs( 671 fn do_collect_defs(
diff --git a/crates/ra_hir/src/nameres/raw.rs b/crates/ra_hir/src/nameres/raw.rs
index a0afe282c..7ea59cb75 100644
--- a/crates/ra_hir/src/nameres/raw.rs
+++ b/crates/ra_hir/src/nameres/raw.rs
@@ -1,13 +1,16 @@
1use std::{sync::Arc, ops::Index}; 1use std::{ops::Index, sync::Arc};
2 2
3use test_utils::tested_by; 3use ra_arena::{impl_arena_id, map::ArenaMap, Arena, RawId};
4use ra_arena::{Arena, impl_arena_id, RawId, map::ArenaMap};
5use ra_syntax::{ 4use ra_syntax::{
6 AstNode, SourceFile, AstPtr, TreeArc, 5 ast::{self, AttrsOwner, NameOwner},
7 ast::{self, NameOwner, AttrsOwner}, 6 AstNode, AstPtr, SourceFile, TreeArc,
8}; 7};
8use test_utils::tested_by;
9 9
10use crate::{DefDatabase, Name, AsName, Path, HirFileId, ModuleSource, AstIdMap, FileAstId, Either, AstDatabase}; 10use crate::{
11 AsName, AstDatabase, AstIdMap, DefDatabase, Either, FileAstId, HirFileId, ModuleSource, Name,
12 Path,
13};
11 14
12/// `RawItems` is a set of top-level items in a file (except for impls). 15/// `RawItems` is a set of top-level items in a file (except for impls).
13/// 16///
diff --git a/crates/ra_hir/src/nameres/tests.rs b/crates/ra_hir/src/nameres/tests.rs
index 07b533e29..bd2d855cf 100644
--- a/crates/ra_hir/src/nameres/tests.rs
+++ b/crates/ra_hir/src/nameres/tests.rs
@@ -5,14 +5,14 @@ mod primitives;
5 5
6use std::sync::Arc; 6use std::sync::Arc;
7 7
8use insta::assert_snapshot_matches;
8use ra_db::SourceDatabase; 9use ra_db::SourceDatabase;
9use test_utils::covers; 10use test_utils::covers;
10use insta::assert_snapshot_matches;
11 11
12use crate::{ 12use crate::{
13 Crate, Either, 13 mock::{CrateGraphFixture, MockDatabase},
14 mock::{MockDatabase, CrateGraphFixture},
15 nameres::Resolution, 14 nameres::Resolution,
15 Crate, Either,
16}; 16};
17 17
18use super::*; 18use super::*;