mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Intern use and extern crate items like other items
This commit is contained in:
parent
00b9d9faf4
commit
0bde3fc77e
3 changed files with 50 additions and 31 deletions
|
@ -88,8 +88,8 @@ use crate::{
|
|||
builtin_type::BuiltinType,
|
||||
data::adt::VariantData,
|
||||
item_tree::{
|
||||
Const, Enum, Function, Impl, ItemTreeId, ItemTreeNode, MacroDef, MacroRules, Static,
|
||||
Struct, Trait, TraitAlias, TypeAlias, Union,
|
||||
Const, Enum, ExternCrate, Function, Impl, Import, ItemTreeId, ItemTreeNode, MacroDef,
|
||||
MacroRules, Static, Struct, Trait, TraitAlias, TypeAlias, Union,
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -313,6 +313,16 @@ pub struct ImplId(salsa::InternId);
|
|||
type ImplLoc = ItemLoc<Impl>;
|
||||
impl_intern!(ImplId, ImplLoc, intern_impl, lookup_intern_impl);
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Ord, PartialOrd)]
|
||||
pub struct ImportId(salsa::InternId);
|
||||
type ImportLoc = ItemLoc<Import>;
|
||||
impl_intern!(ImportId, ImportLoc, intern_import, lookup_intern_import);
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Ord, PartialOrd)]
|
||||
pub struct ExternCrateId(salsa::InternId);
|
||||
type ExternCrateLoc = ItemLoc<ExternCrate>;
|
||||
impl_intern!(ExternCrateId, ExternCrateLoc, intern_extern_crate, lookup_intern_extern_crate);
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Ord, PartialOrd)]
|
||||
pub struct ExternBlockId(salsa::InternId);
|
||||
type ExternBlockLoc = ItemLoc<ExternBlock>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue