Cleanup imports

This commit is contained in:
Aleksey Kladov 2019-11-24 14:02:08 +03:00
parent cfffea6dc8
commit f11237561c
8 changed files with 20 additions and 27 deletions

View File

@ -12,13 +12,14 @@ use hir_def::{
per_ns::PerNs,
resolver::{HasResolver, TypeNs},
type_ref::TypeRef,
ContainerId, HasModule, ImplId, LocalEnumVariantId, LocalImportId, LocalModuleId,
LocalStructFieldId, Lookup, ModuleId, UnionId,
AstItemDef, ConstId, ContainerId, EnumId, FunctionId, HasModule, ImplId, LocalEnumVariantId,
LocalImportId, LocalModuleId, LocalStructFieldId, Lookup, ModuleId, StaticId, StructId,
TraitId, TypeAliasId, UnionId,
};
use hir_expand::{
diagnostics::DiagnosticSink,
name::{self, AsName},
AstId,
AstId, MacroDefId,
};
use ra_db::{CrateId, Edition, FileId, FilePosition};
use ra_syntax::{ast, AstNode, SyntaxNode};
@ -26,10 +27,6 @@ use ra_syntax::{ast, AstNode, SyntaxNode};
use crate::{
db::{DefDatabase, HirDatabase},
expr::{BindingAnnotation, Body, BodySourceMap, ExprValidator, Pat, PatId},
ids::{
AstItemDef, ConstId, EnumId, FunctionId, MacroDefId, StaticId, StructId, TraitId,
TypeAliasId,
},
ty::{InferenceResult, Namespace, TraitRef},
Either, HasSource, Name, Source, Ty,
};

View File

@ -1,12 +1,11 @@
//! FIXME: write short doc here
use hir_def::{HasChildSource, HasSource as _, Lookup, VariantId};
use hir_def::{AstItemDef, HasChildSource, HasSource as _, Lookup, VariantId};
use hir_expand::either::Either;
use ra_syntax::ast::{self, AstNode};
use crate::{
db::{DefDatabase, HirDatabase},
ids::AstItemDef,
Const, Enum, EnumVariant, FieldSource, Function, HasBody, Import, MacroDef, Module,
ModuleSource, Static, Struct, StructField, Trait, TypeAlias, Union,
};

View File

@ -22,9 +22,10 @@
use std::fmt;
use hir_expand::HirFileId;
use ra_db::{CrateId, FileId};
use crate::{db::HirDatabase, Crate, HirFileId, Module, Name};
use crate::{db::HirDatabase, Crate, Module, Name};
impl Crate {
pub fn debug(self, db: &impl HirDebugDatabase) -> impl fmt::Debug + '_ {

View File

@ -2,9 +2,10 @@
use std::any::Any;
use hir_expand::HirFileId;
use ra_syntax::{ast, AstNode, AstPtr, SyntaxNodePtr};
use crate::{db::AstDatabase, HirFileId, Name, Source};
use crate::{db::AstDatabase, Name, Source};
pub use hir_def::diagnostics::UnresolvedModule;
pub use hir_expand::diagnostics::{AstDiagnostic, Diagnostic, DiagnosticSink};

View File

@ -1,6 +1,6 @@
//! FIXME: write short doc here
use hir_def::{ModuleId, StructId, StructOrUnionId, UnionId};
use hir_def::{AstItemDef, LocationCtx, ModuleId, StructId, StructOrUnionId, UnionId};
use hir_expand::{name::AsName, AstId, MacroDefId, MacroDefKind};
use ra_syntax::{
ast::{self, AstNode, NameOwner},
@ -9,7 +9,6 @@ use ra_syntax::{
use crate::{
db::{AstDatabase, DefDatabase, HirDatabase},
ids::{AstItemDef, LocationCtx},
AssocItem, Const, DefWithBody, Enum, EnumVariant, FieldSource, Function, HasBody, HasSource,
ImplBlock, Local, MacroDef, Module, ModuleDef, ModuleSource, Source, Static, Struct,
StructField, Trait, TypeAlias, Union, VariantDef,

View File

@ -7,12 +7,6 @@
use ra_db::salsa;
pub use hir_def::{
AstItemDef, ConstId, EnumId, FunctionId, ItemLoc, LocationCtx, StaticId, StructId, TraitId,
TypeAliasId,
};
pub use hir_expand::{HirFileId, MacroCallId, MacroCallLoc, MacroDefId, MacroFile, MacroFileKind};
macro_rules! impl_intern_key {
($name:ident) => {
impl salsa::InternKey for $name {

View File

@ -58,7 +58,6 @@ pub use crate::{
},
expr::ExprScopes,
from_source::FromSource,
ids::{HirFileId, MacroCallId, MacroCallLoc, MacroDefId, MacroFile},
source_binder::{PathResolution, ScopeEntryWithSyntax, SourceAnalyzer},
ty::{
display::HirDisplay,
@ -73,4 +72,6 @@ pub use hir_def::{
path::{Path, PathKind},
type_ref::Mutability,
};
pub use hir_expand::{either::Either, name::Name, Source};
pub use hir_expand::{
either::Either, name::Name, HirFileId, MacroCallId, MacroCallLoc, MacroDefId, MacroFile, Source,
};

View File

@ -11,9 +11,11 @@ use hir_def::{
expr::{ExprId, PatId},
path::known,
resolver::{self, resolver_for_scope, HasResolver, Resolver, TypeNs, ValueNs},
DefWithBodyId,
DefWithBodyId, LocationCtx,
};
use hir_expand::{
name::AsName, AstId, HirFileId, MacroCallId, MacroCallLoc, MacroFileKind, Source,
};
use hir_expand::{name::AsName, AstId, MacroCallId, MacroCallLoc, MacroFileKind, Source};
use ra_syntax::{
ast::{self, AstNode},
match_ast, AstPtr,
@ -24,11 +26,10 @@ use ra_syntax::{
use crate::{
db::HirDatabase,
expr::{BodySourceMap, ExprScopes, ScopeId},
ids::LocationCtx,
ty::method_resolution::{self, implements_trait},
Adt, AssocItem, Const, DefWithBody, Either, Enum, EnumVariant, FromSource, Function,
GenericParam, HasBody, HirFileId, Local, MacroDef, Module, Name, Path, ScopeDef, Static,
Struct, Trait, Ty, TypeAlias,
GenericParam, HasBody, Local, MacroDef, Module, Name, Path, ScopeDef, Static, Struct, Trait,
Ty, TypeAlias,
};
fn try_get_resolver_for_node(db: &impl HirDatabase, node: Source<&SyntaxNode>) -> Option<Resolver> {
@ -544,7 +545,7 @@ fn adjust(
}
/// Given a `ast::MacroCall`, return what `MacroKindFile` it belongs to.
/// FIXME: Not completed
/// FIXME: Not completed
fn to_macro_file_kind(macro_call: &ast::MacroCall) -> MacroFileKind {
let syn = macro_call.syntax();
let parent = match syn.parent() {