From 6636f56e79b55f22b88094b7edaed6ec88880500 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 00:23:03 +0200 Subject: Rename ModuleItem -> Item --- crates/ra_hir_def/src/item_tree.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_hir_def/src/item_tree.rs') diff --git a/crates/ra_hir_def/src/item_tree.rs b/crates/ra_hir_def/src/item_tree.rs index da79d8ffd..615c1e14c 100644 --- a/crates/ra_hir_def/src/item_tree.rs +++ b/crates/ra_hir_def/src/item_tree.rs @@ -70,7 +70,7 @@ impl GenericParamsId { pub struct ItemTree { top_level: SmallVec<[ModItem; 1]>, attrs: FxHashMap, - inner_items: FxHashMap, SmallVec<[ModItem; 1]>>, + inner_items: FxHashMap, SmallVec<[ModItem; 1]>>, data: Option>, } @@ -187,7 +187,7 @@ impl ItemTree { /// /// Most AST items are lowered to a single `ModItem`, but some (eg. `use` items) may be lowered /// to multiple items in the `ItemTree`. - pub fn inner_items(&self, ast: FileAstId) -> &[ModItem] { + pub fn inner_items(&self, ast: FileAstId) -> &[ModItem] { &self.inner_items[&ast] } @@ -310,7 +310,7 @@ from_attrs!(ModItem(ModItem), Variant(Idx), Field(Idx)); /// Trait implemented by all item nodes in the item tree. pub trait ItemTreeNode: Clone { - type Source: AstNode + Into; + type Source: AstNode + Into; fn ast_id(&self) -> FileAstId; -- cgit v1.2.3 From d032f872b619c651dc66bfd669ef783108fc122c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 12:26:57 +0200 Subject: Finish extern crates grammar --- crates/ra_hir_def/src/item_tree.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_hir_def/src/item_tree.rs') diff --git a/crates/ra_hir_def/src/item_tree.rs b/crates/ra_hir_def/src/item_tree.rs index 615c1e14c..4db7b2793 100644 --- a/crates/ra_hir_def/src/item_tree.rs +++ b/crates/ra_hir_def/src/item_tree.rs @@ -412,7 +412,7 @@ macro_rules! mod_items { mod_items! { Import in imports -> ast::UseItem, - ExternCrate in extern_crates -> ast::ExternCrateItem, + ExternCrate in extern_crates -> ast::ExternCrate, Function in functions -> ast::FnDef, Struct in structs -> ast::StructDef, Union in unions -> ast::UnionDef, @@ -492,7 +492,7 @@ pub struct ExternCrate { pub visibility: RawVisibilityId, /// Whether this is a `#[macro_use] extern crate ...`. pub is_macro_use: bool, - pub ast_id: FileAstId, + pub ast_id: FileAstId, } #[derive(Debug, Clone, Eq, PartialEq)] -- cgit v1.2.3 From b1332670c7c471a59f3da113b366e74ac194c38b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 14:12:04 +0200 Subject: Rename UseItem -> Use --- crates/ra_hir_def/src/item_tree.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_hir_def/src/item_tree.rs') diff --git a/crates/ra_hir_def/src/item_tree.rs b/crates/ra_hir_def/src/item_tree.rs index 4db7b2793..0bab9c6d8 100644 --- a/crates/ra_hir_def/src/item_tree.rs +++ b/crates/ra_hir_def/src/item_tree.rs @@ -411,7 +411,7 @@ macro_rules! mod_items { } mod_items! { - Import in imports -> ast::UseItem, + Import in imports -> ast::Use, ExternCrate in extern_crates -> ast::ExternCrate, Function in functions -> ast::FnDef, Struct in structs -> ast::StructDef, @@ -482,7 +482,7 @@ pub struct Import { pub is_prelude: bool, /// AST ID of the `use` or `extern crate` item this import was derived from. Note that many /// `Import`s can map to the same `use` item. - pub ast_id: FileAstId, + pub ast_id: FileAstId, } #[derive(Debug, Clone, Eq, PartialEq)] -- cgit v1.2.3 From 1142112c70b705f59b7d559d9d72cdc831865158 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 14:51:08 +0200 Subject: Rename FnDef -> Fn --- crates/ra_hir_def/src/item_tree.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_hir_def/src/item_tree.rs') diff --git a/crates/ra_hir_def/src/item_tree.rs b/crates/ra_hir_def/src/item_tree.rs index 0bab9c6d8..34fc9ff8e 100644 --- a/crates/ra_hir_def/src/item_tree.rs +++ b/crates/ra_hir_def/src/item_tree.rs @@ -413,7 +413,7 @@ macro_rules! mod_items { mod_items! { Import in imports -> ast::Use, ExternCrate in extern_crates -> ast::ExternCrate, - Function in functions -> ast::FnDef, + Function in functions -> ast::Fn, Struct in structs -> ast::StructDef, Union in unions -> ast::UnionDef, Enum in enums -> ast::EnumDef, @@ -505,7 +505,7 @@ pub struct Function { pub params: Box<[TypeRef]>, pub is_varargs: bool, pub ret_type: TypeRef, - pub ast_id: FileAstId, + pub ast_id: FileAstId, } #[derive(Debug, Clone, Eq, PartialEq)] -- cgit v1.2.3 From eb2f8063444b11257111f4f8ade990ec810e0361 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 15:25:46 +0200 Subject: Rename TypeAliasDef -> TypeAlias --- crates/ra_hir_def/src/item_tree.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_hir_def/src/item_tree.rs') diff --git a/crates/ra_hir_def/src/item_tree.rs b/crates/ra_hir_def/src/item_tree.rs index 34fc9ff8e..ea61ac217 100644 --- a/crates/ra_hir_def/src/item_tree.rs +++ b/crates/ra_hir_def/src/item_tree.rs @@ -421,7 +421,7 @@ mod_items! { Static in statics -> ast::StaticDef, Trait in traits -> ast::TraitDef, Impl in impls -> ast::ImplDef, - TypeAlias in type_aliases -> ast::TypeAliasDef, + TypeAlias in type_aliases -> ast::TypeAlias, Mod in mods -> ast::Module, MacroCall in macro_calls -> ast::MacroCall, } @@ -592,7 +592,7 @@ pub struct TypeAlias { pub bounds: Box<[TypeBound]>, pub generic_params: GenericParamsId, pub type_ref: Option, - pub ast_id: FileAstId, + pub ast_id: FileAstId, } #[derive(Debug, Clone, Eq, PartialEq)] -- cgit v1.2.3 From 1ae4721c9cfea746fce59a816b1c266bf373d6cf Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 17:36:46 +0200 Subject: Finalize union grammar --- crates/ra_hir_def/src/item_tree.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_hir_def/src/item_tree.rs') diff --git a/crates/ra_hir_def/src/item_tree.rs b/crates/ra_hir_def/src/item_tree.rs index ea61ac217..7bcc13b06 100644 --- a/crates/ra_hir_def/src/item_tree.rs +++ b/crates/ra_hir_def/src/item_tree.rs @@ -415,7 +415,7 @@ mod_items! { ExternCrate in extern_crates -> ast::ExternCrate, Function in functions -> ast::Fn, Struct in structs -> ast::StructDef, - Union in unions -> ast::UnionDef, + Union in unions -> ast::Union, Enum in enums -> ast::EnumDef, Const in consts -> ast::ConstDef, Static in statics -> ast::StaticDef, @@ -534,7 +534,7 @@ pub struct Union { pub visibility: RawVisibilityId, pub generic_params: GenericParamsId, pub fields: Fields, - pub ast_id: FileAstId, + pub ast_id: FileAstId, } #[derive(Debug, Clone, Eq, PartialEq)] -- cgit v1.2.3 From 216a5344c8ef3c3e430d2761dc8b1a7b60250a15 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 17:50:40 +0200 Subject: Rename StructDef -> Struct --- crates/ra_hir_def/src/item_tree.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_hir_def/src/item_tree.rs') diff --git a/crates/ra_hir_def/src/item_tree.rs b/crates/ra_hir_def/src/item_tree.rs index 7bcc13b06..6b96a4c20 100644 --- a/crates/ra_hir_def/src/item_tree.rs +++ b/crates/ra_hir_def/src/item_tree.rs @@ -414,7 +414,7 @@ mod_items! { Import in imports -> ast::Use, ExternCrate in extern_crates -> ast::ExternCrate, Function in functions -> ast::Fn, - Struct in structs -> ast::StructDef, + Struct in structs -> ast::Struct, Union in unions -> ast::Union, Enum in enums -> ast::EnumDef, Const in consts -> ast::ConstDef, @@ -514,7 +514,7 @@ pub struct Struct { pub visibility: RawVisibilityId, pub generic_params: GenericParamsId, pub fields: Fields, - pub ast_id: FileAstId, + pub ast_id: FileAstId, pub kind: StructDefKind, } -- cgit v1.2.3 From 609680ef97dbf82c07b6b06e21aa366423892304 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 17:52:53 +0200 Subject: Rename EnumDef -> Enum --- crates/ra_hir_def/src/item_tree.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_hir_def/src/item_tree.rs') diff --git a/crates/ra_hir_def/src/item_tree.rs b/crates/ra_hir_def/src/item_tree.rs index 6b96a4c20..24ad41187 100644 --- a/crates/ra_hir_def/src/item_tree.rs +++ b/crates/ra_hir_def/src/item_tree.rs @@ -416,7 +416,7 @@ mod_items! { Function in functions -> ast::Fn, Struct in structs -> ast::Struct, Union in unions -> ast::Union, - Enum in enums -> ast::EnumDef, + Enum in enums -> ast::Enum, Const in consts -> ast::ConstDef, Static in statics -> ast::StaticDef, Trait in traits -> ast::TraitDef, @@ -543,7 +543,7 @@ pub struct Enum { pub visibility: RawVisibilityId, pub generic_params: GenericParamsId, pub variants: IdRange, - pub ast_id: FileAstId, + pub ast_id: FileAstId, } #[derive(Debug, Clone, Eq, PartialEq)] -- cgit v1.2.3 From 3cd4112bdc924c132cb0eab9d064511a215421ec Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 18:02:20 +0200 Subject: Finalize const&static grammar --- crates/ra_hir_def/src/item_tree.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/ra_hir_def/src/item_tree.rs') diff --git a/crates/ra_hir_def/src/item_tree.rs b/crates/ra_hir_def/src/item_tree.rs index 24ad41187..c478a9909 100644 --- a/crates/ra_hir_def/src/item_tree.rs +++ b/crates/ra_hir_def/src/item_tree.rs @@ -417,8 +417,8 @@ mod_items! { Struct in structs -> ast::Struct, Union in unions -> ast::Union, Enum in enums -> ast::Enum, - Const in consts -> ast::ConstDef, - Static in statics -> ast::StaticDef, + Const in consts -> ast::Const, + Static in statics -> ast::Static, Trait in traits -> ast::TraitDef, Impl in impls -> ast::ImplDef, TypeAlias in type_aliases -> ast::TypeAlias, @@ -552,7 +552,7 @@ pub struct Const { pub name: Option, pub visibility: RawVisibilityId, pub type_ref: TypeRef, - pub ast_id: FileAstId, + pub ast_id: FileAstId, } #[derive(Debug, Clone, Eq, PartialEq)] @@ -561,7 +561,7 @@ pub struct Static { pub visibility: RawVisibilityId, pub mutable: bool, pub type_ref: TypeRef, - pub ast_id: FileAstId, + pub ast_id: FileAstId, } #[derive(Debug, Clone, Eq, PartialEq)] -- cgit v1.2.3 From c83467796b6c7365ea4f41900d74444384a9e618 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 18:17:28 +0200 Subject: Finalize Trait grammar --- crates/ra_hir_def/src/item_tree.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_hir_def/src/item_tree.rs') diff --git a/crates/ra_hir_def/src/item_tree.rs b/crates/ra_hir_def/src/item_tree.rs index c478a9909..11002b1ad 100644 --- a/crates/ra_hir_def/src/item_tree.rs +++ b/crates/ra_hir_def/src/item_tree.rs @@ -419,7 +419,7 @@ mod_items! { Enum in enums -> ast::Enum, Const in consts -> ast::Const, Static in statics -> ast::Static, - Trait in traits -> ast::TraitDef, + Trait in traits -> ast::Trait, Impl in impls -> ast::ImplDef, TypeAlias in type_aliases -> ast::TypeAlias, Mod in mods -> ast::Module, @@ -571,7 +571,7 @@ pub struct Trait { pub generic_params: GenericParamsId, pub auto: bool, pub items: Box<[AssocItem]>, - pub ast_id: FileAstId, + pub ast_id: FileAstId, } #[derive(Debug, Clone, Eq, PartialEq)] -- cgit v1.2.3 From c5798c4d75aa807aec47208a49101bdec3affcca Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 18:28:28 +0200 Subject: Finalize impl Grammar --- crates/ra_hir_def/src/item_tree.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_hir_def/src/item_tree.rs') diff --git a/crates/ra_hir_def/src/item_tree.rs b/crates/ra_hir_def/src/item_tree.rs index 11002b1ad..63b56405c 100644 --- a/crates/ra_hir_def/src/item_tree.rs +++ b/crates/ra_hir_def/src/item_tree.rs @@ -420,7 +420,7 @@ mod_items! { Const in consts -> ast::Const, Static in statics -> ast::Static, Trait in traits -> ast::Trait, - Impl in impls -> ast::ImplDef, + Impl in impls -> ast::Impl, TypeAlias in type_aliases -> ast::TypeAlias, Mod in mods -> ast::Module, MacroCall in macro_calls -> ast::MacroCall, @@ -581,7 +581,7 @@ pub struct Impl { pub target_type: TypeRef, pub is_negative: bool, pub items: Box<[AssocItem]>, - pub ast_id: FileAstId, + pub ast_id: FileAstId, } #[derive(Debug, Clone, PartialEq, Eq)] -- cgit v1.2.3 From 2e2642efccd5855e4158b01a006e7884a96982bb Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 20:51:43 +0200 Subject: Remove TypeAscriptionOwner --- crates/ra_hir_def/src/item_tree.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_hir_def/src/item_tree.rs') diff --git a/crates/ra_hir_def/src/item_tree.rs b/crates/ra_hir_def/src/item_tree.rs index 63b56405c..a67e75dac 100644 --- a/crates/ra_hir_def/src/item_tree.rs +++ b/crates/ra_hir_def/src/item_tree.rs @@ -13,7 +13,7 @@ use std::{ sync::Arc, }; -use ast::{AstNode, AttrsOwner, NameOwner, StructKind, TypeAscriptionOwner}; +use ast::{AstNode, AttrsOwner, NameOwner, StructKind}; use either::Either; use hir_expand::{ ast_id_map::FileAstId, -- cgit v1.2.3