Move AstIdMap infra to the span crate

This commit is contained in:
Lukas Wirth 2024-03-01 15:39:44 +01:00
parent 549aae7c07
commit efd76ecff1
14 changed files with 61 additions and 73 deletions

View file

@ -6,7 +6,6 @@ use std::mem;
use base_db::CrateId;
use either::Either;
use hir_expand::{
ast_id_map::AstIdMap,
name::{name, AsName, Name},
ExpandError, InFile,
};
@ -14,6 +13,7 @@ use intern::Interned;
use profile::Count;
use rustc_hash::FxHashMap;
use smallvec::SmallVec;
use span::AstIdMap;
use syntax::{
ast::{
self, ArrayExprKind, AstChildren, BlockExpr, HasArgList, HasAttrs, HasLoopBody, HasName,

View file

@ -47,18 +47,13 @@ use std::{
use ast::{AstNode, StructKind};
use base_db::CrateId;
use either::Either;
use hir_expand::{
ast_id_map::{AstIdNode, FileAstId},
attrs::RawAttrs,
name::Name,
ExpandTo, HirFileId, InFile,
};
use hir_expand::{attrs::RawAttrs, name::Name, ExpandTo, HirFileId, InFile};
use intern::Interned;
use la_arena::{Arena, Idx, IdxRange, RawIdx};
use profile::Count;
use rustc_hash::FxHashMap;
use smallvec::SmallVec;
use span::Span;
use span::{AstIdNode, FileAstId, Span};
use stdx::never;
use syntax::{ast, match_ast, SyntaxKind};
use triomphe::Arc;

View file

@ -2,10 +2,9 @@
use std::collections::hash_map::Entry;
use hir_expand::{
ast_id_map::AstIdMap, mod_path::path, name, name::AsName, span_map::SpanMapRef, HirFileId,
};
use hir_expand::{mod_path::path, name, name::AsName, span_map::SpanMapRef, HirFileId};
use la_arena::Arena;
use span::AstIdMap;
use syntax::{
ast::{self, HasModuleItem, HasName, HasTypeBounds, IsString},
AstNode,

View file

@ -76,7 +76,6 @@ use base_db::{
CrateId, Edition,
};
use hir_expand::{
ast_id_map::{AstIdNode, FileAstId},
builtin_attr_macro::BuiltinAttrExpander,
builtin_derive_macro::BuiltinDeriveExpander,
builtin_fn_macro::{BuiltinFnLikeExpander, EagerExpander},
@ -91,7 +90,7 @@ use hir_expand::{
use item_tree::ExternBlock;
use la_arena::Idx;
use nameres::DefMap;
use span::{FileId, Span};
use span::{AstIdNode, FileAstId, FileId, Span};
use stdx::impl_from;
use syntax::{ast, AstNode};

View file

@ -2,10 +2,10 @@
use std::cell::OnceCell;
use hir_expand::{
ast_id_map::{AstIdMap, AstIdNode},
span_map::{SpanMap, SpanMapRef},
AstId, HirFileId, InFile,
};
use span::{AstIdMap, AstIdNode};
use syntax::ast;
use triomphe::Arc;

View file

@ -61,13 +61,13 @@ use std::ops::Deref;
use base_db::{CrateId, Edition, FileId};
use hir_expand::{
ast_id_map::FileAstId, name::Name, proc_macro::ProcMacroKind, HirFileId, InFile, MacroCallId,
MacroDefId,
name::Name, proc_macro::ProcMacroKind, HirFileId, InFile, MacroCallId, MacroDefId,
};
use itertools::Itertools;
use la_arena::Arena;
use profile::Count;
use rustc_hash::{FxHashMap, FxHashSet};
use span::FileAstId;
use stdx::format_to;
use syntax::{ast, SmolStr};
use triomphe::Arc;

View file

@ -9,7 +9,6 @@ use base_db::{CrateId, Dependency, Edition, FileId};
use cfg::{CfgExpr, CfgOptions};
use either::Either;
use hir_expand::{
ast_id_map::FileAstId,
attrs::{Attr, AttrId},
builtin_attr_macro::{find_builtin_attr, BuiltinAttrExpander},
builtin_derive_macro::find_builtin_derive,
@ -23,7 +22,7 @@ use itertools::{izip, Itertools};
use la_arena::Idx;
use limit::Limit;
use rustc_hash::{FxHashMap, FxHashSet};
use span::{ErasedFileAstId, Span, SyntaxContextId};
use span::{ErasedFileAstId, FileAstId, Span, SyntaxContextId};
use stdx::always;
use syntax::{ast, SmolStr};
use triomphe::Arc;