From 78f10fcdc41d5c58e386bc99a94b34a2bdbaa4cd Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 25 Feb 2019 13:38:52 +0300 Subject: rename type to type_alias in the AST as well --- crates/ra_hir/src/code_model_api.rs | 5 +- crates/ra_hir/src/ids.rs | 6 +- crates/ra_hir/src/impl_block.rs | 2 +- crates/ra_hir/src/nameres/lower.rs | 2 +- crates/ra_ide_api/src/completion.rs | 2 +- crates/ra_ide_api/src/goto_definition.rs | 4 +- crates/ra_ide_api/src/hover.rs | 4 +- crates/ra_ide_api/src/symbol_index.rs | 4 +- .../src/snapshots/tests__file_structure.snap | 2 +- .../src/snapshots/tests__file_structure.snap.new | 182 +++++++++++++++++++++ crates/ra_ide_api_light/src/structure.rs | 2 +- crates/ra_lsp_server/src/conv.rs | 2 +- crates/ra_parser/src/grammar/items.rs | 2 +- crates/ra_parser/src/syntax_kind/generated.rs | 4 +- crates/ra_syntax/src/ast/generated.rs | 94 +++++------ crates/ra_syntax/src/grammar.ron | 8 +- crates/ra_syntax/src/parsing/text_tree_sink.rs | 2 +- .../inline/err/0001_array_type_missing_semi.txt | 2 +- .../inline/err/0003_pointer_type_no_mutability.txt | 2 +- .../inline/err/0005_fn_pointer_type_missing_fn.txt | 2 +- .../data/parser/inline/ok/0001_trait_item_list.txt | 2 +- .../ok/0004_value_parameters_no_patterns.txt | 2 +- .../inline/ok/0012_type_item_where_clause.txt | 2 +- .../parser/inline/ok/0013_pointer_type_mut.txt | 4 +- .../data/parser/inline/ok/0014_never_type.txt | 2 +- .../data/parser/inline/ok/0017_array_type.txt | 2 +- .../data/parser/inline/ok/0021_impl_item_list.txt | 2 +- .../parser/inline/ok/0023_placeholder_type.txt | 2 +- .../data/parser/inline/ok/0025_slice_type.txt | 2 +- .../data/parser/inline/ok/0028_impl_trait_type.txt | 2 +- .../data/parser/inline/ok/0032_fn_pointer_type.txt | 6 +- .../data/parser/inline/ok/0033_reference_type;.txt | 6 +- .../data/parser/inline/ok/0037_qual_paths.txt | 2 +- .../tests/data/parser/inline/ok/0039_type_arg.txt | 2 +- .../parser/inline/ok/0046_singleton_tuple_type.txt | 2 +- .../tests/data/parser/inline/ok/0051_unit_type.txt | 2 +- .../tests/data/parser/inline/ok/0052_path_type.txt | 8 +- .../data/parser/inline/ok/0065_dyn_trait_type.txt | 2 +- .../inline/ok/0073_type_item_type_params.txt | 2 +- .../tests/data/parser/inline/ok/0078_type_item.txt | 2 +- .../tests/data/parser/inline/ok/0081_for_type.txt | 2 +- .../data/parser/inline/ok/0084_paren_type.txt | 2 +- .../inline/ok/0092_fn_pointer_type_with_ret.txt | 2 +- .../parser/inline/ok/0104_path_fn_trait_args.txt | 2 +- .../data/parser/inline/ok/0117_macro_call_type.txt | 4 +- 45 files changed, 293 insertions(+), 108 deletions(-) create mode 100644 crates/ra_ide_api_light/src/snapshots/tests__file_structure.snap.new (limited to 'crates') diff --git a/crates/ra_hir/src/code_model_api.rs b/crates/ra_hir/src/code_model_api.rs index 278407504..9a44aaa43 100644 --- a/crates/ra_hir/src/code_model_api.rs +++ b/crates/ra_hir/src/code_model_api.rs @@ -619,7 +619,10 @@ pub struct TypeAlias { } impl TypeAlias { - pub fn source(&self, db: &impl PersistentHirDatabase) -> (HirFileId, TreeArc) { + pub fn source( + &self, + db: &impl PersistentHirDatabase, + ) -> (HirFileId, TreeArc) { self.id.source(db) } diff --git a/crates/ra_hir/src/ids.rs b/crates/ra_hir/src/ids.rs index 6df037859..5b00330c6 100644 --- a/crates/ra_hir/src/ids.rs +++ b/crates/ra_hir/src/ids.rs @@ -22,7 +22,7 @@ pub struct HirInterner { consts: LocationIntener, ConstId>, statics: LocationIntener, StaticId>, traits: LocationIntener, TraitId>, - types: LocationIntener, TypeId>, + types: LocationIntener, TypeId>, } impl HirInterner { @@ -278,8 +278,8 @@ impl AstItemDef for TraitId { #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct TypeId(RawId); impl_arena_id!(TypeId); -impl AstItemDef for TypeId { - fn interner(interner: &HirInterner) -> &LocationIntener, Self> { +impl AstItemDef for TypeId { + fn interner(interner: &HirInterner) -> &LocationIntener, Self> { &interner.types } } diff --git a/crates/ra_hir/src/impl_block.rs b/crates/ra_hir/src/impl_block.rs index 2f3c916fd..eb2d4ed8d 100644 --- a/crates/ra_hir/src/impl_block.rs +++ b/crates/ra_hir/src/impl_block.rs @@ -137,7 +137,7 @@ impl ImplData { .map(|item_node| match item_node.kind() { ast::ImplItemKind::FnDef(it) => Function { id: ctx.to_def(it) }.into(), ast::ImplItemKind::ConstDef(it) => Const { id: ctx.to_def(it) }.into(), - ast::ImplItemKind::TypeDef(it) => TypeAlias { id: ctx.to_def(it) }.into(), + ast::ImplItemKind::TypeAliasDef(it) => TypeAlias { id: ctx.to_def(it) }.into(), }) .collect() } else { diff --git a/crates/ra_hir/src/nameres/lower.rs b/crates/ra_hir/src/nameres/lower.rs index 522f13b44..2bc3eb60c 100644 --- a/crates/ra_hir/src/nameres/lower.rs +++ b/crates/ra_hir/src/nameres/lower.rs @@ -167,7 +167,7 @@ impl LoweredModule { self.declarations.insert(name.as_name(), PerNs::types(t.into())); } } - ast::ModuleItemKind::TypeDef(it) => { + ast::ModuleItemKind::TypeAliasDef(it) => { if let Some(name) = it.name() { let t = TypeAlias { id: ctx.to_def(it) }; self.declarations.insert(name.as_name(), PerNs::types(t.into())); diff --git a/crates/ra_ide_api/src/completion.rs b/crates/ra_ide_api/src/completion.rs index c8022f94f..639942f7b 100644 --- a/crates/ra_ide_api/src/completion.rs +++ b/crates/ra_ide_api/src/completion.rs @@ -102,7 +102,7 @@ pub fn const_label(node: &ast::ConstDef) -> String { label.trim().to_owned() } -pub fn type_label(node: &ast::TypeDef) -> String { +pub fn type_label(node: &ast::TypeAliasDef) -> String { let label: String = node .syntax() .children() diff --git a/crates/ra_ide_api/src/goto_definition.rs b/crates/ra_ide_api/src/goto_definition.rs index 4dac96bfe..1833e57d5 100644 --- a/crates/ra_ide_api/src/goto_definition.rs +++ b/crates/ra_ide_api/src/goto_definition.rs @@ -141,7 +141,7 @@ fn named_target(file_id: FileId, node: &SyntaxNode) -> Option .visit(|node: &ast::EnumDef| NavigationTarget::from_named(file_id, node)) .visit(|node: &ast::EnumVariant| NavigationTarget::from_named(file_id, node)) .visit(|node: &ast::FnDef| NavigationTarget::from_named(file_id, node)) - .visit(|node: &ast::TypeDef| NavigationTarget::from_named(file_id, node)) + .visit(|node: &ast::TypeAliasDef| NavigationTarget::from_named(file_id, node)) .visit(|node: &ast::ConstDef| NavigationTarget::from_named(file_id, node)) .visit(|node: &ast::StaticDef| NavigationTarget::from_named(file_id, node)) .visit(|node: &ast::TraitDef| NavigationTarget::from_named(file_id, node)) @@ -327,7 +327,7 @@ mod tests { //- /lib.rs type Thing<|> = Option<()>; "#, - "Thing TYPE_DEF FileId(1) [0; 24) [5; 10)", + "Thing TYPE_ALIAS_DEF FileId(1) [0; 24) [5; 10)", ); check_goto( diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide_api/src/hover.rs index c62683ad4..364bf9f74 100644 --- a/crates/ra_ide_api/src/hover.rs +++ b/crates/ra_ide_api/src/hover.rs @@ -105,7 +105,7 @@ impl NavigationTarget { .visit(doc_comments::) .visit(doc_comments::) .visit(doc_comments::) - .visit(doc_comments::) + .visit(doc_comments::) .visit(doc_comments::) .visit(doc_comments::) .accept(&node)? @@ -135,7 +135,7 @@ impl NavigationTarget { .visit(|node: &ast::EnumDef| visit_node(node, "enum ")) .visit(|node: &ast::TraitDef| visit_node(node, "trait ")) .visit(|node: &ast::Module| visit_node(node, "mod ")) - .visit(|node: &ast::TypeDef| visit_node(node, "type ")) + .visit(|node: &ast::TypeAliasDef| visit_node(node, "type ")) .visit(|node: &ast::ConstDef| visit_node(node, "const ")) .visit(|node: &ast::StaticDef| visit_node(node, "static ")) .accept(&node)? diff --git a/crates/ra_ide_api/src/symbol_index.rs b/crates/ra_ide_api/src/symbol_index.rs index 93bdf05d8..414327ac2 100644 --- a/crates/ra_ide_api/src/symbol_index.rs +++ b/crates/ra_ide_api/src/symbol_index.rs @@ -196,7 +196,7 @@ impl Query { fn is_type(kind: SyntaxKind) -> bool { match kind { - STRUCT_DEF | ENUM_DEF | TRAIT_DEF | TYPE_DEF => true, + STRUCT_DEF | ENUM_DEF | TRAIT_DEF | TYPE_ALIAS_DEF => true, _ => false, } } @@ -253,7 +253,7 @@ fn to_symbol(node: &SyntaxNode) -> Option<(SmolStr, SyntaxNodePtr, TextRange)> { .visit(decl::) .visit(decl::) .visit(decl::) - .visit(decl::) + .visit(decl::) .visit(decl::) .visit(decl::) .accept(node)? diff --git a/crates/ra_ide_api_light/src/snapshots/tests__file_structure.snap b/crates/ra_ide_api_light/src/snapshots/tests__file_structure.snap index 413f4a5ff..8e4184b31 100644 --- a/crates/ra_ide_api_light/src/snapshots/tests__file_structure.snap +++ b/crates/ra_ide_api_light/src/snapshots/tests__file_structure.snap @@ -111,7 +111,7 @@ expression: structure label: "T", navigation_range: [186; 187), node_range: [181; 193), - kind: TYPE_DEF, + kind: TYPE_ALIAS_DEF, detail: Some( "()" ), diff --git a/crates/ra_ide_api_light/src/snapshots/tests__file_structure.snap.new b/crates/ra_ide_api_light/src/snapshots/tests__file_structure.snap.new new file mode 100644 index 000000000..a3c6cd9ce --- /dev/null +++ b/crates/ra_ide_api_light/src/snapshots/tests__file_structure.snap.new @@ -0,0 +1,182 @@ +--- +created: "2019-02-25T10:38:16.909647631Z" +creator: insta@0.6.3 +source: crates/ra_ide_api_light/src/structure.rs +expression: structure +--- +[ + StructureNode { + parent: None, + label: "Foo", + navigation_range: [8; 11), + node_range: [1; 26), + kind: STRUCT_DEF, + detail: None, + deprecated: false + }, + StructureNode { + parent: Some( + 0 + ), + label: "x", + navigation_range: [18; 19), + node_range: [18; 24), + kind: NAMED_FIELD_DEF, + detail: Some( + "i32" + ), + deprecated: false + }, + StructureNode { + parent: None, + label: "m", + navigation_range: [32; 33), + node_range: [28; 158), + kind: MODULE, + detail: None, + deprecated: false + }, + StructureNode { + parent: Some( + 2 + ), + label: "bar1", + navigation_range: [43; 47), + node_range: [40; 52), + kind: FN_DEF, + detail: Some( + "fn()" + ), + deprecated: false + }, + StructureNode { + parent: Some( + 2 + ), + label: "bar2", + navigation_range: [60; 64), + node_range: [57; 81), + kind: FN_DEF, + detail: Some( + "fn(t: T) -> T" + ), + deprecated: false + }, + StructureNode { + parent: Some( + 2 + ), + label: "bar3", + navigation_range: [89; 93), + node_range: [86; 156), + kind: FN_DEF, + detail: Some( + "fn(a: A, b: B) -> Vec< u32 >" + ), + deprecated: false + }, + StructureNode { + parent: None, + label: "E", + navigation_range: [165; 166), + node_range: [160; 180), + kind: ENUM_DEF, + detail: None, + deprecated: false + }, + StructureNode { + parent: Some( + 6 + ), + label: "X", + navigation_range: [169; 170), + node_range: [169; 170), + kind: ENUM_VARIANT, + detail: None, + deprecated: false + }, + StructureNode { + parent: Some( + 6 + ), + label: "Y", + navigation_range: [172; 173), + node_range: [172; 178), + kind: ENUM_VARIANT, + detail: None, + deprecated: false + }, + StructureNode { + parent: None, + label: "T", + navigation_range: [186; 187), + node_range: [181; 193), + kind: TYPE_ALIAS_DEF, + detail: Some( + "()" + ), + deprecated: false + }, + StructureNode { + parent: None, + label: "S", + navigation_range: [201; 202), + node_range: [194; 213), + kind: STATIC_DEF, + detail: Some( + "i32" + ), + deprecated: false + }, + StructureNode { + parent: None, + label: "C", + navigation_range: [220; 221), + node_range: [214; 232), + kind: CONST_DEF, + detail: Some( + "i32" + ), + deprecated: false + }, + StructureNode { + parent: None, + label: "impl E", + navigation_range: [239; 240), + node_range: [234; 243), + kind: IMPL_BLOCK, + detail: None, + deprecated: false + }, + StructureNode { + parent: None, + label: "impl fmt::Debug for E", + navigation_range: [265; 266), + node_range: [245; 269), + kind: IMPL_BLOCK, + detail: None, + deprecated: false + }, + StructureNode { + parent: None, + label: "obsolete", + navigation_range: [288; 296), + node_range: [271; 301), + kind: FN_DEF, + detail: Some( + "fn()" + ), + deprecated: true + }, + StructureNode { + parent: None, + label: "very_obsolete", + navigation_range: [341; 354), + node_range: [303; 359), + kind: FN_DEF, + detail: Some( + "fn()" + ), + deprecated: true + } +] diff --git a/crates/ra_ide_api_light/src/structure.rs b/crates/ra_ide_api_light/src/structure.rs index 75afd1181..dea494daa 100644 --- a/crates/ra_ide_api_light/src/structure.rs +++ b/crates/ra_ide_api_light/src/structure.rs @@ -112,7 +112,7 @@ fn structure_node(node: &SyntaxNode) -> Option { .visit(decl::) .visit(decl::) .visit(decl::) - .visit(|td: &ast::TypeDef| decl_with_type_ref(td, td.type_ref())) + .visit(|td: &ast::TypeAliasDef| decl_with_type_ref(td, td.type_ref())) .visit(|cd: &ast::ConstDef| decl_with_type_ref(cd, cd.type_ref())) .visit(|sd: &ast::StaticDef| decl_with_type_ref(sd, sd.type_ref())) .visit(|im: &ast::ImplBlock| { diff --git a/crates/ra_lsp_server/src/conv.rs b/crates/ra_lsp_server/src/conv.rs index f0f67b663..41f78e58d 100644 --- a/crates/ra_lsp_server/src/conv.rs +++ b/crates/ra_lsp_server/src/conv.rs @@ -41,7 +41,7 @@ impl Conv for SyntaxKind { SyntaxKind::ENUM_DEF => SymbolKind::Enum, SyntaxKind::TRAIT_DEF => SymbolKind::Interface, SyntaxKind::MODULE => SymbolKind::Module, - SyntaxKind::TYPE_DEF => SymbolKind::TypeParameter, + SyntaxKind::TYPE_ALIAS_DEF => SymbolKind::TypeParameter, SyntaxKind::STATIC_DEF => SymbolKind::Constant, SyntaxKind::CONST_DEF => SymbolKind::Constant, SyntaxKind::IMPL_BLOCK => SymbolKind::Object, diff --git a/crates/ra_parser/src/grammar/items.rs b/crates/ra_parser/src/grammar/items.rs index 4b962c1f3..ab9d2de90 100644 --- a/crates/ra_parser/src/grammar/items.rs +++ b/crates/ra_parser/src/grammar/items.rs @@ -173,7 +173,7 @@ fn items_without_modifiers(p: &mut Parser) -> Option { } TYPE_KW => { type_def(p); - TYPE_DEF + TYPE_ALIAS_DEF } MOD_KW => { mod_item(p); diff --git a/crates/ra_parser/src/syntax_kind/generated.rs b/crates/ra_parser/src/syntax_kind/generated.rs index 1d8f988ae..0eed44ecf 100644 --- a/crates/ra_parser/src/syntax_kind/generated.rs +++ b/crates/ra_parser/src/syntax_kind/generated.rs @@ -130,7 +130,7 @@ pub enum SyntaxKind { CONST_DEF, TRAIT_DEF, IMPL_BLOCK, - TYPE_DEF, + TYPE_ALIAS_DEF, MACRO_CALL, TOKEN_TREE, PAREN_TYPE, @@ -467,7 +467,7 @@ impl SyntaxKind { CONST_DEF => &SyntaxInfo { name: "CONST_DEF" }, TRAIT_DEF => &SyntaxInfo { name: "TRAIT_DEF" }, IMPL_BLOCK => &SyntaxInfo { name: "IMPL_BLOCK" }, - TYPE_DEF => &SyntaxInfo { name: "TYPE_DEF" }, + TYPE_ALIAS_DEF => &SyntaxInfo { name: "TYPE_ALIAS_DEF" }, MACRO_CALL => &SyntaxInfo { name: "MACRO_CALL" }, TOKEN_TREE => &SyntaxInfo { name: "TOKEN_TREE" }, PAREN_TYPE => &SyntaxInfo { name: "PAREN_TYPE" }, diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs index aa88b1e28..4e2705d09 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs @@ -1508,7 +1508,7 @@ unsafe impl TransparentNewType for ImplItem { #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum ImplItemKind<'a> { FnDef(&'a FnDef), - TypeDef(&'a TypeDef), + TypeAliasDef(&'a TypeAliasDef), ConstDef(&'a ConstDef), } impl<'a> From<&'a FnDef> for &'a ImplItem { @@ -1516,8 +1516,8 @@ impl<'a> From<&'a FnDef> for &'a ImplItem { ImplItem::cast(&n.syntax).unwrap() } } -impl<'a> From<&'a TypeDef> for &'a ImplItem { - fn from(n: &'a TypeDef) -> &'a ImplItem { +impl<'a> From<&'a TypeAliasDef> for &'a ImplItem { + fn from(n: &'a TypeAliasDef) -> &'a ImplItem { ImplItem::cast(&n.syntax).unwrap() } } @@ -1532,7 +1532,7 @@ impl AstNode for ImplItem { fn cast(syntax: &SyntaxNode) -> Option<&Self> { match syntax.kind() { | FN_DEF - | TYPE_DEF + | TYPE_ALIAS_DEF | CONST_DEF => Some(ImplItem::from_repr(syntax.into_repr())), _ => None, } @@ -1549,7 +1549,7 @@ impl ImplItem { pub fn kind(&self) -> ImplItemKind { match self.syntax.kind() { FN_DEF => ImplItemKind::FnDef(FnDef::cast(&self.syntax).unwrap()), - TYPE_DEF => ImplItemKind::TypeDef(TypeDef::cast(&self.syntax).unwrap()), + TYPE_ALIAS_DEF => ImplItemKind::TypeAliasDef(TypeAliasDef::cast(&self.syntax).unwrap()), CONST_DEF => ImplItemKind::ConstDef(ConstDef::cast(&self.syntax).unwrap()), _ => unreachable!(), } @@ -2359,7 +2359,7 @@ pub enum ModuleItemKind<'a> { EnumDef(&'a EnumDef), FnDef(&'a FnDef), TraitDef(&'a TraitDef), - TypeDef(&'a TypeDef), + TypeAliasDef(&'a TypeAliasDef), ImplBlock(&'a ImplBlock), UseItem(&'a UseItem), ExternCrateItem(&'a ExternCrateItem), @@ -2387,8 +2387,8 @@ impl<'a> From<&'a TraitDef> for &'a ModuleItem { ModuleItem::cast(&n.syntax).unwrap() } } -impl<'a> From<&'a TypeDef> for &'a ModuleItem { - fn from(n: &'a TypeDef) -> &'a ModuleItem { +impl<'a> From<&'a TypeAliasDef> for &'a ModuleItem { + fn from(n: &'a TypeAliasDef) -> &'a ModuleItem { ModuleItem::cast(&n.syntax).unwrap() } } @@ -2431,7 +2431,7 @@ impl AstNode for ModuleItem { | ENUM_DEF | FN_DEF | TRAIT_DEF - | TYPE_DEF + | TYPE_ALIAS_DEF | IMPL_BLOCK | USE_ITEM | EXTERN_CRATE_ITEM @@ -2456,7 +2456,7 @@ impl ModuleItem { ENUM_DEF => ModuleItemKind::EnumDef(EnumDef::cast(&self.syntax).unwrap()), FN_DEF => ModuleItemKind::FnDef(FnDef::cast(&self.syntax).unwrap()), TRAIT_DEF => ModuleItemKind::TraitDef(TraitDef::cast(&self.syntax).unwrap()), - TYPE_DEF => ModuleItemKind::TypeDef(TypeDef::cast(&self.syntax).unwrap()), + TYPE_ALIAS_DEF => ModuleItemKind::TypeAliasDef(TypeAliasDef::cast(&self.syntax).unwrap()), IMPL_BLOCK => ModuleItemKind::ImplBlock(ImplBlock::cast(&self.syntax).unwrap()), USE_ITEM => ModuleItemKind::UseItem(UseItem::cast(&self.syntax).unwrap()), EXTERN_CRATE_ITEM => ModuleItemKind::ExternCrateItem(ExternCrateItem::cast(&self.syntax).unwrap()), @@ -4273,6 +4273,43 @@ impl TupleType { } } +// TypeAliasDef +#[derive(Debug, PartialEq, Eq, Hash)] +#[repr(transparent)] +pub struct TypeAliasDef { + pub(crate) syntax: SyntaxNode, +} +unsafe impl TransparentNewType for TypeAliasDef { + type Repr = rowan::SyntaxNode; +} + +impl AstNode for TypeAliasDef { + fn cast(syntax: &SyntaxNode) -> Option<&Self> { + match syntax.kind() { + TYPE_ALIAS_DEF => Some(TypeAliasDef::from_repr(syntax.into_repr())), + _ => None, + } + } + fn syntax(&self) -> &SyntaxNode { &self.syntax } +} + +impl ToOwned for TypeAliasDef { + type Owned = TreeArc; + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } +} + + +impl ast::VisibilityOwner for TypeAliasDef {} +impl ast::NameOwner for TypeAliasDef {} +impl ast::TypeParamsOwner for TypeAliasDef {} +impl ast::AttrsOwner for TypeAliasDef {} +impl ast::DocCommentsOwner for TypeAliasDef {} +impl TypeAliasDef { + pub fn type_ref(&self) -> Option<&TypeRef> { + super::child_opt(self) + } +} + // TypeArg #[derive(Debug, PartialEq, Eq, Hash)] #[repr(transparent)] @@ -4345,43 +4382,6 @@ impl TypeArgList { } } -// TypeDef -#[derive(Debug, PartialEq, Eq, Hash)] -#[repr(transparent)] -pub struct TypeDef { - pub(crate) syntax: SyntaxNode, -} -unsafe impl TransparentNewType for TypeDef { - type Repr = rowan::SyntaxNode; -} - -impl AstNode for TypeDef { - fn cast(syntax: &SyntaxNode) -> Option<&Self> { - match syntax.kind() { - TYPE_DEF => Some(TypeDef::from_repr(syntax.into_repr())), - _ => None, - } - } - fn syntax(&self) -> &SyntaxNode { &self.syntax } -} - -impl ToOwned for TypeDef { - type Owned = TreeArc; - fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } -} - - -impl ast::VisibilityOwner for TypeDef {} -impl ast::NameOwner for TypeDef {} -impl ast::TypeParamsOwner for TypeDef {} -impl ast::AttrsOwner for TypeDef {} -impl ast::DocCommentsOwner for TypeDef {} -impl TypeDef { - pub fn type_ref(&self) -> Option<&TypeRef> { - super::child_opt(self) - } -} - // TypeParam #[derive(Debug, PartialEq, Eq, Hash)] #[repr(transparent)] diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron index b1775d0f8..c7acbbd6c 100644 --- a/crates/ra_syntax/src/grammar.ron +++ b/crates/ra_syntax/src/grammar.ron @@ -132,7 +132,7 @@ Grammar( "CONST_DEF", "TRAIT_DEF", "IMPL_BLOCK", - "TYPE_DEF", + "TYPE_ALIAS_DEF", "MACRO_CALL", "TOKEN_TREE", @@ -312,7 +312,7 @@ Grammar( ], options: ["TypeRef"] ), - "TypeDef": ( + "TypeAliasDef": ( traits: [ "VisibilityOwner", "NameOwner", @@ -363,11 +363,11 @@ Grammar( ], ), "ModuleItem": ( - enum: ["StructDef", "EnumDef", "FnDef", "TraitDef", "TypeDef", "ImplBlock", + enum: ["StructDef", "EnumDef", "FnDef", "TraitDef", "TypeAliasDef", "ImplBlock", "UseItem", "ExternCrateItem", "ConstDef", "StaticDef", "Module" ] ), "ImplItem": ( - enum: ["FnDef", "TypeDef", "ConstDef"] + enum: ["FnDef", "TypeAliasDef", "ConstDef"] ), "TupleExpr": ( diff --git a/crates/ra_syntax/src/parsing/text_tree_sink.rs b/crates/ra_syntax/src/parsing/text_tree_sink.rs index 961a91d41..b17d06c61 100644 --- a/crates/ra_syntax/src/parsing/text_tree_sink.rs +++ b/crates/ra_syntax/src/parsing/text_tree_sink.rs @@ -143,7 +143,7 @@ fn n_attached_trivias<'a>( trivias: impl Iterator, ) -> usize { match kind { - CONST_DEF | TYPE_DEF | STRUCT_DEF | ENUM_DEF | ENUM_VARIANT | FN_DEF | TRAIT_DEF + CONST_DEF | TYPE_ALIAS_DEF | STRUCT_DEF | ENUM_DEF | ENUM_VARIANT | FN_DEF | TRAIT_DEF | MODULE | NAMED_FIELD_DEF => { let mut res = 0; for (i, (kind, text)) in trivias.enumerate() { diff --git a/crates/ra_syntax/tests/data/parser/inline/err/0001_array_type_missing_semi.txt b/crates/ra_syntax/tests/data/parser/inline/err/0001_array_type_missing_semi.txt index 036363587..f02027972 100644 --- a/crates/ra_syntax/tests/data/parser/inline/err/0001_array_type_missing_semi.txt +++ b/crates/ra_syntax/tests/data/parser/inline/err/0001_array_type_missing_semi.txt @@ -1,5 +1,5 @@ SOURCE_FILE@[0; 18) - TYPE_DEF@[0; 12) + TYPE_ALIAS_DEF@[0; 12) TYPE_KW@[0; 4) WHITESPACE@[4; 5) NAME@[5; 6) diff --git a/crates/ra_syntax/tests/data/parser/inline/err/0003_pointer_type_no_mutability.txt b/crates/ra_syntax/tests/data/parser/inline/err/0003_pointer_type_no_mutability.txt index 189aa563e..b11171fd0 100644 --- a/crates/ra_syntax/tests/data/parser/inline/err/0003_pointer_type_no_mutability.txt +++ b/crates/ra_syntax/tests/data/parser/inline/err/0003_pointer_type_no_mutability.txt @@ -1,5 +1,5 @@ SOURCE_FILE@[0; 14) - TYPE_DEF@[0; 13) + TYPE_ALIAS_DEF@[0; 13) TYPE_KW@[0; 4) WHITESPACE@[4; 5) NAME@[5; 6) diff --git a/crates/ra_syntax/tests/data/parser/inline/err/0005_fn_pointer_type_missing_fn.txt b/crates/ra_syntax/tests/data/parser/inline/err/0005_fn_pointer_type_missing_fn.txt index f97db4bff..ab879db03 100644 --- a/crates/ra_syntax/tests/data/parser/inline/err/0005_fn_pointer_type_missing_fn.txt +++ b/crates/ra_syntax/tests/data/parser/inline/err/0005_fn_pointer_type_missing_fn.txt @@ -1,5 +1,5 @@ SOURCE_FILE@[0; 20) - TYPE_DEF@[0; 15) + TYPE_ALIAS_DEF@[0; 15) TYPE_KW@[0; 4) WHITESPACE@[4; 5) NAME@[5; 6) diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0001_trait_item_list.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0001_trait_item_list.txt index de7df7312..7c9e1e621 100644 --- a/crates/ra_syntax/tests/data/parser/inline/ok/0001_trait_item_list.txt +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0001_trait_item_list.txt @@ -11,7 +11,7 @@ SOURCE_FILE@[0; 83) ITEM_LIST@[7; 82) L_CURLY@[7; 8) WHITESPACE@[8; 13) - TYPE_DEF@[13; 27) + TYPE_ALIAS_DEF@[13; 27) TYPE_KW@[13; 17) WHITESPACE@[17; 18) NAME@[18; 19) diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0004_value_parameters_no_patterns.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0004_value_parameters_no_patterns.txt index f2d7e866b..90284a2aa 100644 --- a/crates/ra_syntax/tests/data/parser/inline/ok/0004_value_parameters_no_patterns.txt +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0004_value_parameters_no_patterns.txt @@ -1,5 +1,5 @@ SOURCE_FILE@[0; 54) - TYPE_DEF@[0; 53) + TYPE_ALIAS_DEF@[0; 53) TYPE_KW@[0; 4) WHITESPACE@[4; 5) NAME@[5; 6) diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0012_type_item_where_clause.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0012_type_item_where_clause.txt index dbb705acf..9a5f46bab 100644 --- a/crates/ra_syntax/tests/data/parser/inline/ok/0012_type_item_where_clause.txt +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0012_type_item_where_clause.txt @@ -1,5 +1,5 @@ SOURCE_FILE@[0; 31) - TYPE_DEF@[0; 30) + TYPE_ALIAS_DEF@[0; 30) TYPE_KW@[0; 4) WHITESPACE@[4; 5) NAME@[5; 8) diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0013_pointer_type_mut.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0013_pointer_type_mut.txt index 149cd571d..8f1d9ca98 100644 --- a/crates/ra_syntax/tests/data/parser/inline/ok/0013_pointer_type_mut.txt +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0013_pointer_type_mut.txt @@ -1,5 +1,5 @@ SOURCE_FILE@[0; 36) - TYPE_DEF@[0; 17) + TYPE_ALIAS_DEF@[0; 17) TYPE_KW@[0; 4) WHITESPACE@[4; 5) NAME@[5; 6) @@ -16,7 +16,7 @@ SOURCE_FILE@[0; 36) R_PAREN@[15; 16) SEMI@[16; 17) WHITESPACE@[17; 18) - TYPE_DEF@[18; 35) + TYPE_ALIAS_DEF@[18; 35) TYPE_KW@[18; 22) WHITESPACE@[22; 23) NAME@[23; 24) diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0014_never_type.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0014_never_type.txt index e0cae644d..eaa6eb1c0 100644 --- a/crates/ra_syntax/tests/data/parser/inline/ok/0014_never_type.txt +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0014_never_type.txt @@ -1,5 +1,5 @@ SOURCE_FILE@[0; 16) - TYPE_DEF@[0; 15) + TYPE_ALIAS_DEF@[0; 15) TYPE_KW@[0; 4) WHITESPACE@[4; 5) NAME@[5; 10) diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0017_array_type.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0017_array_type.txt index 2c2b615fc..de09902bb 100644 --- a/crates/ra_syntax/tests/data/parser/inline/ok/0017_array_type.txt +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0017_array_type.txt @@ -1,5 +1,5 @@ SOURCE_FILE@[0; 19) - TYPE_DEF@[0; 18) + TYPE_ALIAS_DEF@[0; 18) TYPE_KW@[0; 4) WHITESPACE@[4; 5) NAME@[5; 6) diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0021_impl_item_list.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0021_impl_item_list.txt index 50426bdfe..08a0b786d 100644 --- a/crates/ra_syntax/tests/data/parser/inline/ok/0021_impl_item_list.txt +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0021_impl_item_list.txt @@ -11,7 +11,7 @@ SOURCE_FILE@[0; 89) ITEM_LIST@[7; 88) L_CURLY@[7; 8) WHITESPACE@[8; 13) - TYPE_DEF@[13; 26) + TYPE_ALIAS_DEF@[13; 26) TYPE_KW@[13; 17) WHITESPACE@[17; 18) NAME@[18; 19) diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0023_placeholder_type.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0023_placeholder_type.txt index 43ada95d4..bb9bb57ea 100644 --- a/crates/ra_syntax/tests/data/parser/inline/ok/0023_placeholder_type.txt +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0023_placeholder_type.txt @@ -1,5 +1,5 @@ SOURCE_FILE@[0; 22) - TYPE_DEF@[0; 21) + TYPE_ALIAS_DEF@[0; 21) TYPE_KW@[0; 4) WHITESPACE@[4; 5) NAME@[5; 16) diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0025_slice_type.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0025_slice_type.txt index db18c7139..c5f70ca3a 100644 --- a/crates/ra_syntax/tests/data/parser/inline/ok/0025_slice_type.txt +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0025_slice_type.txt @@ -1,5 +1,5 @@ SOURCE_FILE@[0; 15) - TYPE_DEF@[0; 14) + TYPE_ALIAS_DEF@[0; 14) TYPE_KW@[0; 4) WHITESPACE@[4; 5) NAME@[5; 6) diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0028_impl_trait_type.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0028_impl_trait_type.txt index efd4dd42a..3b676fb4c 100644 --- a/crates/ra_syntax/tests/data/parser/inline/ok/0028_impl_trait_type.txt +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0028_impl_trait_type.txt @@ -1,5 +1,5 @@ SOURCE_FILE@[0; 43) - TYPE_DEF@[0; 42) + TYPE_ALIAS_DEF@[0; 42) TYPE_KW@[0; 4) WHITESPACE@[4; 5) NAME@[5; 6) diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0032_fn_pointer_type.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0032_fn_pointer_type.txt index 0c508ec27..d0aa429fd 100644 --- a/crates/ra_syntax/tests/data/parser/inline/ok/0032_fn_pointer_type.txt +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0032_fn_pointer_type.txt @@ -1,5 +1,5 @@ SOURCE_FILE@[0; 70) - TYPE_DEF@[0; 14) + TYPE_ALIAS_DEF@[0; 14) TYPE_KW@[0; 4) WHITESPACE@[4; 5) NAME@[5; 6) @@ -14,7 +14,7 @@ SOURCE_FILE@[0; 70) R_PAREN@[12; 13) SEMI@[13; 14) WHITESPACE@[14; 15) - TYPE_DEF@[15; 36) + TYPE_ALIAS_DEF@[15; 36) TYPE_KW@[15; 19) WHITESPACE@[19; 20) NAME@[20; 21) @@ -31,7 +31,7 @@ SOURCE_FILE@[0; 70) R_PAREN@[34; 35) SEMI@[35; 36) WHITESPACE@[36; 37) - TYPE_DEF@[37; 69) + TYPE_ALIAS_DEF@[37; 69) TYPE_KW@[37; 41) WHITESPACE@[41; 42) NAME@[42; 43) diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0033_reference_type;.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0033_reference_type;.txt index 7f35254d1..c015dddeb 100644 --- a/crates/ra_syntax/tests/data/parser/inline/ok/0033_reference_type;.txt +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0033_reference_type;.txt @@ -1,5 +1,5 @@ SOURCE_FILE@[0; 54) - TYPE_DEF@[0; 13) + TYPE_ALIAS_DEF@[0; 13) TYPE_KW@[0; 4) WHITESPACE@[4; 5) NAME@[5; 6) @@ -14,7 +14,7 @@ SOURCE_FILE@[0; 54) R_PAREN@[11; 12) SEMI@[12; 13) WHITESPACE@[13; 14) - TYPE_DEF@[14; 35) + TYPE_ALIAS_DEF@[14; 35) TYPE_KW@[14; 18) WHITESPACE@[18; 19) NAME@[19; 20) @@ -31,7 +31,7 @@ SOURCE_FILE@[0; 54) R_PAREN@[33; 34) SEMI@[34; 35) WHITESPACE@[35; 36) - TYPE_DEF@[36; 53) + TYPE_ALIAS_DEF@[36; 53) TYPE_KW@[36; 40) WHITESPACE@[40; 41) NAME@[41; 42) diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0037_qual_paths.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0037_qual_paths.txt index 394fc7f5b..fbc548695 100644 --- a/crates/ra_syntax/tests/data/parser/inline/ok/0037_qual_paths.txt +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0037_qual_paths.txt @@ -1,5 +1,5 @@ SOURCE_FILE@[0; 71) - TYPE_DEF@[0; 26) + TYPE_ALIAS_DEF@[0; 26) TYPE_KW@[0; 4) WHITESPACE@[4; 5) NAME@[5; 6) diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0039_type_arg.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0039_type_arg.txt index ccef7188f..cef13b6aa 100644 --- a/crates/ra_syntax/tests/data/parser/inline/ok/0039_type_arg.txt +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0039_type_arg.txt @@ -1,5 +1,5 @@ SOURCE_FILE@[0; 36) - TYPE_DEF@[0; 35) + TYPE_ALIAS_DEF@[0; 35) TYPE_KW@[0; 4) WHITESPACE@[4; 5) NAME@[5; 6) diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0046_singleton_tuple_type.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0046_singleton_tuple_type.txt index 173c325d0..33549028b 100644 --- a/crates/ra_syntax/tests/data/parser/inline/ok/0046_singleton_tuple_type.txt +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0046_singleton_tuple_type.txt @@ -1,5 +1,5 @@ SOURCE_FILE@[0; 17) - TYPE_DEF@[0; 16) + TYPE_ALIAS_DEF@[0; 16) TYPE_KW@[0; 4) WHITESPACE@[4; 5) NAME@[5; 6) diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0051_unit_type.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0051_unit_type.txt index 9fd19ba4a..5a6a2a829 100644 --- a/crates/ra_syntax/tests/data/parser/inline/ok/0051_unit_type.txt +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0051_unit_type.txt @@ -1,5 +1,5 @@ SOURCE_FILE@[0; 13) - TYPE_DEF@[0; 12) + TYPE_ALIAS_DEF@[0; 12) TYPE_KW@[0; 4) WHITESPACE@[4; 5) NAME@[5; 6) diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0052_path_type.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0052_path_type.txt index b72b96e95..0531b8fba 100644 --- a/crates/ra_syntax/tests/data/parser/inline/ok/0052_path_type.txt +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0052_path_type.txt @@ -1,5 +1,5 @@ SOURCE_FILE@[0; 71) - TYPE_DEF@[0; 13) + TYPE_ALIAS_DEF@[0; 13) TYPE_KW@[0; 4) WHITESPACE@[4; 5) NAME@[5; 6) @@ -14,7 +14,7 @@ SOURCE_FILE@[0; 71) IDENT@[9; 12) "Foo" SEMI@[12; 13) WHITESPACE@[13; 14) - TYPE_DEF@[14; 29) + TYPE_ALIAS_DEF@[14; 29) TYPE_KW@[14; 18) WHITESPACE@[18; 19) NAME@[19; 20) @@ -30,7 +30,7 @@ SOURCE_FILE@[0; 71) IDENT@[25; 28) "Foo" SEMI@[28; 29) WHITESPACE@[29; 30) - TYPE_DEF@[30; 49) + TYPE_ALIAS_DEF@[30; 49) TYPE_KW@[30; 34) WHITESPACE@[34; 35) NAME@[35; 36) @@ -49,7 +49,7 @@ SOURCE_FILE@[0; 71) IDENT@[45; 48) "Foo" SEMI@[48; 49) WHITESPACE@[49; 50) - TYPE_DEF@[50; 70) + TYPE_ALIAS_DEF@[50; 70) TYPE_KW@[50; 54) WHITESPACE@[54; 55) NAME@[55; 56) diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0065_dyn_trait_type.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0065_dyn_trait_type.txt index d07fe70b2..f6a0967f2 100644 --- a/crates/ra_syntax/tests/data/parser/inline/ok/0065_dyn_trait_type.txt +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0065_dyn_trait_type.txt @@ -1,5 +1,5 @@ SOURCE_FILE@[0; 42) - TYPE_DEF@[0; 41) + TYPE_ALIAS_DEF@[0; 41) TYPE_KW@[0; 4) WHITESPACE@[4; 5) NAME@[5; 6) diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0073_type_item_type_params.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0073_type_item_type_params.txt index 89b34d4f1..49ce9ad5e 100644 --- a/crates/ra_syntax/tests/data/parser/inline/ok/0073_type_item_type_params.txt +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0073_type_item_type_params.txt @@ -1,5 +1,5 @@ SOURCE_FILE@[0; 21) - TYPE_DEF@[0; 20) + TYPE_ALIAS_DEF@[0; 20) TYPE_KW@[0; 4) WHITESPACE@[4; 5) NAME@[5; 11) diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0078_type_item.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0078_type_item.txt index 4b66a05a6..a62a9d1e7 100644 --- a/crates/ra_syntax/tests/data/parser/inline/ok/0078_type_item.txt +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0078_type_item.txt @@ -1,5 +1,5 @@ SOURCE_FILE@[0; 16) - TYPE_DEF@[0; 15) + TYPE_ALIAS_DEF@[0; 15) TYPE_KW@[0; 4) WHITESPACE@[4; 5) NAME@[5; 8) diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0081_for_type.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0081_for_type.txt index 843cc4973..6e7e6bda1 100644 --- a/crates/ra_syntax/tests/data/parser/inline/ok/0081_for_type.txt +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0081_for_type.txt @@ -1,5 +1,5 @@ SOURCE_FILE@[0; 29) - TYPE_DEF@[0; 28) + TYPE_ALIAS_DEF@[0; 28) TYPE_KW@[0; 4) WHITESPACE@[4; 5) NAME@[5; 6) diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0084_paren_type.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0084_paren_type.txt index bd5feb6b3..76b52bf89 100644 --- a/crates/ra_syntax/tests/data/parser/inline/ok/0084_paren_type.txt +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0084_paren_type.txt @@ -1,5 +1,5 @@ SOURCE_FILE@[0; 16) - TYPE_DEF@[0; 15) + TYPE_ALIAS_DEF@[0; 15) TYPE_KW@[0; 4) WHITESPACE@[4; 5) NAME@[5; 6) diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0092_fn_pointer_type_with_ret.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0092_fn_pointer_type_with_ret.txt index f092c6df7..dc42a5c00 100644 --- a/crates/ra_syntax/tests/data/parser/inline/ok/0092_fn_pointer_type_with_ret.txt +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0092_fn_pointer_type_with_ret.txt @@ -1,5 +1,5 @@ SOURCE_FILE@[0; 21) - TYPE_DEF@[0; 20) + TYPE_ALIAS_DEF@[0; 20) TYPE_KW@[0; 4) WHITESPACE@[4; 5) NAME@[5; 6) diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0104_path_fn_trait_args.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0104_path_fn_trait_args.txt index ba1163c2d..0254c998d 100644 --- a/crates/ra_syntax/tests/data/parser/inline/ok/0104_path_fn_trait_args.txt +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0104_path_fn_trait_args.txt @@ -1,5 +1,5 @@ SOURCE_FILE@[0; 32) - TYPE_DEF@[0; 31) + TYPE_ALIAS_DEF@[0; 31) TYPE_KW@[0; 4) WHITESPACE@[4; 5) NAME@[5; 6) diff --git a/crates/ra_syntax/tests/data/parser/inline/ok/0117_macro_call_type.txt b/crates/ra_syntax/tests/data/parser/inline/ok/0117_macro_call_type.txt index b2d95451c..608b4a5f0 100644 --- a/crates/ra_syntax/tests/data/parser/inline/ok/0117_macro_call_type.txt +++ b/crates/ra_syntax/tests/data/parser/inline/ok/0117_macro_call_type.txt @@ -1,5 +1,5 @@ SOURCE_FILE@[0; 41) - TYPE_DEF@[0; 16) + TYPE_ALIAS_DEF@[0; 16) TYPE_KW@[0; 4) WHITESPACE@[4; 5) NAME@[5; 6) @@ -18,7 +18,7 @@ SOURCE_FILE@[0; 41) R_PAREN@[14; 15) SEMI@[15; 16) WHITESPACE@[16; 17) - TYPE_DEF@[17; 40) + TYPE_ALIAS_DEF@[17; 40) TYPE_KW@[17; 21) WHITESPACE@[21; 22) NAME@[22; 23) -- cgit v1.2.3