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_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 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'crates/ra_ide_api/src') 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)? -- cgit v1.2.3