diff --git a/crates/ra_assists/src/handlers/add_missing_impl_members.rs b/crates/ra_assists/src/handlers/add_missing_impl_members.rs index a2d9006e48..4f377e37f1 100644 --- a/crates/ra_assists/src/handlers/add_missing_impl_members.rs +++ b/crates/ra_assists/src/handlers/add_missing_impl_members.rs @@ -118,7 +118,7 @@ fn add_missing_impl_members_inner( let def_name = |item: &ast::AssocItem| -> Option { match item { - ast::AssocItem::FnDef(def) => def.name(), + ast::AssocItem::Fn(def) => def.name(), ast::AssocItem::TypeAliasDef(def) => def.name(), ast::AssocItem::ConstDef(def) => def.name(), ast::AssocItem::MacroCall(_) => None, @@ -129,13 +129,13 @@ fn add_missing_impl_members_inner( let missing_items = get_missing_assoc_items(&ctx.sema, &impl_def) .iter() .map(|i| match i { - hir::AssocItem::Function(i) => ast::AssocItem::FnDef(i.source(ctx.db()).value), + hir::AssocItem::Function(i) => ast::AssocItem::Fn(i.source(ctx.db()).value), hir::AssocItem::TypeAlias(i) => ast::AssocItem::TypeAliasDef(i.source(ctx.db()).value), hir::AssocItem::Const(i) => ast::AssocItem::ConstDef(i.source(ctx.db()).value), }) .filter(|t| def_name(&t).is_some()) .filter(|t| match t { - ast::AssocItem::FnDef(def) => match mode { + ast::AssocItem::Fn(def) => match mode { AddMissingImplMembersMode::DefaultMethodsOnly => def.body().is_some(), AddMissingImplMembersMode::NoDefaultMethods => def.body().is_none(), }, @@ -158,7 +158,7 @@ fn add_missing_impl_members_inner( .into_iter() .map(|it| ast_transform::apply(&*ast_transform, it)) .map(|it| match it { - ast::AssocItem::FnDef(def) => ast::AssocItem::FnDef(add_body(def)), + ast::AssocItem::Fn(def) => ast::AssocItem::Fn(add_body(def)), ast::AssocItem::TypeAliasDef(def) => { ast::AssocItem::TypeAliasDef(def.remove_bounds()) } @@ -174,7 +174,7 @@ fn add_missing_impl_members_inner( Some(cap) => { let mut cursor = Cursor::Before(first_new_item.syntax()); let placeholder; - if let ast::AssocItem::FnDef(func) = &first_new_item { + if let ast::AssocItem::Fn(func) = &first_new_item { if let Some(m) = func.syntax().descendants().find_map(ast::MacroCall::cast) { if m.syntax().text() == "todo!()" { placeholder = m; @@ -192,7 +192,7 @@ fn add_missing_impl_members_inner( }) } -fn add_body(fn_def: ast::FnDef) -> ast::FnDef { +fn add_body(fn_def: ast::Fn) -> ast::Fn { if fn_def.body().is_some() { return fn_def; } diff --git a/crates/ra_assists/src/handlers/change_return_type_to_result.rs b/crates/ra_assists/src/handlers/change_return_type_to_result.rs index def00f7d8d..52e24af6ce 100644 --- a/crates/ra_assists/src/handlers/change_return_type_to_result.rs +++ b/crates/ra_assists/src/handlers/change_return_type_to_result.rs @@ -20,7 +20,7 @@ use test_utils::mark; pub(crate) fn change_return_type_to_result(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { let ret_type = ctx.find_node_at_offset::()?; // FIXME: extend to lambdas as well - let fn_def = ret_type.syntax().parent().and_then(ast::FnDef::cast)?; + let fn_def = ret_type.syntax().parent().and_then(ast::Fn::cast)?; let type_ref = &ret_type.type_ref()?; let ret_type_str = type_ref.syntax().text().to_string(); diff --git a/crates/ra_assists/src/handlers/change_visibility.rs b/crates/ra_assists/src/handlers/change_visibility.rs index 4343b423c4..67b46376e4 100644 --- a/crates/ra_assists/src/handlers/change_visibility.rs +++ b/crates/ra_assists/src/handlers/change_visibility.rs @@ -2,7 +2,7 @@ use ra_syntax::{ ast::{self, NameOwner, VisibilityOwner}, AstNode, SyntaxKind::{ - CONST_DEF, ENUM_DEF, FN_DEF, MODULE, STATIC_DEF, STRUCT_DEF, TRAIT_DEF, VISIBILITY, + CONST_DEF, ENUM_DEF, FN, MODULE, STATIC_DEF, STRUCT_DEF, TRAIT_DEF, VISIBILITY, }, T, }; @@ -38,7 +38,7 @@ fn add_vis(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { let (offset, target) = if let Some(keyword) = item_keyword { let parent = keyword.parent(); - let def_kws = vec![CONST_DEF, STATIC_DEF, FN_DEF, MODULE, STRUCT_DEF, ENUM_DEF, TRAIT_DEF]; + let def_kws = vec![CONST_DEF, STATIC_DEF, FN, MODULE, STRUCT_DEF, ENUM_DEF, TRAIT_DEF]; // Parent is not a definition, can't add visibility if !def_kws.iter().any(|&def_kw| def_kw == parent.kind()) { return None; diff --git a/crates/ra_assists/src/handlers/early_return.rs b/crates/ra_assists/src/handlers/early_return.rs index 330459f3c8..3650289fd6 100644 --- a/crates/ra_assists/src/handlers/early_return.rs +++ b/crates/ra_assists/src/handlers/early_return.rs @@ -8,7 +8,7 @@ use ra_syntax::{ make, }, AstNode, - SyntaxKind::{FN_DEF, LOOP_EXPR, L_CURLY, R_CURLY, WHILE_EXPR, WHITESPACE}, + SyntaxKind::{FN, LOOP_EXPR, L_CURLY, R_CURLY, WHILE_EXPR, WHITESPACE}, SyntaxNode, }; @@ -88,7 +88,7 @@ pub(crate) fn convert_to_guarded_return(acc: &mut Assists, ctx: &AssistContext) let early_expression: ast::Expr = match parent_container.kind() { WHILE_EXPR | LOOP_EXPR => make::expr_continue(), - FN_DEF => make::expr_return(), + FN => make::expr_return(), _ => return None, }; diff --git a/crates/ra_assists/src/handlers/generate_function.rs b/crates/ra_assists/src/handlers/generate_function.rs index b721b96bbb..006d0ffb2c 100644 --- a/crates/ra_assists/src/handlers/generate_function.rs +++ b/crates/ra_assists/src/handlers/generate_function.rs @@ -82,7 +82,7 @@ struct FunctionTemplate { insert_offset: TextSize, placeholder_expr: ast::MacroCall, leading_ws: String, - fn_def: ast::FnDef, + fn_def: ast::Fn, trailing_ws: String, file: FileId, } diff --git a/crates/ra_assists/src/handlers/generate_new.rs b/crates/ra_assists/src/handlers/generate_new.rs index 25bc171bfb..4dff0ae4db 100644 --- a/crates/ra_assists/src/handlers/generate_new.rs +++ b/crates/ra_assists/src/handlers/generate_new.rs @@ -160,7 +160,7 @@ fn find_struct_impl(ctx: &AssistContext, strukt: &ast::StructDef) -> Option bool { if let Some(il) = imp.assoc_item_list() { for item in il.assoc_items() { - if let ast::AssocItem::FnDef(f) = item { + if let ast::AssocItem::Fn(f) = item { if let Some(name) = f.name() { if name.text().eq_ignore_ascii_case("new") { return true; diff --git a/crates/ra_assists/src/handlers/introduce_named_lifetime.rs b/crates/ra_assists/src/handlers/introduce_named_lifetime.rs index 967593031c..f3774fab19 100644 --- a/crates/ra_assists/src/handlers/introduce_named_lifetime.rs +++ b/crates/ra_assists/src/handlers/introduce_named_lifetime.rs @@ -38,7 +38,7 @@ pub(crate) fn introduce_named_lifetime(acc: &mut Assists, ctx: &AssistContext) - let lifetime_token = ctx .find_token_at_offset(SyntaxKind::LIFETIME) .filter(|lifetime| lifetime.text() == "'_")?; - if let Some(fn_def) = lifetime_token.ancestors().find_map(ast::FnDef::cast) { + if let Some(fn_def) = lifetime_token.ancestors().find_map(ast::Fn::cast) { generate_fn_def_assist(acc, &fn_def, lifetime_token.text_range()) } else if let Some(impl_def) = lifetime_token.ancestors().find_map(ast::ImplDef::cast) { generate_impl_def_assist(acc, &impl_def, lifetime_token.text_range()) @@ -50,7 +50,7 @@ pub(crate) fn introduce_named_lifetime(acc: &mut Assists, ctx: &AssistContext) - /// Generate the assist for the fn def case fn generate_fn_def_assist( acc: &mut Assists, - fn_def: &ast::FnDef, + fn_def: &ast::Fn, lifetime_loc: TextRange, ) -> Option<()> { let param_list: ast::ParamList = fn_def.param_list()?; diff --git a/crates/ra_assists/src/handlers/move_bounds.rs b/crates/ra_assists/src/handlers/move_bounds.rs index 6b73fff44c..dae6198ed7 100644 --- a/crates/ra_assists/src/handlers/move_bounds.rs +++ b/crates/ra_assists/src/handlers/move_bounds.rs @@ -37,7 +37,7 @@ pub(crate) fn move_bounds_to_where_clause(acc: &mut Assists, ctx: &AssistContext let anchor = match_ast! { match parent { - ast::FnDef(it) => it.body()?.syntax().clone().into(), + ast::Fn(it) => it.body()?.syntax().clone().into(), ast::TraitDef(it) => it.assoc_item_list()?.syntax().clone().into(), ast::ImplDef(it) => it.assoc_item_list()?.syntax().clone().into(), ast::EnumDef(it) => it.variant_list()?.syntax().clone().into(), diff --git a/crates/ra_assists/src/utils.rs b/crates/ra_assists/src/utils.rs index 27c33df232..4478ea0e20 100644 --- a/crates/ra_assists/src/utils.rs +++ b/crates/ra_assists/src/utils.rs @@ -66,7 +66,7 @@ pub fn get_missing_assoc_items( if let Some(item_list) = impl_def.assoc_item_list() { for item in item_list.assoc_items() { match item { - ast::AssocItem::FnDef(f) => { + ast::AssocItem::Fn(f) => { if let Some(n) = f.name() { impl_fns_consts.insert(n.syntax().to_string()); } diff --git a/crates/ra_hir/src/has_source.rs b/crates/ra_hir/src/has_source.rs index 76c32fc17a..f32b8cbb9f 100644 --- a/crates/ra_hir/src/has_source.rs +++ b/crates/ra_hir/src/has_source.rs @@ -81,8 +81,8 @@ impl HasSource for EnumVariant { } } impl HasSource for Function { - type Ast = ast::FnDef; - fn source(self, db: &dyn HirDatabase) -> InFile { + type Ast = ast::Fn; + fn source(self, db: &dyn HirDatabase) -> InFile { self.id.lookup(db.upcast()).source(db.upcast()) } } diff --git a/crates/ra_hir/src/semantics.rs b/crates/ra_hir/src/semantics.rs index 1436b1afee..0b634f23ec 100644 --- a/crates/ra_hir/src/semantics.rs +++ b/crates/ra_hir/src/semantics.rs @@ -585,7 +585,7 @@ to_def_impls![ (crate::TypeAlias, ast::TypeAliasDef, type_alias_to_def), (crate::Const, ast::ConstDef, const_to_def), (crate::Static, ast::StaticDef, static_to_def), - (crate::Function, ast::FnDef, fn_to_def), + (crate::Function, ast::Fn, fn_to_def), (crate::Field, ast::RecordFieldDef, record_field_to_def), (crate::Field, ast::TupleFieldDef, tuple_field_to_def), (crate::EnumVariant, ast::EnumVariant, enum_variant_to_def), diff --git a/crates/ra_hir/src/semantics/source_to_def.rs b/crates/ra_hir/src/semantics/source_to_def.rs index 42e5a1bdbe..4118de2e26 100644 --- a/crates/ra_hir/src/semantics/source_to_def.rs +++ b/crates/ra_hir/src/semantics/source_to_def.rs @@ -71,7 +71,7 @@ impl SourceToDefCtx<'_, '_> { pub(super) fn impl_to_def(&mut self, src: InFile) -> Option { self.to_def(src, keys::IMPL) } - pub(super) fn fn_to_def(&mut self, src: InFile) -> Option { + pub(super) fn fn_to_def(&mut self, src: InFile) -> Option { self.to_def(src, keys::FUNCTION) } pub(super) fn struct_to_def(&mut self, src: InFile) -> Option { @@ -171,7 +171,7 @@ impl SourceToDefCtx<'_, '_> { let def = self.impl_to_def(container.with_value(it))?; def.into() }, - ast::FnDef(it) => { + ast::Fn(it) => { let def = self.fn_to_def(container.with_value(it))?; DefWithBodyId::from(def).into() }, @@ -213,7 +213,7 @@ impl SourceToDefCtx<'_, '_> { for container in src.cloned().ancestors_with_macros(self.db.upcast()).skip(1) { let res: GenericDefId = match_ast! { match (container.value) { - ast::FnDef(it) => self.fn_to_def(container.with_value(it))?.into(), + ast::Fn(it) => self.fn_to_def(container.with_value(it))?.into(), ast::StructDef(it) => self.struct_to_def(container.with_value(it))?.into(), ast::EnumDef(it) => self.enum_to_def(container.with_value(it))?.into(), ast::TraitDef(it) => self.trait_to_def(container.with_value(it))?.into(), @@ -233,7 +233,7 @@ impl SourceToDefCtx<'_, '_> { match (container.value) { ast::ConstDef(it) => self.const_to_def(container.with_value(it))?.into(), ast::StaticDef(it) => self.static_to_def(container.with_value(it))?.into(), - ast::FnDef(it) => self.fn_to_def(container.with_value(it))?.into(), + ast::Fn(it) => self.fn_to_def(container.with_value(it))?.into(), _ => continue, } }; diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index 5c57d8bde3..6b13f013d7 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs @@ -627,7 +627,7 @@ impl ExprCollector<'_> { .items() .filter_map(|item| { let (def, name): (ModuleDefId, Option) = match item { - ast::Item::FnDef(def) => { + ast::Item::Fn(def) => { let id = self.find_inner_item(&def)?; ( FunctionLoc { container: container.into(), id }.intern(self.db).into(), diff --git a/crates/ra_hir_def/src/item_tree.rs b/crates/ra_hir_def/src/item_tree.rs index 0bab9c6d8b..34fc9ff8ee 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)] diff --git a/crates/ra_hir_def/src/item_tree/lower.rs b/crates/ra_hir_def/src/item_tree/lower.rs index 8bd0362dce..2764d86740 100644 --- a/crates/ra_hir_def/src/item_tree/lower.rs +++ b/crates/ra_hir_def/src/item_tree/lower.rs @@ -78,7 +78,7 @@ impl Ctx { ast::Item::StructDef(_) | ast::Item::UnionDef(_) | ast::Item::EnumDef(_) - | ast::Item::FnDef(_) + | ast::Item::Fn(_) | ast::Item::TypeAliasDef(_) | ast::Item::ConstDef(_) | ast::Item::StaticDef(_) @@ -103,7 +103,7 @@ impl Ctx { ast::Item::StructDef(ast) => self.lower_struct(ast).map(Into::into), ast::Item::UnionDef(ast) => self.lower_union(ast).map(Into::into), ast::Item::EnumDef(ast) => self.lower_enum(ast).map(Into::into), - ast::Item::FnDef(ast) => self.lower_function(ast).map(Into::into), + ast::Item::Fn(ast) => self.lower_function(ast).map(Into::into), ast::Item::TypeAliasDef(ast) => self.lower_type_alias(ast).map(Into::into), ast::Item::StaticDef(ast) => self.lower_static(ast).map(Into::into), ast::Item::ConstDef(ast) => Some(self.lower_const(ast).into()), @@ -155,7 +155,7 @@ impl Ctx { fn lower_assoc_item(&mut self, item: &ast::AssocItem) -> Option { match item { - ast::AssocItem::FnDef(ast) => self.lower_function(ast).map(Into::into), + ast::AssocItem::Fn(ast) => self.lower_function(ast).map(Into::into), ast::AssocItem::TypeAliasDef(ast) => self.lower_type_alias(ast).map(Into::into), ast::AssocItem::ConstDef(ast) => Some(self.lower_const(ast).into()), ast::AssocItem::MacroCall(ast) => self.lower_macro_call(ast).map(Into::into), @@ -277,7 +277,7 @@ impl Ctx { Some(res) } - fn lower_function(&mut self, func: &ast::FnDef) -> Option> { + fn lower_function(&mut self, func: &ast::Fn) -> Option> { let visibility = self.lower_visibility(func); let name = func.name()?.as_name(); @@ -547,7 +547,7 @@ impl Ctx { self.collect_inner_items(item.syntax()); let attrs = Attrs::new(&item, &self.hygiene); let id: ModItem = match item { - ast::ExternItem::FnDef(ast) => { + ast::ExternItem::Fn(ast) => { let func = self.lower_function(&ast)?; self.data().functions[func.index].is_unsafe = true; func.into() diff --git a/crates/ra_hir_def/src/item_tree/tests.rs b/crates/ra_hir_def/src/item_tree/tests.rs index 3f2e29d9ed..4e2f6008b6 100644 --- a/crates/ra_hir_def/src/item_tree/tests.rs +++ b/crates/ra_hir_def/src/item_tree/tests.rs @@ -240,9 +240,9 @@ fn smoke() { > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_const"))] }, input: None }]) }] > Const { name: Some(Name(Text("CONST"))), visibility: RawVisibilityId("pub(self)"), type_ref: Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("u8"))] }, generic_args: [None] }), ast_id: FileAstId::(9) } > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_method"))] }, input: None }]) }] - > Function { name: Name(Text("method")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: true, is_unsafe: false, params: [Reference(Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Self"))] }, generic_args: [None] }), Shared)], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(10) } + > Function { name: Name(Text("method")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: true, is_unsafe: false, params: [Reference(Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Self"))] }, generic_args: [None] }), Shared)], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(10) } > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_dfl_method"))] }, input: None }]) }] - > Function { name: Name(Text("dfl_method")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: true, is_unsafe: false, params: [Reference(Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Self"))] }, generic_args: [None] }), Mut)], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(11) } + > Function { name: Name(Text("dfl_method")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: true, is_unsafe: false, params: [Reference(Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Self"))] }, generic_args: [None] }), Mut)], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(11) } #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct0"))] }, input: None }]) }] Struct { name: Name(Text("Struct0")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(1), fields: Unit, ast_id: FileAstId::(3), kind: Unit } #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct1"))] }, input: None }]) }] @@ -275,12 +275,12 @@ fn simple_inner_items() { top-level items: Impl { generic_params: GenericParamsId(0), target_trait: Some(Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("D"))] }, generic_args: [None] })), target_type: Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Response"))] }, generic_args: [Some(GenericArgs { args: [Type(Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("T"))] }, generic_args: [None] }))], has_self_type: false, bindings: [] })] }), is_negative: false, items: [Function(Idx::(1))], ast_id: FileAstId::(0) } - > Function { name: Name(Text("foo")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(1) } + > Function { name: Name(Text("foo")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(1) } inner items: for AST FileAstId::(2): - Function { name: Name(Text("end")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(1), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(2) } + Function { name: Name(Text("end")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(1), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(2) } "#]], ); @@ -303,9 +303,9 @@ fn extern_attrs() { top-level items: #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_a"))] }, input: None }, Attr { path: ModPath { kind: Plain, segments: [Name(Text("block_attr"))] }, input: None }]) }] - Function { name: Name(Text("a")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: true, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(1) } + Function { name: Name(Text("a")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: true, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(1) } #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_b"))] }, input: None }, Attr { path: ModPath { kind: Plain, segments: [Name(Text("block_attr"))] }, input: None }]) }] - Function { name: Name(Text("b")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: true, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(2) } + Function { name: Name(Text("b")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: true, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(2) } "##]], ); } @@ -329,9 +329,9 @@ fn trait_attrs() { #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("trait_attr"))] }, input: None }]) }] Trait { name: Name(Text("Tr")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(0), auto: false, items: [Function(Idx::(0)), Function(Idx::(1))], ast_id: FileAstId::(0) } > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_a"))] }, input: None }]) }] - > Function { name: Name(Text("a")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(1) } + > Function { name: Name(Text("a")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(1) } > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_b"))] }, input: None }]) }] - > Function { name: Name(Text("b")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(2) } + > Function { name: Name(Text("b")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(2) } "##]], ); } @@ -355,9 +355,9 @@ fn impl_attrs() { #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("impl_attr"))] }, input: None }]) }] Impl { generic_params: GenericParamsId(4294967295), target_trait: None, target_type: Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Ty"))] }, generic_args: [None] }), is_negative: false, items: [Function(Idx::(0)), Function(Idx::(1))], ast_id: FileAstId::(0) } > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_a"))] }, input: None }]) }] - > Function { name: Name(Text("a")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(1) } + > Function { name: Name(Text("a")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(1) } > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_b"))] }, input: None }]) }] - > Function { name: Name(Text("b")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(2) } + > Function { name: Name(Text("b")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(2) } "##]], ); } @@ -408,13 +408,13 @@ fn inner_item_attrs() { inner attrs: Attrs { entries: None } top-level items: - Function { name: Name(Text("foo")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(0) } + Function { name: Name(Text("foo")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(0) } inner items: for AST FileAstId::(1): #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("on_inner"))] }, input: None }]) }] - Function { name: Name(Text("inner")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(1) } + Function { name: Name(Text("inner")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: false, is_unsafe: false, params: [], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::(1) } "##]], ); diff --git a/crates/ra_hir_def/src/keys.rs b/crates/ra_hir_def/src/keys.rs index a7349a21db..7fed5523ee 100644 --- a/crates/ra_hir_def/src/keys.rs +++ b/crates/ra_hir_def/src/keys.rs @@ -14,7 +14,7 @@ use crate::{ pub type Key = crate::dyn_map::Key, V, AstPtrPolicy>; -pub const FUNCTION: Key = Key::new(); +pub const FUNCTION: Key = Key::new(); pub const CONST: Key = Key::new(); pub const STATIC: Key = Key::new(); pub const TYPE_ALIAS: Key = Key::new(); diff --git a/crates/ra_hir_ty/src/tests.rs b/crates/ra_hir_ty/src/tests.rs index 45bc14c37f..016e689fff 100644 --- a/crates/ra_hir_ty/src/tests.rs +++ b/crates/ra_hir_ty/src/tests.rs @@ -81,7 +81,7 @@ fn check_types_impl(ra_fixture: &str, display_source: bool) { fn type_at_range(db: &TestDB, pos: FileRange) -> Ty { let file = db.parse(pos.file_id).ok().unwrap(); let expr = algo::find_node_at_range::(file.syntax(), pos.range).unwrap(); - let fn_def = expr.syntax().ancestors().find_map(ast::FnDef::cast).unwrap(); + let fn_def = expr.syntax().ancestors().find_map(ast::Fn::cast).unwrap(); let module = db.module_for_file(pos.file_id); let func = *module.child_by_source(db)[keys::FUNCTION] .get(&InFile::new(pos.file_id.into(), fn_def)) diff --git a/crates/ra_ide/src/call_hierarchy.rs b/crates/ra_ide/src/call_hierarchy.rs index c28af8ab33..1fcaf4a32b 100644 --- a/crates/ra_ide/src/call_hierarchy.rs +++ b/crates/ra_ide/src/call_hierarchy.rs @@ -59,7 +59,7 @@ pub(crate) fn incoming_calls(db: &RootDatabase, position: FilePosition) -> Optio if let Some(nav) = syntax.ancestors().find_map(|node| { match_ast! { match node { - ast::FnDef(it) => { + ast::Fn(it) => { let def = sema.to_def(&it)?; Some(def.to_nav(sema.db)) }, @@ -181,8 +181,8 @@ fn caller() { call<|>ee(); } "#, - "callee FN_DEF FileId(1) 0..14 3..9", - &["caller FN_DEF FileId(1) 15..44 18..24 : [33..39]"], + "callee FN FileId(1) 0..14 3..9", + &["caller FN FileId(1) 15..44 18..24 : [33..39]"], &[], ); } @@ -197,8 +197,8 @@ fn caller() { callee(); } "#, - "callee FN_DEF FileId(1) 0..14 3..9", - &["caller FN_DEF FileId(1) 15..44 18..24 : [33..39]"], + "callee FN FileId(1) 0..14 3..9", + &["caller FN FileId(1) 15..44 18..24 : [33..39]"], &[], ); } @@ -214,8 +214,8 @@ fn caller() { callee(); } "#, - "callee FN_DEF FileId(1) 0..14 3..9", - &["caller FN_DEF FileId(1) 15..58 18..24 : [33..39, 47..53]"], + "callee FN FileId(1) 0..14 3..9", + &["caller FN FileId(1) 15..58 18..24 : [33..39, 47..53]"], &[], ); } @@ -234,10 +234,10 @@ fn caller2() { callee(); } "#, - "callee FN_DEF FileId(1) 0..14 3..9", + "callee FN FileId(1) 0..14 3..9", &[ - "caller1 FN_DEF FileId(1) 15..45 18..25 : [34..40]", - "caller2 FN_DEF FileId(1) 47..77 50..57 : [66..72]", + "caller1 FN FileId(1) 15..45 18..25 : [34..40]", + "caller2 FN FileId(1) 47..77 50..57 : [66..72]", ], &[], ); @@ -263,10 +263,10 @@ mod tests { } } "#, - "callee FN_DEF FileId(1) 0..14 3..9", + "callee FN FileId(1) 0..14 3..9", &[ - "caller1 FN_DEF FileId(1) 15..45 18..25 : [34..40]", - "test_caller FN_DEF FileId(1) 95..149 110..121 : [134..140]", + "caller1 FN FileId(1) 15..45 18..25 : [34..40]", + "test_caller FN FileId(1) 95..149 110..121 : [134..140]", ], &[], ); @@ -287,8 +287,8 @@ fn caller() { //- /foo/mod.rs pub fn callee() {} "#, - "callee FN_DEF FileId(2) 0..18 7..13", - &["caller FN_DEF FileId(1) 27..56 30..36 : [45..51]"], + "callee FN FileId(2) 0..18 7..13", + &["caller FN FileId(1) 27..56 30..36 : [45..51]"], &[], ); } @@ -304,9 +304,9 @@ fn call<|>er() { callee(); } "#, - "caller FN_DEF FileId(1) 15..58 18..24", + "caller FN FileId(1) 15..58 18..24", &[], - &["callee FN_DEF FileId(1) 0..14 3..9 : [33..39, 47..53]"], + &["callee FN FileId(1) 0..14 3..9 : [33..39, 47..53]"], ); } @@ -325,9 +325,9 @@ fn call<|>er() { //- /foo/mod.rs pub fn callee() {} "#, - "caller FN_DEF FileId(1) 27..56 30..36", + "caller FN FileId(1) 27..56 30..36", &[], - &["callee FN_DEF FileId(2) 0..18 7..13 : [45..51]"], + &["callee FN FileId(2) 0..18 7..13 : [45..51]"], ); } @@ -348,9 +348,9 @@ fn caller3() { } "#, - "caller2 FN_DEF FileId(1) 33..64 36..43", - &["caller1 FN_DEF FileId(1) 0..31 3..10 : [19..26]"], - &["caller3 FN_DEF FileId(1) 66..83 69..76 : [52..59]"], + "caller2 FN FileId(1) 33..64 36..43", + &["caller1 FN FileId(1) 0..31 3..10 : [19..26]"], + &["caller3 FN FileId(1) 66..83 69..76 : [52..59]"], ); } @@ -368,9 +368,9 @@ fn main() { a<|>() } "#, - "a FN_DEF FileId(1) 0..18 3..4", - &["main FN_DEF FileId(1) 31..52 34..38 : [47..48]"], - &["b FN_DEF FileId(1) 20..29 23..24 : [13..14]"], + "a FN FileId(1) 0..18 3..4", + &["main FN FileId(1) 31..52 34..38 : [47..48]"], + &["b FN FileId(1) 20..29 23..24 : [13..14]"], ); check_hierarchy( @@ -385,8 +385,8 @@ fn main() { a() } "#, - "b FN_DEF FileId(1) 20..29 23..24", - &["a FN_DEF FileId(1) 0..18 3..4 : [13..14]"], + "b FN FileId(1) 20..29 23..24", + &["a FN FileId(1) 0..18 3..4 : [13..14]"], &[], ); } diff --git a/crates/ra_ide/src/completion/complete_fn_param.rs b/crates/ra_ide/src/completion/complete_fn_param.rs index d4b6112a5a..4063342572 100644 --- a/crates/ra_ide/src/completion/complete_fn_param.rs +++ b/crates/ra_ide/src/completion/complete_fn_param.rs @@ -19,8 +19,8 @@ pub(super) fn complete_fn_param(acc: &mut Completions, ctx: &CompletionContext) let mut params = FxHashMap::default(); - let me = ctx.token.ancestors().find_map(ast::FnDef::cast); - let mut process_fn = |func: ast::FnDef| { + let me = ctx.token.ancestors().find_map(ast::Fn::cast); + let mut process_fn = |func: ast::Fn| { if Some(&func) == me.as_ref() { return; } @@ -34,15 +34,15 @@ pub(super) fn complete_fn_param(acc: &mut Completions, ctx: &CompletionContext) match_ast! { match node { ast::SourceFile(it) => it.items().filter_map(|item| match item { - ast::Item::FnDef(it) => Some(it), + ast::Item::Fn(it) => Some(it), _ => None, }).for_each(&mut process_fn), ast::ItemList(it) => it.items().filter_map(|item| match item { - ast::Item::FnDef(it) => Some(it), + ast::Item::Fn(it) => Some(it), _ => None, }).for_each(&mut process_fn), ast::AssocItemList(it) => it.assoc_items().filter_map(|item| match item { - ast::AssocItem::FnDef(it) => Some(it), + ast::AssocItem::Fn(it) => Some(it), _ => None, }).for_each(&mut process_fn), _ => continue, diff --git a/crates/ra_ide/src/completion/complete_keyword.rs b/crates/ra_ide/src/completion/complete_keyword.rs index 1581b2d5d8..b62064797b 100644 --- a/crates/ra_ide/src/completion/complete_keyword.rs +++ b/crates/ra_ide/src/completion/complete_keyword.rs @@ -169,7 +169,7 @@ fn add_keyword(ctx: &CompletionContext, acc: &mut Completions, kw: &str, snippet fn complete_return( ctx: &CompletionContext, - fn_def: &ast::FnDef, + fn_def: &ast::Fn, can_be_stmt: bool, ) -> Option { let snip = match (can_be_stmt, fn_def.ret_type().is_some()) { diff --git a/crates/ra_ide/src/completion/complete_trait_impl.rs b/crates/ra_ide/src/completion/complete_trait_impl.rs index cf716540f5..dbb9eecc64 100644 --- a/crates/ra_ide/src/completion/complete_trait_impl.rs +++ b/crates/ra_ide/src/completion/complete_trait_impl.rs @@ -2,7 +2,7 @@ //! //! This module adds the completion items related to implementing associated //! items within a `impl Trait for Struct` block. The current context node -//! must be within either a `FN_DEF`, `TYPE_ALIAS_DEF`, or `CONST_DEF` node +//! must be within either a `FN`, `TYPE_ALIAS_DEF`, or `CONST_DEF` node //! and an direct child of an `IMPL_DEF`. //! //! # Examples @@ -63,7 +63,7 @@ pub(crate) fn complete_trait_impl(acc: &mut Completions, ctx: &CompletionContext } }), - SyntaxKind::FN_DEF => { + SyntaxKind::FN => { for missing_fn in get_missing_assoc_items(&ctx.sema, &impl_def) .into_iter() .filter_map(|item| match item { @@ -106,7 +106,7 @@ pub(crate) fn complete_trait_impl(acc: &mut Completions, ctx: &CompletionContext fn completion_match(ctx: &CompletionContext) -> Option<(SyntaxNode, ImplDef)> { let (trigger, impl_def_offset) = ctx.token.ancestors().find_map(|p| match p.kind() { - SyntaxKind::FN_DEF + SyntaxKind::FN | SyntaxKind::TYPE_ALIAS_DEF | SyntaxKind::CONST_DEF | SyntaxKind::BLOCK_EXPR => Some((p, 2)), diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs index cc55f6dd6b..221d7847e0 100644 --- a/crates/ra_ide/src/completion/completion_context.rs +++ b/crates/ra_ide/src/completion/completion_context.rs @@ -35,7 +35,7 @@ pub(crate) struct CompletionContext<'a> { pub(super) krate: Option, pub(super) expected_type: Option, pub(super) name_ref_syntax: Option, - pub(super) function_syntax: Option, + pub(super) function_syntax: Option, pub(super) use_item_syntax: Option, pub(super) record_lit_syntax: Option, pub(super) record_pat_syntax: Option, @@ -349,7 +349,7 @@ impl<'a> CompletionContext<'a> { .sema .ancestors_with_macros(self.token.parent()) .take_while(|it| it.kind() != SOURCE_FILE && it.kind() != MODULE) - .find_map(ast::FnDef::cast); + .find_map(ast::Fn::cast); self.record_field_syntax = self .sema diff --git a/crates/ra_ide/src/completion/patterns.rs b/crates/ra_ide/src/completion/patterns.rs index 175209d8ac..b8408da4ec 100644 --- a/crates/ra_ide/src/completion/patterns.rs +++ b/crates/ra_ide/src/completion/patterns.rs @@ -134,7 +134,7 @@ pub(crate) fn is_in_loop_body(element: SyntaxElement) -> bool { NodeOrToken::Token(token) => token.parent(), }; for node in leaf.ancestors() { - if node.kind() == FN_DEF || node.kind() == LAMBDA_EXPR { + if node.kind() == FN || node.kind() == LAMBDA_EXPR { break; } let loop_body = match_ast! { diff --git a/crates/ra_ide/src/display.rs b/crates/ra_ide/src/display.rs index 6d4151dd85..e4effc66cb 100644 --- a/crates/ra_ide/src/display.rs +++ b/crates/ra_ide/src/display.rs @@ -16,7 +16,7 @@ pub use navigation_target::NavigationTarget; pub(crate) use navigation_target::{ToNav, TryToNav}; pub(crate) use short_label::ShortLabel; -pub(crate) fn function_declaration(node: &ast::FnDef) -> String { +pub(crate) fn function_declaration(node: &ast::Fn) -> String { let mut buf = String::new(); if let Some(vis) = node.visibility() { format_to!(buf, "{} ", vis); diff --git a/crates/ra_ide/src/display/navigation_target.rs b/crates/ra_ide/src/display/navigation_target.rs index fd245705c1..222cb35026 100644 --- a/crates/ra_ide/src/display/navigation_target.rs +++ b/crates/ra_ide/src/display/navigation_target.rs @@ -379,7 +379,7 @@ pub(crate) fn docs_from_symbol(db: &RootDatabase, symbol: &FileSymbol) -> Option match_ast! { match node { - ast::FnDef(it) => it.doc_comment_text(), + ast::Fn(it) => it.doc_comment_text(), ast::StructDef(it) => it.doc_comment_text(), ast::EnumDef(it) => it.doc_comment_text(), ast::TraitDef(it) => it.doc_comment_text(), @@ -404,7 +404,7 @@ pub(crate) fn description_from_symbol(db: &RootDatabase, symbol: &FileSymbol) -> match_ast! { match node { - ast::FnDef(it) => it.short_label(), + ast::Fn(it) => it.short_label(), ast::StructDef(it) => it.short_label(), ast::EnumDef(it) => it.short_label(), ast::TraitDef(it) => it.short_label(), diff --git a/crates/ra_ide/src/display/short_label.rs b/crates/ra_ide/src/display/short_label.rs index 5588130a10..63863943a7 100644 --- a/crates/ra_ide/src/display/short_label.rs +++ b/crates/ra_ide/src/display/short_label.rs @@ -7,7 +7,7 @@ pub(crate) trait ShortLabel { fn short_label(&self) -> Option; } -impl ShortLabel for ast::FnDef { +impl ShortLabel for ast::Fn { fn short_label(&self) -> Option { Some(crate::display::function_declaration(self)) } diff --git a/crates/ra_ide/src/file_structure.rs b/crates/ra_ide/src/file_structure.rs index 1f6a3febf3..41603480e4 100644 --- a/crates/ra_ide/src/file_structure.rs +++ b/crates/ra_ide/src/file_structure.rs @@ -111,7 +111,7 @@ fn structure_node(node: &SyntaxNode) -> Option { match_ast! { match node { - ast::FnDef(it) => { + ast::Fn(it) => { let mut detail = String::from("fn"); if let Some(type_param_list) = it.type_param_list() { collapse_ws(type_param_list.syntax(), &mut detail); @@ -271,7 +271,7 @@ fn very_obsolete() {} label: "bar1", navigation_range: 43..47, node_range: 40..52, - kind: FN_DEF, + kind: FN, detail: Some( "fn()", ), @@ -284,7 +284,7 @@ fn very_obsolete() {} label: "bar2", navigation_range: 60..64, node_range: 57..81, - kind: FN_DEF, + kind: FN, detail: Some( "fn(t: T) -> T", ), @@ -297,7 +297,7 @@ fn very_obsolete() {} label: "bar3", navigation_range: 89..93, node_range: 86..156, - kind: FN_DEF, + kind: FN, detail: Some( "fn(a: A, b: B) -> Vec< u32 >", ), @@ -417,7 +417,7 @@ fn very_obsolete() {} label: "obsolete", navigation_range: 428..436, node_range: 411..441, - kind: FN_DEF, + kind: FN, detail: Some( "fn()", ), @@ -428,7 +428,7 @@ fn very_obsolete() {} label: "very_obsolete", navigation_range: 481..494, node_range: 443..499, - kind: FN_DEF, + kind: FN, detail: Some( "fn()", ), diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs index d067c339d3..4ef7efd26d 100644 --- a/crates/ra_ide/src/hover.rs +++ b/crates/ra_ide/src/hover.rs @@ -1361,7 +1361,7 @@ fn foo_<|>test() {} 11..19, ), name: "foo_test", - kind: FN_DEF, + kind: FN, container_name: None, description: None, docs: None, diff --git a/crates/ra_ide/src/references.rs b/crates/ra_ide/src/references.rs index fe1c074d12..8d3452a835 100644 --- a/crates/ra_ide/src/references.rs +++ b/crates/ra_ide/src/references.rs @@ -376,7 +376,7 @@ impl Foo { } "#, ); - check_result(refs, "f FN_DEF FileId(1) 27..43 30..31 Other", &[]); + check_result(refs, "f FN FileId(1) 27..43 30..31 Other", &[]); } #[test] @@ -514,7 +514,7 @@ pub(super) struct Foo<|> { let refs = analysis.find_all_refs(pos, None).unwrap().unwrap(); check_result( refs, - "quux FN_DEF FileId(1) 19..35 26..30 Other", + "quux FN FileId(1) 19..35 26..30 Other", &["FileId(2) 16..20 StructLiteral", "FileId(3) 16..20 StructLiteral"], ); @@ -522,7 +522,7 @@ pub(super) struct Foo<|> { analysis.find_all_refs(pos, Some(SearchScope::single_file(bar))).unwrap().unwrap(); check_result( refs, - "quux FN_DEF FileId(1) 19..35 26..30 Other", + "quux FN FileId(1) 19..35 26..30 Other", &["FileId(3) 16..20 StructLiteral"], ); } @@ -619,7 +619,7 @@ fn main() { ); check_result( refs, - "new FN_DEF FileId(1) 54..101 61..64 Other", + "new FN FileId(1) 54..101 61..64 Other", &["FileId(1) 146..149 StructLiteral"], ); } @@ -646,7 +646,7 @@ fn main() { let refs = analysis.find_all_refs(pos, None).unwrap().unwrap(); check_result( refs, - "f FN_DEF FileId(1) 26..35 29..30 Other", + "f FN FileId(1) 26..35 29..30 Other", &["FileId(2) 11..12 Other", "FileId(2) 28..29 StructLiteral"], ); } diff --git a/crates/ra_ide/src/references/rename.rs b/crates/ra_ide/src/references/rename.rs index 8735ec53cf..d8ffb8c84c 100644 --- a/crates/ra_ide/src/references/rename.rs +++ b/crates/ra_ide/src/references/rename.rs @@ -149,7 +149,7 @@ fn rename_to_self( let source_file = sema.parse(position.file_id); let syn = source_file.syntax(); - let fn_def = find_node_at_offset::(syn, position.offset)?; + let fn_def = find_node_at_offset::(syn, position.offset)?; let params = fn_def.param_list()?; if params.self_param().is_some() { return None; // method already has self param @@ -221,7 +221,7 @@ fn rename_self_to_param( let syn = source_file.syntax(); let text = sema.db.file_text(position.file_id); - let fn_def = find_node_at_offset::(syn, position.offset)?; + let fn_def = find_node_at_offset::(syn, position.offset)?; let search_range = fn_def.syntax().text_range(); let mut edits: Vec = vec![]; diff --git a/crates/ra_ide/src/runnables.rs b/crates/ra_ide/src/runnables.rs index f612835c2a..3b7162b841 100644 --- a/crates/ra_ide/src/runnables.rs +++ b/crates/ra_ide/src/runnables.rs @@ -102,7 +102,7 @@ pub(crate) fn runnable( ) -> Option { match_ast! { match item { - ast::FnDef(it) => runnable_fn(sema, it, file_id), + ast::Fn(it) => runnable_fn(sema, it, file_id), ast::Module(it) => runnable_mod(sema, it, file_id), _ => None, } @@ -111,7 +111,7 @@ pub(crate) fn runnable( fn runnable_fn( sema: &Semantics, - fn_def: ast::FnDef, + fn_def: ast::Fn, file_id: FileId, ) -> Option { let name_string = fn_def.name()?.text().to_string(); @@ -188,7 +188,7 @@ pub struct TestAttr { } impl TestAttr { - fn from_fn(fn_def: &ast::FnDef) -> TestAttr { + fn from_fn(fn_def: &ast::Fn) -> TestAttr { let ignore = fn_def .attrs() .filter_map(|attr| attr.simple_name()) @@ -203,7 +203,7 @@ impl TestAttr { /// /// It may produce false positives, for example, `#[wasm_bindgen_test]` requires a different command to run the test, /// but it's better than not to have the runnables for the tests at all. -fn has_test_related_attribute(fn_def: &ast::FnDef) -> bool { +fn has_test_related_attribute(fn_def: &ast::Fn) -> bool { fn_def .attrs() .filter_map(|attr| attr.path()) @@ -211,7 +211,7 @@ fn has_test_related_attribute(fn_def: &ast::FnDef) -> bool { .any(|attribute_text| attribute_text.contains("test")) } -fn has_doc_test(fn_def: &ast::FnDef) -> bool { +fn has_doc_test(fn_def: &ast::Fn) -> bool { fn_def.doc_comment_text().map_or(false, |comment| comment.contains("```")) } @@ -246,7 +246,7 @@ fn has_test_function_or_multiple_test_submodules(module: &ast::Module) -> bool { for item in item_list.items() { match item { - ast::Item::FnDef(f) => { + ast::Item::Fn(f) => { if has_test_related_attribute(&f) { return true; } @@ -320,7 +320,7 @@ fn bench() {} 4..8, ), name: "main", - kind: FN_DEF, + kind: FN, container_name: None, description: None, docs: None, @@ -338,7 +338,7 @@ fn bench() {} 26..34, ), name: "test_foo", - kind: FN_DEF, + kind: FN, container_name: None, description: None, docs: None, @@ -363,7 +363,7 @@ fn bench() {} 62..70, ), name: "test_foo", - kind: FN_DEF, + kind: FN, container_name: None, description: None, docs: None, @@ -388,7 +388,7 @@ fn bench() {} 89..94, ), name: "bench", - kind: FN_DEF, + kind: FN, container_name: None, description: None, docs: None, @@ -431,7 +431,7 @@ fn foo() {} 4..8, ), name: "main", - kind: FN_DEF, + kind: FN, container_name: None, description: None, docs: None, @@ -447,7 +447,7 @@ fn foo() {} full_range: 15..57, focus_range: None, name: "foo", - kind: FN_DEF, + kind: FN, container_name: None, description: None, docs: None, @@ -493,7 +493,7 @@ impl Data { 4..8, ), name: "main", - kind: FN_DEF, + kind: FN, container_name: None, description: None, docs: None, @@ -509,7 +509,7 @@ impl Data { full_range: 44..98, focus_range: None, name: "foo", - kind: FN_DEF, + kind: FN, container_name: None, description: None, docs: None, @@ -570,7 +570,7 @@ mod test_mod { 35..44, ), name: "test_foo1", - kind: FN_DEF, + kind: FN, container_name: None, description: None, docs: None, @@ -670,7 +670,7 @@ mod root_tests { 107..121, ), name: "nested_test_11", - kind: FN_DEF, + kind: FN, container_name: None, description: None, docs: None, @@ -695,7 +695,7 @@ mod root_tests { 163..177, ), name: "nested_test_12", - kind: FN_DEF, + kind: FN, container_name: None, description: None, docs: None, @@ -740,7 +740,7 @@ mod root_tests { 258..271, ), name: "nested_test_2", - kind: FN_DEF, + kind: FN, container_name: None, description: None, docs: None, @@ -783,7 +783,7 @@ fn test_foo1() {} 36..45, ), name: "test_foo1", - kind: FN_DEF, + kind: FN, container_name: None, description: None, docs: None, @@ -831,7 +831,7 @@ fn test_foo1() {} 58..67, ), name: "test_foo1", - kind: FN_DEF, + kind: FN, container_name: None, description: None, docs: None, diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs index d456d5d362..5198727d91 100644 --- a/crates/ra_ide/src/syntax_highlighting.rs +++ b/crates/ra_ide/src/syntax_highlighting.rs @@ -464,7 +464,7 @@ fn highlight_element( let db = sema.db; let mut binding_hash = None; let highlight: Highlight = match element.kind() { - FN_DEF => { + FN => { bindings_shadow_count.clear(); return None; } @@ -713,7 +713,7 @@ fn highlight_name_by_syntax(name: ast::Name) -> Highlight { TYPE_PARAM => HighlightTag::TypeParam, RECORD_FIELD_DEF => HighlightTag::Field, MODULE => HighlightTag::Module, - FN_DEF => HighlightTag::Function, + FN => HighlightTag::Function, CONST_DEF => HighlightTag::Constant, STATIC_DEF => HighlightTag::Static, ENUM_VARIANT => HighlightTag::EnumVariant, diff --git a/crates/ra_ide/src/syntax_tree.rs b/crates/ra_ide/src/syntax_tree.rs index f716a38616..07217e8087 100644 --- a/crates/ra_ide/src/syntax_tree.rs +++ b/crates/ra_ide/src/syntax_tree.rs @@ -116,7 +116,7 @@ mod tests { syn.trim(), r#" SOURCE_FILE@0..11 - FN_DEF@0..11 + FN@0..11 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 @@ -148,7 +148,7 @@ fn test() { syn.trim(), r#" SOURCE_FILE@0..60 - FN_DEF@0..60 + FN@0..60 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 @@ -190,7 +190,7 @@ SOURCE_FILE@0..60 assert_eq_text!( syn.trim(), r#" -FN_DEF@0..11 +FN@0..11 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 @@ -258,7 +258,7 @@ fn bar() { syn.trim(), r#" SOURCE_FILE@0..12 - FN_DEF@0..12 + FN@0..12 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 @@ -292,7 +292,7 @@ fn bar() { syn.trim(), r#" SOURCE_FILE@0..12 - FN_DEF@0..12 + FN@0..12 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 @@ -325,7 +325,7 @@ fn bar() { syn.trim(), r#" SOURCE_FILE@0..25 - FN_DEF@0..12 + FN@0..12 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 @@ -339,7 +339,7 @@ SOURCE_FILE@0..25 WHITESPACE@10..11 "\n" R_CURLY@11..12 "}" WHITESPACE@12..13 "\n" - FN_DEF@13..25 + FN@13..25 FN_KW@13..15 "fn" WHITESPACE@15..16 " " NAME@16..19 diff --git a/crates/ra_ide_db/src/defs.rs b/crates/ra_ide_db/src/defs.rs index 1464c5f2a2..234d3175a3 100644 --- a/crates/ra_ide_db/src/defs.rs +++ b/crates/ra_ide_db/src/defs.rs @@ -174,7 +174,7 @@ pub fn classify_name(sema: &Semantics, name: &ast::Name) -> Option let def: hir::EnumVariant = sema.to_def(&it)?; Some(NameClass::Definition(Definition::ModuleDef(def.into()))) }, - ast::FnDef(it) => { + ast::Fn(it) => { let def: hir::Function = sema.to_def(&it)?; Some(NameClass::Definition(Definition::ModuleDef(def.into()))) }, diff --git a/crates/ra_ide_db/src/symbol_index.rs b/crates/ra_ide_db/src/symbol_index.rs index 131e2a128d..c6e1ad4327 100644 --- a/crates/ra_ide_db/src/symbol_index.rs +++ b/crates/ra_ide_db/src/symbol_index.rs @@ -397,7 +397,7 @@ fn to_symbol(node: &SyntaxNode) -> Option<(SmolStr, SyntaxNodePtr, TextRange)> { } match_ast! { match node { - ast::FnDef(it) => decl(it), + ast::Fn(it) => decl(it), ast::StructDef(it) => decl(it), ast::EnumDef(it) => decl(it), ast::TraitDef(it) => decl(it), diff --git a/crates/ra_mbe/src/tests.rs b/crates/ra_mbe/src/tests.rs index c43003fd63..220690cdd5 100644 --- a/crates/ra_mbe/src/tests.rs +++ b/crates/ra_mbe/src/tests.rs @@ -258,7 +258,7 @@ fn test_expr_order() { assert_eq_text!( dump.trim(), r#"MACRO_ITEMS@0..15 - FN_DEF@0..15 + FN@0..15 FN_KW@0..2 "fn" NAME@2..5 IDENT@2..5 "bar" diff --git a/crates/ra_parser/src/grammar/items.rs b/crates/ra_parser/src/grammar/items.rs index 3b73e53464..7f8a51ddbc 100644 --- a/crates/ra_parser/src/grammar/items.rs +++ b/crates/ra_parser/src/grammar/items.rs @@ -180,7 +180,7 @@ pub(super) fn maybe_item(p: &mut Parser, m: Marker, flavor: ItemFlavor) -> Resul // unsafe const fn bar() {} T![fn] => { fn_def(p); - m.complete(p, FN_DEF); + m.complete(p, FN); } // test unsafe_trait diff --git a/crates/ra_parser/src/syntax_kind/generated.rs b/crates/ra_parser/src/syntax_kind/generated.rs index 4f35e0baa5..1390fa4071 100644 --- a/crates/ra_parser/src/syntax_kind/generated.rs +++ b/crates/ra_parser/src/syntax_kind/generated.rs @@ -126,7 +126,7 @@ pub enum SyntaxKind { STRUCT_DEF, UNION_DEF, ENUM_DEF, - FN_DEF, + FN, RET_TYPE, EXTERN_CRATE, MODULE, diff --git a/crates/ra_syntax/src/ast/edit.rs b/crates/ra_syntax/src/ast/edit.rs index 6ebe10ff65..4a67fd44ac 100644 --- a/crates/ra_syntax/src/ast/edit.rs +++ b/crates/ra_syntax/src/ast/edit.rs @@ -29,9 +29,9 @@ impl ast::BinExpr { } } -impl ast::FnDef { +impl ast::Fn { #[must_use] - pub fn with_body(&self, body: ast::BlockExpr) -> ast::FnDef { + pub fn with_body(&self, body: ast::BlockExpr) -> ast::Fn { let mut to_insert: ArrayVec<[SyntaxElement; 2]> = ArrayVec::new(); let old_body_or_semi: SyntaxElement = if let Some(old_body) = self.body() { old_body.syntax().clone().into() diff --git a/crates/ra_syntax/src/ast/expr_ext.rs b/crates/ra_syntax/src/ast/expr_ext.rs index 69c85c809d..8692b9bb5f 100644 --- a/crates/ra_syntax/src/ast/expr_ext.rs +++ b/crates/ra_syntax/src/ast/expr_ext.rs @@ -401,7 +401,7 @@ impl ast::BlockExpr { Some(it) => it, None => return true, }; - !matches!(parent.kind(), FN_DEF | IF_EXPR | WHILE_EXPR | LOOP_EXPR | EFFECT_EXPR) + !matches!(parent.kind(), FN | IF_EXPR | WHILE_EXPR | LOOP_EXPR | EFFECT_EXPR) } } diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index be657699ff..4fc35585d0 100644 --- a/crates/ra_syntax/src/ast/generated/nodes.rs +++ b/crates/ra_syntax/src/ast/generated/nodes.rs @@ -79,19 +79,19 @@ impl ExternCrate { pub fn semicolon_token(&self) -> Option { support::token(&self.syntax, T![;]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct FnDef { +pub struct Fn { pub(crate) syntax: SyntaxNode, } -impl ast::AttrsOwner for FnDef {} -impl ast::NameOwner for FnDef {} -impl ast::VisibilityOwner for FnDef {} -impl ast::TypeParamsOwner for FnDef {} -impl FnDef { - pub fn abi(&self) -> Option { support::child(&self.syntax) } - pub fn const_token(&self) -> Option { support::token(&self.syntax, T![const]) } +impl ast::AttrsOwner for Fn {} +impl ast::NameOwner for Fn {} +impl ast::VisibilityOwner for Fn {} +impl ast::TypeParamsOwner for Fn {} +impl Fn { pub fn default_token(&self) -> Option { support::token(&self.syntax, T![default]) } pub fn async_token(&self) -> Option { support::token(&self.syntax, T![async]) } + pub fn const_token(&self) -> Option { support::token(&self.syntax, T![const]) } pub fn unsafe_token(&self) -> Option { support::token(&self.syntax, T![unsafe]) } + pub fn abi(&self) -> Option { support::child(&self.syntax) } pub fn fn_token(&self) -> Option { support::token(&self.syntax, T![fn]) } pub fn param_list(&self) -> Option { support::child(&self.syntax) } pub fn ret_type(&self) -> Option { support::child(&self.syntax) } @@ -303,7 +303,9 @@ impl UseTreeList { pub struct Abi { pub(crate) syntax: SyntaxNode, } -impl Abi {} +impl Abi { + pub fn extern_token(&self) -> Option { support::token(&self.syntax, T![extern]) } +} #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct TypeParamList { pub(crate) syntax: SyntaxNode, @@ -321,8 +323,9 @@ pub struct ParamList { } impl ParamList { pub fn l_paren_token(&self) -> Option { support::token(&self.syntax, T!['(']) } - pub fn self_param(&self) -> Option { support::child(&self.syntax) } pub fn params(&self) -> AstChildren { support::children(&self.syntax) } + pub fn self_param(&self) -> Option { support::child(&self.syntax) } + pub fn comma_token(&self) -> Option { support::token(&self.syntax, T![,]) } pub fn r_paren_token(&self) -> Option { support::token(&self.syntax, T![')']) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] @@ -355,6 +358,32 @@ impl BlockExpr { pub fn r_curly_token(&self) -> Option { support::token(&self.syntax, T!['}']) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct Param { + pub(crate) syntax: SyntaxNode, +} +impl ast::AttrsOwner for Param {} +impl ast::TypeAscriptionOwner for Param {} +impl Param { + pub fn pat(&self) -> Option { support::child(&self.syntax) } + pub fn colon_token(&self) -> Option { support::token(&self.syntax, T![:]) } + pub fn dotdotdot_token(&self) -> Option { support::token(&self.syntax, T![...]) } +} +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct SelfParam { + pub(crate) syntax: SyntaxNode, +} +impl ast::AttrsOwner for SelfParam {} +impl ast::TypeAscriptionOwner for SelfParam {} +impl SelfParam { + pub fn amp_token(&self) -> Option { support::token(&self.syntax, T![&]) } + pub fn lifetime_token(&self) -> Option { + support::token(&self.syntax, T![lifetime]) + } + pub fn mut_token(&self) -> Option { support::token(&self.syntax, T![mut]) } + pub fn self_token(&self) -> Option { support::token(&self.syntax, T![self]) } + pub fn colon_token(&self) -> Option { support::token(&self.syntax, T![:]) } +} +#[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct RecordFieldDefList { pub(crate) syntax: SyntaxNode, } @@ -1173,32 +1202,6 @@ impl LetStmt { pub fn semicolon_token(&self) -> Option { support::token(&self.syntax, T![;]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct SelfParam { - pub(crate) syntax: SyntaxNode, -} -impl ast::AttrsOwner for SelfParam {} -impl ast::TypeAscriptionOwner for SelfParam {} -impl SelfParam { - pub fn amp_token(&self) -> Option { support::token(&self.syntax, T![&]) } - pub fn lifetime_token(&self) -> Option { - support::token(&self.syntax, T![lifetime]) - } - pub fn mut_token(&self) -> Option { support::token(&self.syntax, T![mut]) } - pub fn self_token(&self) -> Option { support::token(&self.syntax, T![self]) } - pub fn colon_token(&self) -> Option { support::token(&self.syntax, T![:]) } -} -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct Param { - pub(crate) syntax: SyntaxNode, -} -impl ast::AttrsOwner for Param {} -impl ast::TypeAscriptionOwner for Param {} -impl Param { - pub fn pat(&self) -> Option { support::child(&self.syntax) } - pub fn colon_token(&self) -> Option { support::token(&self.syntax, T![:]) } - pub fn dotdotdot_token(&self) -> Option { support::token(&self.syntax, T![...]) } -} -#[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct PathSegment { pub(crate) syntax: SyntaxNode, } @@ -1274,7 +1277,7 @@ pub enum Item { EnumDef(EnumDef), ExternBlock(ExternBlock), ExternCrate(ExternCrate), - FnDef(FnDef), + Fn(Fn), ImplDef(ImplDef), MacroCall(MacroCall), Module(Module), @@ -1303,6 +1306,24 @@ pub enum TypeRef { DynTraitType(DynTraitType), } #[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum Pat { + OrPat(OrPat), + ParenPat(ParenPat), + RefPat(RefPat), + BoxPat(BoxPat), + BindPat(BindPat), + PlaceholderPat(PlaceholderPat), + DotDotPat(DotDotPat), + PathPat(PathPat), + RecordPat(RecordPat), + TupleStructPat(TupleStructPat), + TuplePat(TuplePat), + SlicePat(SlicePat), + RangePat(RangePat), + LiteralPat(LiteralPat), + MacroPat(MacroPat), +} +#[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum FieldDefList { RecordFieldDefList(RecordFieldDefList), TupleFieldDefList(TupleFieldDefList), @@ -1343,7 +1364,7 @@ pub enum Expr { } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum AssocItem { - FnDef(FnDef), + Fn(Fn), TypeAliasDef(TypeAliasDef), ConstDef(ConstDef), MacroCall(MacroCall), @@ -1351,24 +1372,6 @@ pub enum AssocItem { impl ast::AttrsOwner for AssocItem {} impl ast::NameOwner for AssocItem {} #[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub enum Pat { - OrPat(OrPat), - ParenPat(ParenPat), - RefPat(RefPat), - BoxPat(BoxPat), - BindPat(BindPat), - PlaceholderPat(PlaceholderPat), - DotDotPat(DotDotPat), - PathPat(PathPat), - RecordPat(RecordPat), - TupleStructPat(TupleStructPat), - TuplePat(TuplePat), - SlicePat(SlicePat), - RangePat(RangePat), - LiteralPat(LiteralPat), - MacroPat(MacroPat), -} -#[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum Stmt { LetStmt(LetStmt), ExprStmt(ExprStmt), @@ -1381,7 +1384,7 @@ pub enum AttrInput { } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum ExternItem { - FnDef(FnDef), + Fn(Fn), StaticDef(StaticDef), } impl ast::AttrsOwner for ExternItem {} @@ -1463,8 +1466,8 @@ impl AstNode for ExternCrate { } fn syntax(&self) -> &SyntaxNode { &self.syntax } } -impl AstNode for FnDef { - fn can_cast(kind: SyntaxKind) -> bool { kind == FN_DEF } +impl AstNode for Fn { + fn can_cast(kind: SyntaxKind) -> bool { kind == FN } fn cast(syntax: SyntaxNode) -> Option { if Self::can_cast(syntax.kind()) { Some(Self { syntax }) @@ -1727,6 +1730,28 @@ impl AstNode for BlockExpr { } fn syntax(&self) -> &SyntaxNode { &self.syntax } } +impl AstNode for Param { + fn can_cast(kind: SyntaxKind) -> bool { kind == PARAM } + fn cast(syntax: SyntaxNode) -> Option { + if Self::can_cast(syntax.kind()) { + Some(Self { syntax }) + } else { + None + } + } + fn syntax(&self) -> &SyntaxNode { &self.syntax } +} +impl AstNode for SelfParam { + fn can_cast(kind: SyntaxKind) -> bool { kind == SELF_PARAM } + fn cast(syntax: SyntaxNode) -> Option { + if Self::can_cast(syntax.kind()) { + Some(Self { syntax }) + } else { + None + } + } + fn syntax(&self) -> &SyntaxNode { &self.syntax } +} impl AstNode for RecordFieldDefList { fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_FIELD_DEF_LIST } fn cast(syntax: SyntaxNode) -> Option { @@ -2673,28 +2698,6 @@ impl AstNode for LetStmt { } fn syntax(&self) -> &SyntaxNode { &self.syntax } } -impl AstNode for SelfParam { - fn can_cast(kind: SyntaxKind) -> bool { kind == SELF_PARAM } - fn cast(syntax: SyntaxNode) -> Option { - if Self::can_cast(syntax.kind()) { - Some(Self { syntax }) - } else { - None - } - } - fn syntax(&self) -> &SyntaxNode { &self.syntax } -} -impl AstNode for Param { - fn can_cast(kind: SyntaxKind) -> bool { kind == PARAM } - fn cast(syntax: SyntaxNode) -> Option { - if Self::can_cast(syntax.kind()) { - Some(Self { syntax }) - } else { - None - } - } - fn syntax(&self) -> &SyntaxNode { &self.syntax } -} impl AstNode for PathSegment { fn can_cast(kind: SyntaxKind) -> bool { kind == PATH_SEGMENT } fn cast(syntax: SyntaxNode) -> Option { @@ -2784,8 +2787,8 @@ impl From for Item { impl From for Item { fn from(node: ExternCrate) -> Item { Item::ExternCrate(node) } } -impl From for Item { - fn from(node: FnDef) -> Item { Item::FnDef(node) } +impl From for Item { + fn from(node: Fn) -> Item { Item::Fn(node) } } impl From for Item { fn from(node: ImplDef) -> Item { Item::ImplDef(node) } @@ -2817,7 +2820,7 @@ impl From for Item { impl AstNode for Item { fn can_cast(kind: SyntaxKind) -> bool { match kind { - CONST_DEF | ENUM_DEF | EXTERN_BLOCK | EXTERN_CRATE | FN_DEF | IMPL_DEF | MACRO_CALL + CONST_DEF | ENUM_DEF | EXTERN_BLOCK | EXTERN_CRATE | FN | IMPL_DEF | MACRO_CALL | MODULE | STATIC_DEF | STRUCT_DEF | TRAIT_DEF | TYPE_ALIAS_DEF | UNION_DEF | USE => { true } @@ -2830,7 +2833,7 @@ impl AstNode for Item { ENUM_DEF => Item::EnumDef(EnumDef { syntax }), EXTERN_BLOCK => Item::ExternBlock(ExternBlock { syntax }), EXTERN_CRATE => Item::ExternCrate(ExternCrate { syntax }), - FN_DEF => Item::FnDef(FnDef { syntax }), + FN => Item::Fn(Fn { syntax }), IMPL_DEF => Item::ImplDef(ImplDef { syntax }), MACRO_CALL => Item::MacroCall(MacroCall { syntax }), MODULE => Item::Module(Module { syntax }), @@ -2850,7 +2853,7 @@ impl AstNode for Item { Item::EnumDef(it) => &it.syntax, Item::ExternBlock(it) => &it.syntax, Item::ExternCrate(it) => &it.syntax, - Item::FnDef(it) => &it.syntax, + Item::Fn(it) => &it.syntax, Item::ImplDef(it) => &it.syntax, Item::MacroCall(it) => &it.syntax, Item::Module(it) => &it.syntax, @@ -2948,6 +2951,101 @@ impl AstNode for TypeRef { } } } +impl From for Pat { + fn from(node: OrPat) -> Pat { Pat::OrPat(node) } +} +impl From for Pat { + fn from(node: ParenPat) -> Pat { Pat::ParenPat(node) } +} +impl From for Pat { + fn from(node: RefPat) -> Pat { Pat::RefPat(node) } +} +impl From for Pat { + fn from(node: BoxPat) -> Pat { Pat::BoxPat(node) } +} +impl From for Pat { + fn from(node: BindPat) -> Pat { Pat::BindPat(node) } +} +impl From for Pat { + fn from(node: PlaceholderPat) -> Pat { Pat::PlaceholderPat(node) } +} +impl From for Pat { + fn from(node: DotDotPat) -> Pat { Pat::DotDotPat(node) } +} +impl From for Pat { + fn from(node: PathPat) -> Pat { Pat::PathPat(node) } +} +impl From for Pat { + fn from(node: RecordPat) -> Pat { Pat::RecordPat(node) } +} +impl From for Pat { + fn from(node: TupleStructPat) -> Pat { Pat::TupleStructPat(node) } +} +impl From for Pat { + fn from(node: TuplePat) -> Pat { Pat::TuplePat(node) } +} +impl From for Pat { + fn from(node: SlicePat) -> Pat { Pat::SlicePat(node) } +} +impl From for Pat { + fn from(node: RangePat) -> Pat { Pat::RangePat(node) } +} +impl From for Pat { + fn from(node: LiteralPat) -> Pat { Pat::LiteralPat(node) } +} +impl From for Pat { + fn from(node: MacroPat) -> Pat { Pat::MacroPat(node) } +} +impl AstNode for Pat { + fn can_cast(kind: SyntaxKind) -> bool { + match kind { + OR_PAT | PAREN_PAT | REF_PAT | BOX_PAT | BIND_PAT | PLACEHOLDER_PAT | DOT_DOT_PAT + | PATH_PAT | RECORD_PAT | TUPLE_STRUCT_PAT | TUPLE_PAT | SLICE_PAT | RANGE_PAT + | LITERAL_PAT | MACRO_PAT => true, + _ => false, + } + } + fn cast(syntax: SyntaxNode) -> Option { + let res = match syntax.kind() { + OR_PAT => Pat::OrPat(OrPat { syntax }), + PAREN_PAT => Pat::ParenPat(ParenPat { syntax }), + REF_PAT => Pat::RefPat(RefPat { syntax }), + BOX_PAT => Pat::BoxPat(BoxPat { syntax }), + BIND_PAT => Pat::BindPat(BindPat { syntax }), + PLACEHOLDER_PAT => Pat::PlaceholderPat(PlaceholderPat { syntax }), + DOT_DOT_PAT => Pat::DotDotPat(DotDotPat { syntax }), + PATH_PAT => Pat::PathPat(PathPat { syntax }), + RECORD_PAT => Pat::RecordPat(RecordPat { syntax }), + TUPLE_STRUCT_PAT => Pat::TupleStructPat(TupleStructPat { syntax }), + TUPLE_PAT => Pat::TuplePat(TuplePat { syntax }), + SLICE_PAT => Pat::SlicePat(SlicePat { syntax }), + RANGE_PAT => Pat::RangePat(RangePat { syntax }), + LITERAL_PAT => Pat::LiteralPat(LiteralPat { syntax }), + MACRO_PAT => Pat::MacroPat(MacroPat { syntax }), + _ => return None, + }; + Some(res) + } + fn syntax(&self) -> &SyntaxNode { + match self { + Pat::OrPat(it) => &it.syntax, + Pat::ParenPat(it) => &it.syntax, + Pat::RefPat(it) => &it.syntax, + Pat::BoxPat(it) => &it.syntax, + Pat::BindPat(it) => &it.syntax, + Pat::PlaceholderPat(it) => &it.syntax, + Pat::DotDotPat(it) => &it.syntax, + Pat::PathPat(it) => &it.syntax, + Pat::RecordPat(it) => &it.syntax, + Pat::TupleStructPat(it) => &it.syntax, + Pat::TuplePat(it) => &it.syntax, + Pat::SlicePat(it) => &it.syntax, + Pat::RangePat(it) => &it.syntax, + Pat::LiteralPat(it) => &it.syntax, + Pat::MacroPat(it) => &it.syntax, + } + } +} impl From for FieldDefList { fn from(node: RecordFieldDefList) -> FieldDefList { FieldDefList::RecordFieldDefList(node) } } @@ -3157,8 +3255,8 @@ impl AstNode for Expr { } } } -impl From for AssocItem { - fn from(node: FnDef) -> AssocItem { AssocItem::FnDef(node) } +impl From for AssocItem { + fn from(node: Fn) -> AssocItem { AssocItem::Fn(node) } } impl From for AssocItem { fn from(node: TypeAliasDef) -> AssocItem { AssocItem::TypeAliasDef(node) } @@ -3172,13 +3270,13 @@ impl From for AssocItem { impl AstNode for AssocItem { fn can_cast(kind: SyntaxKind) -> bool { match kind { - FN_DEF | TYPE_ALIAS_DEF | CONST_DEF | MACRO_CALL => true, + FN | TYPE_ALIAS_DEF | CONST_DEF | MACRO_CALL => true, _ => false, } } fn cast(syntax: SyntaxNode) -> Option { let res = match syntax.kind() { - FN_DEF => AssocItem::FnDef(FnDef { syntax }), + FN => AssocItem::Fn(Fn { syntax }), TYPE_ALIAS_DEF => AssocItem::TypeAliasDef(TypeAliasDef { syntax }), CONST_DEF => AssocItem::ConstDef(ConstDef { syntax }), MACRO_CALL => AssocItem::MacroCall(MacroCall { syntax }), @@ -3188,108 +3286,13 @@ impl AstNode for AssocItem { } fn syntax(&self) -> &SyntaxNode { match self { - AssocItem::FnDef(it) => &it.syntax, + AssocItem::Fn(it) => &it.syntax, AssocItem::TypeAliasDef(it) => &it.syntax, AssocItem::ConstDef(it) => &it.syntax, AssocItem::MacroCall(it) => &it.syntax, } } } -impl From for Pat { - fn from(node: OrPat) -> Pat { Pat::OrPat(node) } -} -impl From for Pat { - fn from(node: ParenPat) -> Pat { Pat::ParenPat(node) } -} -impl From for Pat { - fn from(node: RefPat) -> Pat { Pat::RefPat(node) } -} -impl From for Pat { - fn from(node: BoxPat) -> Pat { Pat::BoxPat(node) } -} -impl From for Pat { - fn from(node: BindPat) -> Pat { Pat::BindPat(node) } -} -impl From for Pat { - fn from(node: PlaceholderPat) -> Pat { Pat::PlaceholderPat(node) } -} -impl From for Pat { - fn from(node: DotDotPat) -> Pat { Pat::DotDotPat(node) } -} -impl From for Pat { - fn from(node: PathPat) -> Pat { Pat::PathPat(node) } -} -impl From for Pat { - fn from(node: RecordPat) -> Pat { Pat::RecordPat(node) } -} -impl From for Pat { - fn from(node: TupleStructPat) -> Pat { Pat::TupleStructPat(node) } -} -impl From for Pat { - fn from(node: TuplePat) -> Pat { Pat::TuplePat(node) } -} -impl From for Pat { - fn from(node: SlicePat) -> Pat { Pat::SlicePat(node) } -} -impl From for Pat { - fn from(node: RangePat) -> Pat { Pat::RangePat(node) } -} -impl From for Pat { - fn from(node: LiteralPat) -> Pat { Pat::LiteralPat(node) } -} -impl From for Pat { - fn from(node: MacroPat) -> Pat { Pat::MacroPat(node) } -} -impl AstNode for Pat { - fn can_cast(kind: SyntaxKind) -> bool { - match kind { - OR_PAT | PAREN_PAT | REF_PAT | BOX_PAT | BIND_PAT | PLACEHOLDER_PAT | DOT_DOT_PAT - | PATH_PAT | RECORD_PAT | TUPLE_STRUCT_PAT | TUPLE_PAT | SLICE_PAT | RANGE_PAT - | LITERAL_PAT | MACRO_PAT => true, - _ => false, - } - } - fn cast(syntax: SyntaxNode) -> Option { - let res = match syntax.kind() { - OR_PAT => Pat::OrPat(OrPat { syntax }), - PAREN_PAT => Pat::ParenPat(ParenPat { syntax }), - REF_PAT => Pat::RefPat(RefPat { syntax }), - BOX_PAT => Pat::BoxPat(BoxPat { syntax }), - BIND_PAT => Pat::BindPat(BindPat { syntax }), - PLACEHOLDER_PAT => Pat::PlaceholderPat(PlaceholderPat { syntax }), - DOT_DOT_PAT => Pat::DotDotPat(DotDotPat { syntax }), - PATH_PAT => Pat::PathPat(PathPat { syntax }), - RECORD_PAT => Pat::RecordPat(RecordPat { syntax }), - TUPLE_STRUCT_PAT => Pat::TupleStructPat(TupleStructPat { syntax }), - TUPLE_PAT => Pat::TuplePat(TuplePat { syntax }), - SLICE_PAT => Pat::SlicePat(SlicePat { syntax }), - RANGE_PAT => Pat::RangePat(RangePat { syntax }), - LITERAL_PAT => Pat::LiteralPat(LiteralPat { syntax }), - MACRO_PAT => Pat::MacroPat(MacroPat { syntax }), - _ => return None, - }; - Some(res) - } - fn syntax(&self) -> &SyntaxNode { - match self { - Pat::OrPat(it) => &it.syntax, - Pat::ParenPat(it) => &it.syntax, - Pat::RefPat(it) => &it.syntax, - Pat::BoxPat(it) => &it.syntax, - Pat::BindPat(it) => &it.syntax, - Pat::PlaceholderPat(it) => &it.syntax, - Pat::DotDotPat(it) => &it.syntax, - Pat::PathPat(it) => &it.syntax, - Pat::RecordPat(it) => &it.syntax, - Pat::TupleStructPat(it) => &it.syntax, - Pat::TuplePat(it) => &it.syntax, - Pat::SlicePat(it) => &it.syntax, - Pat::RangePat(it) => &it.syntax, - Pat::LiteralPat(it) => &it.syntax, - Pat::MacroPat(it) => &it.syntax, - } - } -} impl From for Stmt { fn from(node: LetStmt) -> Stmt { Stmt::LetStmt(node) } } @@ -3346,8 +3349,8 @@ impl AstNode for AttrInput { } } } -impl From for ExternItem { - fn from(node: FnDef) -> ExternItem { ExternItem::FnDef(node) } +impl From for ExternItem { + fn from(node: Fn) -> ExternItem { ExternItem::Fn(node) } } impl From for ExternItem { fn from(node: StaticDef) -> ExternItem { ExternItem::StaticDef(node) } @@ -3355,13 +3358,13 @@ impl From for ExternItem { impl AstNode for ExternItem { fn can_cast(kind: SyntaxKind) -> bool { match kind { - FN_DEF | STATIC_DEF => true, + FN | STATIC_DEF => true, _ => false, } } fn cast(syntax: SyntaxNode) -> Option { let res = match syntax.kind() { - FN_DEF => ExternItem::FnDef(FnDef { syntax }), + FN => ExternItem::Fn(Fn { syntax }), STATIC_DEF => ExternItem::StaticDef(StaticDef { syntax }), _ => return None, }; @@ -3369,7 +3372,7 @@ impl AstNode for ExternItem { } fn syntax(&self) -> &SyntaxNode { match self { - ExternItem::FnDef(it) => &it.syntax, + ExternItem::Fn(it) => &it.syntax, ExternItem::StaticDef(it) => &it.syntax, } } @@ -3417,6 +3420,11 @@ impl std::fmt::Display for TypeRef { std::fmt::Display::fmt(self.syntax(), f) } } +impl std::fmt::Display for Pat { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + std::fmt::Display::fmt(self.syntax(), f) + } +} impl std::fmt::Display for FieldDefList { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { std::fmt::Display::fmt(self.syntax(), f) @@ -3432,11 +3440,6 @@ impl std::fmt::Display for AssocItem { std::fmt::Display::fmt(self.syntax(), f) } } -impl std::fmt::Display for Pat { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - std::fmt::Display::fmt(self.syntax(), f) - } -} impl std::fmt::Display for Stmt { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { std::fmt::Display::fmt(self.syntax(), f) @@ -3487,7 +3490,7 @@ impl std::fmt::Display for ExternCrate { std::fmt::Display::fmt(self.syntax(), f) } } -impl std::fmt::Display for FnDef { +impl std::fmt::Display for Fn { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { std::fmt::Display::fmt(self.syntax(), f) } @@ -3607,6 +3610,16 @@ impl std::fmt::Display for BlockExpr { std::fmt::Display::fmt(self.syntax(), f) } } +impl std::fmt::Display for Param { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + std::fmt::Display::fmt(self.syntax(), f) + } +} +impl std::fmt::Display for SelfParam { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + std::fmt::Display::fmt(self.syntax(), f) + } +} impl std::fmt::Display for RecordFieldDefList { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { std::fmt::Display::fmt(self.syntax(), f) @@ -4037,16 +4050,6 @@ impl std::fmt::Display for LetStmt { std::fmt::Display::fmt(self.syntax(), f) } } -impl std::fmt::Display for SelfParam { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - std::fmt::Display::fmt(self.syntax(), f) - } -} -impl std::fmt::Display for Param { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - std::fmt::Display::fmt(self.syntax(), f) - } -} impl std::fmt::Display for PathSegment { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { std::fmt::Display::fmt(self.syntax(), f) diff --git a/crates/ra_syntax/src/ast/make.rs b/crates/ra_syntax/src/ast/make.rs index 0ff69bc2d1..ef235680f5 100644 --- a/crates/ra_syntax/src/ast/make.rs +++ b/crates/ra_syntax/src/ast/make.rs @@ -294,7 +294,7 @@ pub fn fn_def( type_params: Option, params: ast::ParamList, body: ast::BlockExpr, -) -> ast::FnDef { +) -> ast::Fn { let type_params = if let Some(type_params) = type_params { format!("<{}>", type_params) } else { "".into() }; let visibility = match visibility { diff --git a/crates/ra_syntax/src/ast/node_ext.rs b/crates/ra_syntax/src/ast/node_ext.rs index 242900643a..9fb6b72685 100644 --- a/crates/ra_syntax/src/ast/node_ext.rs +++ b/crates/ra_syntax/src/ast/node_ext.rs @@ -474,7 +474,7 @@ impl ast::TokenTree { } impl ast::DocCommentsOwner for ast::SourceFile {} -impl ast::DocCommentsOwner for ast::FnDef {} +impl ast::DocCommentsOwner for ast::Fn {} impl ast::DocCommentsOwner for ast::StructDef {} impl ast::DocCommentsOwner for ast::UnionDef {} impl ast::DocCommentsOwner for ast::RecordFieldDef {} diff --git a/crates/ra_syntax/src/lib.rs b/crates/ra_syntax/src/lib.rs index 219dd0b077..6203b62064 100644 --- a/crates/ra_syntax/src/lib.rs +++ b/crates/ra_syntax/src/lib.rs @@ -255,11 +255,11 @@ fn api_walkthrough() { let mut func = None; for item in file.items() { match item { - ast::Item::FnDef(f) => func = Some(f), + ast::Item::Fn(f) => func = Some(f), _ => unreachable!(), } } - let func: ast::FnDef = func.unwrap(); + let func: ast::Fn = func.unwrap(); // Each AST node has a bunch of getters for children. All getters return // `Option`s though, to account for incomplete code. Some getters are common @@ -316,7 +316,7 @@ fn api_walkthrough() { ); // As well as some iterator helpers: - let f = expr_syntax.ancestors().find_map(ast::FnDef::cast); + let f = expr_syntax.ancestors().find_map(ast::Fn::cast); assert_eq!(f, Some(func)); assert!(expr_syntax.siblings_with_tokens(Direction::Next).any(|it| it.kind() == T!['}'])); assert_eq!( diff --git a/crates/ra_syntax/src/parsing/text_tree_sink.rs b/crates/ra_syntax/src/parsing/text_tree_sink.rs index c6b30a02ad..2a0f95d157 100644 --- a/crates/ra_syntax/src/parsing/text_tree_sink.rs +++ b/crates/ra_syntax/src/parsing/text_tree_sink.rs @@ -146,7 +146,7 @@ fn n_attached_trivias<'a>( trivias: impl Iterator, ) -> usize { match kind { - MACRO_CALL | CONST_DEF | TYPE_ALIAS_DEF | STRUCT_DEF | ENUM_DEF | ENUM_VARIANT | FN_DEF + MACRO_CALL | CONST_DEF | TYPE_ALIAS_DEF | STRUCT_DEF | ENUM_DEF | ENUM_VARIANT | FN | TRAIT_DEF | MODULE | RECORD_FIELD_DEF | STATIC_DEF => { let mut res = 0; let mut trivias = trivias.enumerate().peekable(); diff --git a/crates/ra_syntax/src/validation.rs b/crates/ra_syntax/src/validation.rs index fdec48fb0b..2714d102a9 100644 --- a/crates/ra_syntax/src/validation.rs +++ b/crates/ra_syntax/src/validation.rs @@ -4,7 +4,7 @@ mod block; use crate::{ ast, match_ast, AstNode, SyntaxError, - SyntaxKind::{BYTE, BYTE_STRING, CHAR, CONST_DEF, FN_DEF, INT_NUMBER, STRING, TYPE_ALIAS_DEF}, + SyntaxKind::{BYTE, BYTE_STRING, CHAR, CONST_DEF, FN, INT_NUMBER, STRING, TYPE_ALIAS_DEF}, SyntaxNode, SyntaxToken, TextSize, T, }; use rustc_lexer::unescape::{ @@ -200,7 +200,7 @@ fn validate_visibility(vis: ast::Visibility, errors: &mut Vec) { None => return, }; match parent.kind() { - FN_DEF | CONST_DEF | TYPE_ALIAS_DEF => (), + FN | CONST_DEF | TYPE_ALIAS_DEF => (), _ => return, } diff --git a/crates/ra_syntax/src/validation/block.rs b/crates/ra_syntax/src/validation/block.rs index 2c08f7e6ed..ad99014688 100644 --- a/crates/ra_syntax/src/validation/block.rs +++ b/crates/ra_syntax/src/validation/block.rs @@ -9,7 +9,7 @@ use crate::{ pub(crate) fn validate_block_expr(block: ast::BlockExpr, errors: &mut Vec) { if let Some(parent) = block.syntax().parent() { match parent.kind() { - FN_DEF | EXPR_STMT | BLOCK_EXPR => return, + FN | EXPR_STMT | BLOCK_EXPR => return, _ => {} } } diff --git a/crates/ra_syntax/test_data/parser/err/0005_attribute_recover.rast b/crates/ra_syntax/test_data/parser/err/0005_attribute_recover.rast index 375ed45e07..4845a6563c 100644 --- a/crates/ra_syntax/test_data/parser/err/0005_attribute_recover.rast +++ b/crates/ra_syntax/test_data/parser/err/0005_attribute_recover.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..54 - FN_DEF@0..31 + FN@0..31 ATTR@0..18 POUND@0..1 "#" L_BRACK@1..2 "[" diff --git a/crates/ra_syntax/test_data/parser/err/0007_stray_curly_in_file.rast b/crates/ra_syntax/test_data/parser/err/0007_stray_curly_in_file.rast index b72c92c33c..2ae5bacea3 100644 --- a/crates/ra_syntax/test_data/parser/err/0007_stray_curly_in_file.rast +++ b/crates/ra_syntax/test_data/parser/err/0007_stray_curly_in_file.rast @@ -12,7 +12,7 @@ SOURCE_FILE@0..31 ERROR@14..15 R_CURLY@14..15 "}" WHITESPACE@15..17 "\n\n" - FN_DEF@17..27 + FN@17..27 FN_KW@17..19 "fn" WHITESPACE@19..20 " " NAME@20..23 diff --git a/crates/ra_syntax/test_data/parser/err/0008_item_block_recovery.rast b/crates/ra_syntax/test_data/parser/err/0008_item_block_recovery.rast index 33953d8d77..1e9637c26d 100644 --- a/crates/ra_syntax/test_data/parser/err/0008_item_block_recovery.rast +++ b/crates/ra_syntax/test_data/parser/err/0008_item_block_recovery.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..95 - FN_DEF@0..12 + FN@0..12 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 @@ -58,7 +58,7 @@ SOURCE_FILE@0..95 WHITESPACE@78..79 "\n" R_CURLY@79..80 "}" WHITESPACE@80..82 "\n\n" - FN_DEF@82..94 + FN@82..94 FN_KW@82..84 "fn" WHITESPACE@84..85 " " NAME@85..88 diff --git a/crates/ra_syntax/test_data/parser/err/0010_unsafe_lambda_block.rast b/crates/ra_syntax/test_data/parser/err/0010_unsafe_lambda_block.rast index 3bf57eacc7..1c3e0f65bf 100644 --- a/crates/ra_syntax/test_data/parser/err/0010_unsafe_lambda_block.rast +++ b/crates/ra_syntax/test_data/parser/err/0010_unsafe_lambda_block.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..42 - FN_DEF@0..41 + FN@0..41 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/err/0012_broken_lambda.rast b/crates/ra_syntax/test_data/parser/err/0012_broken_lambda.rast index e1e782f5f3..c8bf965506 100644 --- a/crates/ra_syntax/test_data/parser/err/0012_broken_lambda.rast +++ b/crates/ra_syntax/test_data/parser/err/0012_broken_lambda.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..389 - FN_DEF@0..389 + FN@0..389 VISIBILITY@0..10 PUB_KW@0..3 L_PAREN@3..4 diff --git a/crates/ra_syntax/test_data/parser/err/0014_where_no_bounds.rast b/crates/ra_syntax/test_data/parser/err/0014_where_no_bounds.rast index 9323b78905..1ab045a441 100644 --- a/crates/ra_syntax/test_data/parser/err/0014_where_no_bounds.rast +++ b/crates/ra_syntax/test_data/parser/err/0014_where_no_bounds.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..23 - FN_DEF@0..22 + FN@0..22 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/err/0015_curly_in_params.rast b/crates/ra_syntax/test_data/parser/err/0015_curly_in_params.rast index b18378cff2..a3c25b450a 100644 --- a/crates/ra_syntax/test_data/parser/err/0015_curly_in_params.rast +++ b/crates/ra_syntax/test_data/parser/err/0015_curly_in_params.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..14 - FN_DEF@0..7 + FN@0..7 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/err/0016_missing_semi.rast b/crates/ra_syntax/test_data/parser/err/0016_missing_semi.rast index 93434f34f4..66157c3dce 100644 --- a/crates/ra_syntax/test_data/parser/err/0016_missing_semi.rast +++ b/crates/ra_syntax/test_data/parser/err/0016_missing_semi.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..56 - FN_DEF@0..55 + FN@0..55 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/err/0017_incomplete_binexpr.rast b/crates/ra_syntax/test_data/parser/err/0017_incomplete_binexpr.rast index 628315c785..bb4a28f4e8 100644 --- a/crates/ra_syntax/test_data/parser/err/0017_incomplete_binexpr.rast +++ b/crates/ra_syntax/test_data/parser/err/0017_incomplete_binexpr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..47 - FN_DEF@0..46 + FN@0..46 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/err/0018_incomplete_fn.rast b/crates/ra_syntax/test_data/parser/err/0018_incomplete_fn.rast index a87e5061a7..ce43ddf454 100644 --- a/crates/ra_syntax/test_data/parser/err/0018_incomplete_fn.rast +++ b/crates/ra_syntax/test_data/parser/err/0018_incomplete_fn.rast @@ -11,7 +11,7 @@ SOURCE_FILE@0..183 ASSOC_ITEM_LIST@14..182 L_CURLY@14..15 "{" WHITESPACE@15..20 "\n " - FN_DEF@20..161 + FN@20..161 FN_KW@20..22 "fn" WHITESPACE@22..23 " " NAME@23..32 @@ -116,7 +116,7 @@ SOURCE_FILE@0..183 WHITESPACE@155..160 "\n " R_CURLY@160..161 "}" WHITESPACE@161..167 "\n\n " - FN_DEF@167..180 + FN@167..180 FN_KW@167..169 "fn" WHITESPACE@169..170 " " NAME@170..180 diff --git a/crates/ra_syntax/test_data/parser/err/0019_let_recover.rast b/crates/ra_syntax/test_data/parser/err/0019_let_recover.rast index 4ff27f5c85..f6fa964b7b 100644 --- a/crates/ra_syntax/test_data/parser/err/0019_let_recover.rast +++ b/crates/ra_syntax/test_data/parser/err/0019_let_recover.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..139 - FN_DEF@0..138 + FN@0..138 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/err/0020_fn_recover.rast b/crates/ra_syntax/test_data/parser/err/0020_fn_recover.rast index 5f3a31473f..6f6feba5a8 100644 --- a/crates/ra_syntax/test_data/parser/err/0020_fn_recover.rast +++ b/crates/ra_syntax/test_data/parser/err/0020_fn_recover.rast @@ -1,8 +1,8 @@ SOURCE_FILE@0..16 - FN_DEF@0..2 + FN@0..2 FN_KW@0..2 "fn" WHITESPACE@2..4 "\n\n" - FN_DEF@4..15 + FN@4..15 FN_KW@4..6 "fn" WHITESPACE@6..7 " " NAME@7..10 diff --git a/crates/ra_syntax/test_data/parser/err/0021_incomplete_param.rast b/crates/ra_syntax/test_data/parser/err/0021_incomplete_param.rast index 1746bd3c10..ba4ce47955 100644 --- a/crates/ra_syntax/test_data/parser/err/0021_incomplete_param.rast +++ b/crates/ra_syntax/test_data/parser/err/0021_incomplete_param.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..22 - FN_DEF@0..21 + FN@0..21 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/err/0022_bad_exprs.rast b/crates/ra_syntax/test_data/parser/err/0022_bad_exprs.rast index 28146f44e3..866f611136 100644 --- a/crates/ra_syntax/test_data/parser/err/0022_bad_exprs.rast +++ b/crates/ra_syntax/test_data/parser/err/0022_bad_exprs.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..112 - FN_DEF@0..33 + FN@0..33 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..4 @@ -40,7 +40,7 @@ SOURCE_FILE@0..112 WHITESPACE@31..32 " " R_CURLY@32..33 "}" WHITESPACE@33..34 "\n" - FN_DEF@34..68 + FN@34..68 FN_KW@34..36 "fn" WHITESPACE@36..37 " " NAME@37..38 @@ -88,7 +88,7 @@ SOURCE_FILE@0..112 WHITESPACE@66..67 " " R_CURLY@67..68 "}" WHITESPACE@68..69 "\n" - FN_DEF@69..111 + FN@69..111 FN_KW@69..71 "fn" WHITESPACE@71..72 " " NAME@72..73 diff --git a/crates/ra_syntax/test_data/parser/err/0023_mismatched_paren.rast b/crates/ra_syntax/test_data/parser/err/0023_mismatched_paren.rast index 9ea9d715ea..5ffefd7429 100644 --- a/crates/ra_syntax/test_data/parser/err/0023_mismatched_paren.rast +++ b/crates/ra_syntax/test_data/parser/err/0023_mismatched_paren.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..94 - FN_DEF@0..55 + FN@0..55 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.rast b/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.rast index 48610a5ebb..1e94e72bcc 100644 --- a/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.rast +++ b/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..240 - FN_DEF@0..53 + FN@0..53 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..4 @@ -65,7 +65,7 @@ SOURCE_FILE@0..240 L_CURLY@51..52 "{" R_CURLY@52..53 "}" WHITESPACE@53..55 "\n\n" - FN_DEF@55..239 + FN@55..239 FN_KW@55..57 "fn" WHITESPACE@57..58 " " NAME@58..62 diff --git a/crates/ra_syntax/test_data/parser/err/0025_nope.rast b/crates/ra_syntax/test_data/parser/err/0025_nope.rast index 88b086daff..4b9bd679e1 100644 --- a/crates/ra_syntax/test_data/parser/err/0025_nope.rast +++ b/crates/ra_syntax/test_data/parser/err/0025_nope.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..575 - FN_DEF@0..574 + FN@0..574 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/err/0027_incomplere_where_for.rast b/crates/ra_syntax/test_data/parser/err/0027_incomplere_where_for.rast index 4d6461d1e1..53704f640e 100644 --- a/crates/ra_syntax/test_data/parser/err/0027_incomplere_where_for.rast +++ b/crates/ra_syntax/test_data/parser/err/0027_incomplere_where_for.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..30 - FN_DEF@0..29 + FN@0..29 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/err/0029_field_completion.rast b/crates/ra_syntax/test_data/parser/err/0029_field_completion.rast index 0da8f59f04..bfcd0149ed 100644 --- a/crates/ra_syntax/test_data/parser/err/0029_field_completion.rast +++ b/crates/ra_syntax/test_data/parser/err/0029_field_completion.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..24 - FN_DEF@0..23 + FN@0..23 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/err/0031_block_inner_attrs.rast b/crates/ra_syntax/test_data/parser/err/0031_block_inner_attrs.rast index 515819e42e..55ff3943fb 100644 --- a/crates/ra_syntax/test_data/parser/err/0031_block_inner_attrs.rast +++ b/crates/ra_syntax/test_data/parser/err/0031_block_inner_attrs.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..350 - FN_DEF@0..349 + FN@0..349 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..8 diff --git a/crates/ra_syntax/test_data/parser/err/0032_match_arms_inner_attrs.rast b/crates/ra_syntax/test_data/parser/err/0032_match_arms_inner_attrs.rast index c6859eca8b..ec9f556aa5 100644 --- a/crates/ra_syntax/test_data/parser/err/0032_match_arms_inner_attrs.rast +++ b/crates/ra_syntax/test_data/parser/err/0032_match_arms_inner_attrs.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..293 - FN_DEF@0..292 + FN@0..292 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/err/0033_match_arms_outer_attrs.rast b/crates/ra_syntax/test_data/parser/err/0033_match_arms_outer_attrs.rast index 53e445459b..063532e02d 100644 --- a/crates/ra_syntax/test_data/parser/err/0033_match_arms_outer_attrs.rast +++ b/crates/ra_syntax/test_data/parser/err/0033_match_arms_outer_attrs.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..89 - FN_DEF@0..88 + FN@0..88 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/err/0034_bad_box_pattern.rast b/crates/ra_syntax/test_data/parser/err/0034_bad_box_pattern.rast index 1b2ac5011f..303a495764 100644 --- a/crates/ra_syntax/test_data/parser/err/0034_bad_box_pattern.rast +++ b/crates/ra_syntax/test_data/parser/err/0034_bad_box_pattern.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..91 - FN_DEF@0..89 + FN@0..89 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/err/0035_use_recover.rast b/crates/ra_syntax/test_data/parser/err/0035_use_recover.rast index 0415085b06..2f03709eba 100644 --- a/crates/ra_syntax/test_data/parser/err/0035_use_recover.rast +++ b/crates/ra_syntax/test_data/parser/err/0035_use_recover.rast @@ -34,7 +34,7 @@ SOURCE_FILE@0..48 USE@34..37 USE_KW@34..37 "use" WHITESPACE@37..38 "\n" - FN_DEF@38..47 + FN@38..47 FN_KW@38..40 "fn" WHITESPACE@40..41 " " NAME@41..42 diff --git a/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.rast b/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.rast index bc446e3dfc..f180616f17 100644 --- a/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.rast +++ b/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.rast @@ -17,7 +17,7 @@ SOURCE_FILE@0..118 ASSOC_ITEM_LIST@14..117 L_CURLY@14..15 "{" WHITESPACE@15..20 "\n " - FN_DEF@20..31 + FN@20..31 FN_KW@20..22 "fn" WHITESPACE@22..23 " " NAME@23..26 @@ -30,7 +30,7 @@ SOURCE_FILE@0..118 L_CURLY@29..30 "{" R_CURLY@30..31 "}" WHITESPACE@31..36 "\n " - FN_DEF@36..51 + FN@36..51 VISIBILITY@36..39 PUB_KW@36..39 "pub" WHITESPACE@39..40 " " diff --git a/crates/ra_syntax/test_data/parser/err/0038_endless_inclusive_range.rast b/crates/ra_syntax/test_data/parser/err/0038_endless_inclusive_range.rast index 21db9ee85e..bed7ad6c33 100644 --- a/crates/ra_syntax/test_data/parser/err/0038_endless_inclusive_range.rast +++ b/crates/ra_syntax/test_data/parser/err/0038_endless_inclusive_range.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..33 - FN_DEF@0..32 + FN@0..32 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/err/0039_lambda_recovery.rast b/crates/ra_syntax/test_data/parser/err/0039_lambda_recovery.rast index ec950381b4..a98c31b0c7 100644 --- a/crates/ra_syntax/test_data/parser/err/0039_lambda_recovery.rast +++ b/crates/ra_syntax/test_data/parser/err/0039_lambda_recovery.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..83 - FN_DEF@0..82 + FN@0..82 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/err/0044_unexpected_for_type.rast b/crates/ra_syntax/test_data/parser/err/0044_unexpected_for_type.rast index cb90f28bc7..5f59c3bc29 100644 --- a/crates/ra_syntax/test_data/parser/err/0044_unexpected_for_type.rast +++ b/crates/ra_syntax/test_data/parser/err/0044_unexpected_for_type.rast @@ -136,7 +136,7 @@ SOURCE_FILE@0..239 R_PAREN@147..148 ")" SEMICOLON@148..149 ";" WHITESPACE@149..150 "\n" - FN_DEF@150..238 + FN@150..238 FN_KW@150..152 "fn" WHITESPACE@152..153 " " NAME@153..164 diff --git a/crates/ra_syntax/test_data/parser/err/0163_weird_blocks.rast b/crates/ra_syntax/test_data/parser/err/0163_weird_blocks.rast index e464563842..df29017e7f 100644 --- a/crates/ra_syntax/test_data/parser/err/0163_weird_blocks.rast +++ b/crates/ra_syntax/test_data/parser/err/0163_weird_blocks.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..83 - FN_DEF@0..82 + FN@0..82 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/fragments/item/ok/0000_fn.rast b/crates/ra_syntax/test_data/parser/fragments/item/ok/0000_fn.rast index f1e78f3882..93c429e128 100644 --- a/crates/ra_syntax/test_data/parser/fragments/item/ok/0000_fn.rast +++ b/crates/ra_syntax/test_data/parser/fragments/item/ok/0000_fn.rast @@ -1,4 +1,4 @@ -FN_DEF@0..11 +FN@0..11 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.rast b/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.rast index 75668c818d..8b0a888fd5 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..30 - FN_DEF@0..29 + FN@0..29 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.rast b/crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.rast index c789e8d825..cc0f8bcaf9 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..33 - FN_DEF@0..10 + FN@0..10 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 @@ -19,7 +19,7 @@ SOURCE_FILE@0..33 WHITESPACE@19..20 " " R_CURLY@20..21 "}" WHITESPACE@21..22 " " - FN_DEF@22..32 + FN@22..32 FN_KW@22..24 "fn" WHITESPACE@24..25 " " NAME@25..28 diff --git a/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.rast b/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.rast index cd24313d4d..3f3a7f1b9d 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..30 - FN_DEF@0..29 + FN@0..29 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.rast b/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.rast index c5fa7a4046..63a10127dd 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..21 - FN_DEF@0..20 + FN@0..20 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.rast b/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.rast index 4e3fa704e6..8fd8d5e593 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..48 - FN_DEF@0..47 + FN@0..47 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rast b/crates/ra_syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rast index e1abc56331..fa14e1e6de 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..47 - FN_DEF@0..46 + FN@0..46 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rast b/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rast index 53f7ebaf9a..d2a18330fa 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rast @@ -2,7 +2,7 @@ SOURCE_FILE@0..50 ERROR@0..6 UNSAFE_KW@0..6 "unsafe" WHITESPACE@6..7 " " - FN_DEF@7..24 + FN@7..24 ASYNC_KW@7..12 "async" WHITESPACE@12..13 " " FN_KW@13..15 "fn" diff --git a/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rast b/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rast index 5501dc5a68..b311952817 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rast @@ -35,7 +35,7 @@ SOURCE_FILE@0..62 NAME_REF@40..47 IDENT@40..47 "default" WHITESPACE@47..48 " " - FN_DEF@48..59 + FN@48..59 FN_KW@48..50 "fn" WHITESPACE@50..51 " " NAME@51..54 diff --git a/crates/ra_syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rast b/crates/ra_syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rast index a9de44b57c..6753c3fe7f 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..45 - FN_DEF@0..44 + FN@0..44 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.rast b/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.rast index f422acddaa..7847ba65a1 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.rast @@ -41,7 +41,7 @@ SOURCE_FILE@0..83 IDENT@41..44 "i32" SEMICOLON@44..45 ";" WHITESPACE@45..50 "\n " - FN_DEF@50..61 + FN@50..61 FN_KW@50..52 "fn" WHITESPACE@52..53 " " NAME@53..56 @@ -54,7 +54,7 @@ SOURCE_FILE@0..83 L_CURLY@59..60 "{" R_CURLY@60..61 "}" WHITESPACE@61..66 "\n " - FN_DEF@66..80 + FN@66..80 FN_KW@66..68 "fn" WHITESPACE@68..69 " " NAME@69..72 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0003_where_pred_for.rast b/crates/ra_syntax/test_data/parser/inline/ok/0003_where_pred_for.rast index cd0892451d..9cae1e8cc4 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0003_where_pred_for.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0003_where_pred_for.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..54 - FN_DEF@0..53 + FN@0..53 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..12 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0005_function_type_params.rast b/crates/ra_syntax/test_data/parser/inline/ok/0005_function_type_params.rast index 6c8c1e24b0..1b56e20d59 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0005_function_type_params.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0005_function_type_params.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..28 - FN_DEF@0..27 + FN@0..27 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.rast b/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.rast index 0cd1dffc9f..87c170707c 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.rast @@ -11,7 +11,7 @@ SOURCE_FILE@0..128 ASSOC_ITEM_LIST@7..127 L_CURLY@7..8 "{" WHITESPACE@8..13 "\n " - FN_DEF@13..26 + FN@13..26 FN_KW@13..15 "fn" WHITESPACE@15..16 " " NAME@16..17 @@ -26,7 +26,7 @@ SOURCE_FILE@0..128 L_CURLY@24..25 "{" R_CURLY@25..26 "}" WHITESPACE@26..31 "\n " - FN_DEF@31..46 + FN@31..46 FN_KW@31..33 "fn" WHITESPACE@33..34 " " NAME@34..35 @@ -43,7 +43,7 @@ SOURCE_FILE@0..128 L_CURLY@44..45 "{" R_CURLY@45..46 "}" WHITESPACE@46..51 "\n " - FN_DEF@51..69 + FN@51..69 FN_KW@51..53 "fn" WHITESPACE@53..54 " " NAME@54..55 @@ -62,7 +62,7 @@ SOURCE_FILE@0..128 L_CURLY@67..68 "{" R_CURLY@68..69 "}" WHITESPACE@69..74 "\n " - FN_DEF@74..103 + FN@74..103 FN_KW@74..76 "fn" WHITESPACE@76..77 " " NAME@77..78 @@ -95,7 +95,7 @@ SOURCE_FILE@0..128 L_CURLY@101..102 "{" R_CURLY@102..103 "}" WHITESPACE@103..108 "\n " - FN_DEF@108..125 + FN@108..125 FN_KW@108..110 "fn" WHITESPACE@110..111 " " NAME@111..112 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0008_path_part.rast b/crates/ra_syntax/test_data/parser/inline/ok/0008_path_part.rast index 10eb31d686..3ce2acfae9 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0008_path_part.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0008_path_part.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..103 - FN_DEF@0..102 + FN@0..102 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0009_loop_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0009_loop_expr.rast index 425e5196cb..f62826fd55 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0009_loop_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0009_loop_expr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..26 - FN_DEF@0..25 + FN@0..25 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0011_field_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0011_field_expr.rast index d823c08fc1..66a609346a 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0011_field_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0011_field_expr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..48 - FN_DEF@0..47 + FN@0..47 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0015_continue_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0015_continue_expr.rast index 422912e3cb..104e153ce6 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0015_continue_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0015_continue_expr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..69 - FN_DEF@0..68 + FN@0..68 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.rast b/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.rast index 79148e953c..e75180900b 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.rast @@ -11,7 +11,7 @@ SOURCE_FILE@0..69 ASSOC_ITEM_LIST@7..68 L_CURLY@7..8 "{" WHITESPACE@8..13 "\n " - FN_DEF@13..33 + FN@13..33 FN_KW@13..15 "fn" WHITESPACE@15..16 " " NAME@16..17 @@ -35,7 +35,7 @@ SOURCE_FILE@0..69 L_CURLY@31..32 "{" R_CURLY@32..33 "}" WHITESPACE@33..38 "\n " - FN_DEF@38..66 + FN@38..66 FN_KW@38..40 "fn" WHITESPACE@40..41 " " NAME@41..42 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0019_unary_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0019_unary_expr.rast index 10d6b2fdef..7db38ea4da 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0019_unary_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0019_unary_expr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..44 - FN_DEF@0..43 + FN@0..43 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.rast b/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.rast index 31b5b6616b..daa55ec6cc 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.rast @@ -45,7 +45,7 @@ SOURCE_FILE@0..89 INT_NUMBER@46..48 "92" SEMICOLON@48..49 ";" WHITESPACE@49..54 "\n " - FN_DEF@54..65 + FN@54..65 FN_KW@54..56 "fn" WHITESPACE@56..57 " " NAME@57..60 @@ -58,7 +58,7 @@ SOURCE_FILE@0..89 L_CURLY@63..64 "{" R_CURLY@64..65 "}" WHITESPACE@65..70 "\n " - FN_DEF@70..86 + FN@70..86 FN_KW@70..72 "fn" WHITESPACE@72..73 " " NAME@73..76 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0024_slice_pat.rast b/crates/ra_syntax/test_data/parser/inline/ok/0024_slice_pat.rast index 7eb27d5e14..dea0c73f77 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0024_slice_pat.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0024_slice_pat.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..39 - FN_DEF@0..38 + FN@0..38 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.rast b/crates/ra_syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.rast index b4598768ee..e5f5503471 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..97 - FN_DEF@0..96 + FN@0..96 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0027_ref_pat.rast b/crates/ra_syntax/test_data/parser/inline/ok/0027_ref_pat.rast index b824c10a8c..9e76d881ec 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0027_ref_pat.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0027_ref_pat.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..52 - FN_DEF@0..51 + FN@0..51 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0029_cast_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0029_cast_expr.rast index fabb09937f..e096b3a1f6 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0029_cast_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0029_cast_expr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..89 - FN_DEF@0..88 + FN@0..88 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0030_cond.rast b/crates/ra_syntax/test_data/parser/inline/ok/0030_cond.rast index 3aed267322..381284dc5d 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0030_cond.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0030_cond.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..197 - FN_DEF@0..37 + FN@0..37 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 @@ -41,7 +41,7 @@ SOURCE_FILE@0..197 WHITESPACE@35..36 " " R_CURLY@36..37 "}" WHITESPACE@37..38 "\n" - FN_DEF@38..196 + FN@38..196 FN_KW@38..40 "fn" WHITESPACE@40..41 " " NAME@41..44 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0031_while_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0031_while_expr.rast index 899b63aac3..ffe1a3a010 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0031_while_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0031_while_expr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..93 - FN_DEF@0..92 + FN@0..92 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0034_break_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0034_break_expr.rast index e064aafaf2..f905def6ff 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0034_break_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0034_break_expr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..102 - FN_DEF@0..101 + FN@0..101 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0036_unsafe_extern_fn.rast b/crates/ra_syntax/test_data/parser/inline/ok/0036_unsafe_extern_fn.rast index cf58255931..293b1d64c7 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0036_unsafe_extern_fn.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0036_unsafe_extern_fn.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..30 - FN_DEF@0..29 + FN@0..29 UNSAFE_KW@0..6 "unsafe" WHITESPACE@6..7 " " ABI@7..17 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0037_qual_paths.rast b/crates/ra_syntax/test_data/parser/inline/ok/0037_qual_paths.rast index fbd90bc0f7..8f6cd2e2f3 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0037_qual_paths.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0037_qual_paths.rast @@ -32,7 +32,7 @@ SOURCE_FILE@0..71 IDENT@19..25 "Output" SEMICOLON@25..26 ";" WHITESPACE@26..27 "\n" - FN_DEF@27..70 + FN@27..70 FN_KW@27..29 "fn" WHITESPACE@29..30 " " NAME@30..33 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0038_full_range_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0038_full_range_expr.rast index a767f145db..64e705fb3d 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0038_full_range_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0038_full_range_expr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..21 - FN_DEF@0..20 + FN@0..20 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.rast b/crates/ra_syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.rast index aa582516a3..47cbe7c1f0 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..71 - FN_DEF@0..19 + FN@0..19 VISIBILITY@0..5 CRATE_KW@0..5 "crate" WHITESPACE@5..6 " " diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0042_call_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0042_call_expr.rast index 0c1c6e8771..40875ae1e5 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0042_call_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0042_call_expr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..118 - FN_DEF@0..117 + FN@0..117 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0044_block_items.rast b/crates/ra_syntax/test_data/parser/inline/ok/0044_block_items.rast index c23b3b67cf..1fd3cd0e78 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0044_block_items.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0044_block_items.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..21 - FN_DEF@0..20 + FN@0..20 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..4 @@ -11,7 +11,7 @@ SOURCE_FILE@0..21 BLOCK_EXPR@7..20 L_CURLY@7..8 "{" WHITESPACE@8..9 " " - FN_DEF@9..18 + FN@9..18 FN_KW@9..11 "fn" WHITESPACE@11..12 " " NAME@12..13 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rast b/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rast index 9ca2165baf..fbf2e7c671 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..35 - FN_DEF@0..34 + FN@0..34 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.rast b/crates/ra_syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.rast index b209f67f8c..37757ccd45 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..58 - FN_DEF@0..26 + FN@0..26 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 @@ -38,7 +38,7 @@ SOURCE_FILE@0..58 L_CURLY@24..25 "{" R_CURLY@25..26 "}" WHITESPACE@26..27 "\n" - FN_DEF@27..57 + FN@27..57 FN_KW@27..29 "fn" WHITESPACE@29..30 " " NAME@30..33 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0050_fn_decl.rast b/crates/ra_syntax/test_data/parser/inline/ok/0050_fn_decl.rast index 5f1429102c..02c57079f6 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0050_fn_decl.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0050_fn_decl.rast @@ -8,7 +8,7 @@ SOURCE_FILE@0..22 ASSOC_ITEM_LIST@8..21 L_CURLY@8..9 "{" WHITESPACE@9..10 " " - FN_DEF@10..19 + FN@10..19 FN_KW@10..12 "fn" WHITESPACE@12..13 " " NAME@13..16 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0053_path_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0053_path_expr.rast index 70232a3b27..2bfb524530 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0053_path_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0053_path_expr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..91 - FN_DEF@0..90 + FN@0..90 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0055_literal_pattern.rast b/crates/ra_syntax/test_data/parser/inline/ok/0055_literal_pattern.rast index 03c52525eb..68bb438525 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0055_literal_pattern.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0055_literal_pattern.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..113 - FN_DEF@0..112 + FN@0..112 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0056_where_clause.rast b/crates/ra_syntax/test_data/parser/inline/ok/0056_where_clause.rast index 24f89b83ff..28129c50c6 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0056_where_clause.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0056_where_clause.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..116 - FN_DEF@0..115 + FN@0..115 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0057_const_fn.rast b/crates/ra_syntax/test_data/parser/inline/ok/0057_const_fn.rast index bb43d1eaf3..97548a5eeb 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0057_const_fn.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0057_const_fn.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..18 - FN_DEF@0..17 + FN@0..17 CONST_KW@0..5 "const" WHITESPACE@5..6 " " FN_KW@6..8 "fn" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0058_range_pat.rast b/crates/ra_syntax/test_data/parser/inline/ok/0058_range_pat.rast index 8bd94a8684..3e72f9671c 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0058_range_pat.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0058_range_pat.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..112 - FN_DEF@0..111 + FN@0..111 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0059_match_arms_commas.rast b/crates/ra_syntax/test_data/parser/inline/ok/0059_match_arms_commas.rast index 9210f155cb..fa659c19bb 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0059_match_arms_commas.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0059_match_arms_commas.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..83 - FN_DEF@0..82 + FN@0..82 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0061_record_lit.rast b/crates/ra_syntax/test_data/parser/inline/ok/0061_record_lit.rast index 850465d824..b0aa73b7de 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0061_record_lit.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0061_record_lit.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..112 - FN_DEF@0..111 + FN@0..111 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0062_mod_contents.rast b/crates/ra_syntax/test_data/parser/inline/ok/0062_mod_contents.rast index 02656df31f..f6417ab131 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0062_mod_contents.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0062_mod_contents.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..70 - FN_DEF@0..11 + FN@0..11 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0064_if_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0064_if_expr.rast index 445d8d309f..5871600034 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0064_if_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0064_if_expr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..137 - FN_DEF@0..136 + FN@0..136 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0066_match_arm.rast b/crates/ra_syntax/test_data/parser/inline/ok/0066_match_arm.rast index 177bb5514a..d2279877b4 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0066_match_arm.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0066_match_arm.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..167 - FN_DEF@0..166 + FN@0..166 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rast b/crates/ra_syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rast index f8ff7079b5..4c1165dc83 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..46 - FN_DEF@0..45 + FN@0..45 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0071_match_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0071_match_expr.rast index 07b3d14351..d6926425c1 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0071_match_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0071_match_expr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..97 - FN_DEF@0..96 + FN@0..96 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0072_return_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0072_return_expr.rast index 665f716a86..437d7ac042 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0072_return_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0072_return_expr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..40 - FN_DEF@0..39 + FN@0..39 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rast b/crates/ra_syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rast index 3fd3a4391d..3ca70f021b 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..84 - FN_DEF@0..83 + FN@0..83 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0075_block.rast b/crates/ra_syntax/test_data/parser/inline/ok/0075_block.rast index 97c6e6a9dd..5cefc50767 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0075_block.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0075_block.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..65 - FN_DEF@0..9 + FN@0..9 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..4 @@ -12,7 +12,7 @@ SOURCE_FILE@0..65 L_CURLY@7..8 "{" R_CURLY@8..9 "}" WHITESPACE@9..10 "\n" - FN_DEF@10..31 + FN@10..31 FN_KW@10..12 "fn" WHITESPACE@12..13 " " NAME@13..14 @@ -38,7 +38,7 @@ SOURCE_FILE@0..65 WHITESPACE@29..30 " " R_CURLY@30..31 "}" WHITESPACE@31..32 "\n" - FN_DEF@32..48 + FN@32..48 FN_KW@32..34 "fn" WHITESPACE@34..35 " " NAME@35..36 @@ -62,7 +62,7 @@ SOURCE_FILE@0..65 WHITESPACE@46..47 " " R_CURLY@47..48 "}" WHITESPACE@48..49 "\n" - FN_DEF@49..64 + FN@49..64 FN_KW@49..51 "fn" WHITESPACE@51..52 " " NAME@52..53 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0076_function_where_clause.rast b/crates/ra_syntax/test_data/parser/inline/ok/0076_function_where_clause.rast index e2c1a507de..cfa4c05f53 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0076_function_where_clause.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0076_function_where_clause.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..29 - FN_DEF@0..28 + FN@0..28 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0077_try_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0077_try_expr.rast index 4f3a8ed24e..33e6fb93f7 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0077_try_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0077_try_expr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..21 - FN_DEF@0..20 + FN@0..20 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.rast b/crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.rast index 462d1a8bb0..3c80846db9 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..89 - FN_DEF@0..88 + FN@0..88 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.rast index 58bdf7e34c..1563b1988b 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..200 - FN_DEF@0..199 + FN@0..199 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0085_expr_literals.rast b/crates/ra_syntax/test_data/parser/inline/ok/0085_expr_literals.rast index 9fcb7899e2..ded36949a0 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0085_expr_literals.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0085_expr_literals.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..189 - FN_DEF@0..188 + FN@0..188 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0086_function_ret_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0086_function_ret_type.rast index a42abc189d..70e05a859b 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0086_function_ret_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0086_function_ret_type.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..30 - FN_DEF@0..11 + FN@0..11 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 @@ -12,7 +12,7 @@ SOURCE_FILE@0..30 L_CURLY@9..10 "{" R_CURLY@10..11 "}" WHITESPACE@11..12 "\n" - FN_DEF@12..29 + FN@12..29 FN_KW@12..14 "fn" WHITESPACE@14..15 " " NAME@15..18 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0088_break_ambiguity.rast b/crates/ra_syntax/test_data/parser/inline/ok/0088_break_ambiguity.rast index 7e71d73738..34f520994b 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0088_break_ambiguity.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0088_break_ambiguity.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..88 - FN_DEF@0..87 + FN@0..87 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0089_extern_fn.rast b/crates/ra_syntax/test_data/parser/inline/ok/0089_extern_fn.rast index 48aaf1004d..405b6a259f 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0089_extern_fn.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0089_extern_fn.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..19 - FN_DEF@0..18 + FN@0..18 ABI@0..6 EXTERN_KW@0..6 "extern" WHITESPACE@6..7 " " diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0093_index_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0093_index_expr.rast index aed81f9b0f..82f03f9c18 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0093_index_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0093_index_expr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..26 - FN_DEF@0..25 + FN@0..25 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0095_placeholder_pat.rast b/crates/ra_syntax/test_data/parser/inline/ok/0095_placeholder_pat.rast index 67d9595d3d..25706d2a40 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0095_placeholder_pat.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0095_placeholder_pat.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..26 - FN_DEF@0..25 + FN@0..25 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0096_no_semi_after_block.rast b/crates/ra_syntax/test_data/parser/inline/ok/0096_no_semi_after_block.rast index 031e746521..cb5316a0dd 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0096_no_semi_after_block.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0096_no_semi_after_block.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..167 - FN_DEF@0..166 + FN@0..166 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0098_const_unsafe_fn.rast b/crates/ra_syntax/test_data/parser/inline/ok/0098_const_unsafe_fn.rast index 816e493107..32a77ba490 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0098_const_unsafe_fn.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0098_const_unsafe_fn.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..25 - FN_DEF@0..24 + FN@0..24 CONST_KW@0..5 "const" WHITESPACE@5..6 " " UNSAFE_KW@6..12 "unsafe" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0099_param_list.rast b/crates/ra_syntax/test_data/parser/inline/ok/0099_param_list.rast index d48ef865cb..1627556c85 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0099_param_list.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0099_param_list.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..67 - FN_DEF@0..9 + FN@0..9 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..4 @@ -12,7 +12,7 @@ SOURCE_FILE@0..67 L_CURLY@7..8 "{" R_CURLY@8..9 "}" WHITESPACE@9..10 "\n" - FN_DEF@10..25 + FN@10..25 FN_KW@10..12 "fn" WHITESPACE@12..13 " " NAME@13..14 @@ -36,7 +36,7 @@ SOURCE_FILE@0..67 L_CURLY@23..24 "{" R_CURLY@24..25 "}" WHITESPACE@25..26 "\n" - FN_DEF@26..43 + FN@26..43 FN_KW@26..28 "fn" WHITESPACE@28..29 " " NAME@29..30 @@ -62,7 +62,7 @@ SOURCE_FILE@0..67 L_CURLY@41..42 "{" R_CURLY@42..43 "}" WHITESPACE@43..44 "\n" - FN_DEF@44..66 + FN@44..66 FN_KW@44..46 "fn" WHITESPACE@46..47 " " NAME@47..48 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0100_for_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0100_for_expr.rast index e4455cd3e4..766de4efe8 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0100_for_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0100_for_expr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..33 - FN_DEF@0..32 + FN@0..32 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0101_unsafe_fn.rast b/crates/ra_syntax/test_data/parser/inline/ok/0101_unsafe_fn.rast index 8a87430600..73c94e5d43 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0101_unsafe_fn.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0101_unsafe_fn.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..19 - FN_DEF@0..18 + FN@0..18 UNSAFE_KW@0..6 "unsafe" WHITESPACE@6..7 " " FN_KW@7..9 "fn" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0102_record_field_pat_list.rast b/crates/ra_syntax/test_data/parser/inline/ok/0102_record_field_pat_list.rast index 9f966ff8a0..fe1c290c3e 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0102_record_field_pat_list.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0102_record_field_pat_list.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..119 - FN_DEF@0..118 + FN@0..118 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0103_array_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0103_array_expr.rast index 9b3bef04e5..c4c0a0568a 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0103_array_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0103_array_expr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..55 - FN_DEF@0..54 + FN@0..54 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0106_lambda_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0106_lambda_expr.rast index e647171526..51a6c51708 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0106_lambda_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0106_lambda_expr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..134 - FN_DEF@0..133 + FN@0..133 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0107_method_call_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0107_method_call_expr.rast index 98963dc62e..b2961b0ff1 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0107_method_call_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0107_method_call_expr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..49 - FN_DEF@0..48 + FN@0..48 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0108_tuple_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0108_tuple_expr.rast index ea603e2c93..ca7e4a5c36 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0108_tuple_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0108_tuple_expr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..40 - FN_DEF@0..39 + FN@0..39 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0109_label.rast b/crates/ra_syntax/test_data/parser/inline/ok/0109_label.rast index 30ff96a7c9..a6a169f1b1 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0109_label.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0109_label.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..74 - FN_DEF@0..73 + FN@0..73 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0111_tuple_pat.rast b/crates/ra_syntax/test_data/parser/inline/ok/0111_tuple_pat.rast index b58f40ac15..432318da0b 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0111_tuple_pat.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0111_tuple_pat.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..94 - FN_DEF@0..93 + FN@0..93 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0112_bind_pat.rast b/crates/ra_syntax/test_data/parser/inline/ok/0112_bind_pat.rast index b67714c176..3cd554d459 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0112_bind_pat.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0112_bind_pat.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..146 - FN_DEF@0..145 + FN@0..145 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0113_nocontentexpr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0113_nocontentexpr.rast index 5de480da90..d761c1c68e 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0113_nocontentexpr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0113_nocontentexpr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..50 - FN_DEF@0..49 + FN@0..49 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0118_match_guard.rast b/crates/ra_syntax/test_data/parser/inline/ok/0118_match_guard.rast index e152c6b6cd..aaaf803b7c 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0118_match_guard.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0118_match_guard.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..58 - FN_DEF@0..57 + FN@0..57 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rast b/crates/ra_syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rast index b283ab8041..4b5f9cdc99 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..139 - FN_DEF@0..138 + FN@0..138 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rast b/crates/ra_syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rast index 9d54709142..54cc3be3a0 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..259 - FN_DEF@0..258 + FN@0..258 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0122_generic_lifetime_type_attribute.rast b/crates/ra_syntax/test_data/parser/inline/ok/0122_generic_lifetime_type_attribute.rast index ada2fc54eb..f4008cfdc9 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0122_generic_lifetime_type_attribute.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0122_generic_lifetime_type_attribute.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..64 - FN_DEF@0..63 + FN@0..63 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0123_param_list_vararg.rast b/crates/ra_syntax/test_data/parser/inline/ok/0123_param_list_vararg.rast index b3a33c14df..f155743cfb 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0123_param_list_vararg.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0123_param_list_vararg.rast @@ -8,7 +8,7 @@ SOURCE_FILE@0..57 EXTERN_ITEM_LIST@11..56 L_CURLY@11..12 "{" WHITESPACE@12..13 " " - FN_DEF@13..54 + FN@13..54 FN_KW@13..15 "fn" WHITESPACE@15..16 " " NAME@16..22 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0124_async_fn.rast b/crates/ra_syntax/test_data/parser/inline/ok/0124_async_fn.rast index 6178dfe598..a7df188bd6 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0124_async_fn.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0124_async_fn.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..18 - FN_DEF@0..17 + FN@0..17 ASYNC_KW@0..5 "async" WHITESPACE@5..6 " " FN_KW@6..8 "fn" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0125_crate_keyword_path.rast b/crates/ra_syntax/test_data/parser/inline/ok/0125_crate_keyword_path.rast index ced59b7c1f..aa4d7a784f 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0125_crate_keyword_path.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0125_crate_keyword_path.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..27 - FN_DEF@0..26 + FN@0..26 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0125_record_literal_field_with_attr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0125_record_literal_field_with_attr.rast index 97611f7f39..20979cef3f 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0125_record_literal_field_with_attr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0125_record_literal_field_with_attr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..46 - FN_DEF@0..45 + FN@0..45 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.rast b/crates/ra_syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.rast index 09221fc540..0342e64f39 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..82 - FN_DEF@0..81 + FN@0..81 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0127_attr_on_last_expr_in_block.rast b/crates/ra_syntax/test_data/parser/inline/ok/0127_attr_on_last_expr_in_block.rast index 93cc41533f..3b46e5b479 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0127_attr_on_last_expr_in_block.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0127_attr_on_last_expr_in_block.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..47 - FN_DEF@0..46 + FN@0..46 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0128_combined_fns.rast b/crates/ra_syntax/test_data/parser/inline/ok/0128_combined_fns.rast index 0901f23481..98a20f36d6 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0128_combined_fns.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0128_combined_fns.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..50 - FN_DEF@0..24 + FN@0..24 ASYNC_KW@0..5 "async" WHITESPACE@5..6 " " UNSAFE_KW@6..12 "unsafe" @@ -16,7 +16,7 @@ SOURCE_FILE@0..50 L_CURLY@22..23 "{" R_CURLY@23..24 "}" WHITESPACE@24..25 "\n" - FN_DEF@25..49 + FN@25..49 CONST_KW@25..30 "const" WHITESPACE@30..31 " " UNSAFE_KW@31..37 "unsafe" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.rast b/crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.rast index 28291afc2b..e283966ca2 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..33 - FN_DEF@0..32 + FN@0..32 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0130_let_stmt.rast b/crates/ra_syntax/test_data/parser/inline/ok/0130_let_stmt.rast index bb94a05c69..931e81f274 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0130_let_stmt.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0130_let_stmt.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..135 - FN_DEF@0..134 + FN@0..134 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0130_try_block_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0130_try_block_expr.rast index 8f2f144c7e..0fe3bf582a 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0130_try_block_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0130_try_block_expr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..33 - FN_DEF@0..32 + FN@0..32 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0132_box_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0132_box_expr.rast index 87ac427480..48f4838138 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0132_box_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0132_box_expr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..106 - FN_DEF@0..105 + FN@0..105 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.rast index 3772cb64ba..9fc724f3fd 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.rast @@ -36,7 +36,7 @@ SOURCE_FILE@0..69 IDENT@38..41 "Bar" SEMICOLON@41..42 ";" WHITESPACE@42..47 "\n " - FN_DEF@47..66 + FN@47..66 DEFAULT_KW@47..54 "default" WHITESPACE@54..55 " " FN_KW@55..57 "fn" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rast b/crates/ra_syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rast index b330a09323..ceae8a4ec6 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..111 - FN_DEF@0..110 + FN@0..110 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..18 @@ -33,7 +33,7 @@ SOURCE_FILE@0..111 R_CURLY@74..75 "}" SEMICOLON@75..76 ";" WHITESPACE@76..81 "\n " - FN_DEF@81..90 + FN@81..90 FN_KW@81..83 "fn" WHITESPACE@83..84 " " NAME@84..85 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0137_await_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0137_await_expr.rast index 8e8d9e9920..923effe383 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0137_await_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0137_await_expr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..67 - FN_DEF@0..66 + FN@0..66 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0138_associated_type_bounds.rast b/crates/ra_syntax/test_data/parser/inline/ok/0138_associated_type_bounds.rast index c457851c94..1ad03e0058 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0138_associated_type_bounds.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0138_associated_type_bounds.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..59 - FN_DEF@0..58 + FN@0..58 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..12 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0138_expression_after_block.rast b/crates/ra_syntax/test_data/parser/inline/ok/0138_expression_after_block.rast index ea325831e2..a03139ab51 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0138_expression_after_block.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0138_expression_after_block.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..52 - FN_DEF@0..51 + FN@0..51 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.rast index 9135de9df1..6403ff8d5c 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..26 - FN_DEF@0..25 + FN@0..25 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..4 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0139_param_outer_arg.rast b/crates/ra_syntax/test_data/parser/inline/ok/0139_param_outer_arg.rast index 14610a0a29..36fd2997b0 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0139_param_outer_arg.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0139_param_outer_arg.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..28 - FN_DEF@0..27 + FN@0..27 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..4 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0142_for_range_from.rast b/crates/ra_syntax/test_data/parser/inline/ok/0142_for_range_from.rast index e6be8b7e47..d11019076d 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0142_for_range_from.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0142_for_range_from.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..51 - FN_DEF@0..50 + FN@0..50 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0143_box_pat.rast b/crates/ra_syntax/test_data/parser/inline/ok/0143_box_pat.rast index 57fba5fd5f..09fd9e9b8c 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0143_box_pat.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0143_box_pat.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..118 - FN_DEF@0..117 + FN@0..117 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0144_dot_dot_pat.rast b/crates/ra_syntax/test_data/parser/inline/ok/0144_dot_dot_pat.rast index 8d8b9597b0..8d0f1ead53 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0144_dot_dot_pat.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0144_dot_dot_pat.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..555 - FN_DEF@0..554 + FN@0..554 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0145_record_field_pat.rast b/crates/ra_syntax/test_data/parser/inline/ok/0145_record_field_pat.rast index 7c092d518f..b41ef4098a 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0145_record_field_pat.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0145_record_field_pat.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..63 - FN_DEF@0..62 + FN@0..62 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0146_as_precedence.rast b/crates/ra_syntax/test_data/parser/inline/ok/0146_as_precedence.rast index 8382a4f96a..2d0c834587 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0146_as_precedence.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0146_as_precedence.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..43 - FN_DEF@0..42 + FN@0..42 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0152_arg_with_attr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0152_arg_with_attr.rast index f43dfbe630..2905c5f1a5 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0152_arg_with_attr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0152_arg_with_attr.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..34 - FN_DEF@0..33 + FN@0..33 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0155_closure_params.rast b/crates/ra_syntax/test_data/parser/inline/ok/0155_closure_params.rast index ecac059502..c63a55a56b 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0155_closure_params.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0155_closure_params.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..63 - FN_DEF@0..62 + FN@0..62 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0156_fn_def_param.rast b/crates/ra_syntax/test_data/parser/inline/ok/0156_fn_def_param.rast index 0928334176..3b8dfefc6a 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0156_fn_def_param.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0156_fn_def_param.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..30 - FN_DEF@0..29 + FN@0..29 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0156_or_pattern.rast b/crates/ra_syntax/test_data/parser/inline/ok/0156_or_pattern.rast index 88d512f1ae..4d4c41f1a5 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0156_or_pattern.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0156_or_pattern.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..130 - FN_DEF@0..129 + FN@0..129 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0158_binop_resets_statementness.rast b/crates/ra_syntax/test_data/parser/inline/ok/0158_binop_resets_statementness.rast index bd9e8d40fe..8ae24b9c10 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0158_binop_resets_statementness.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0158_binop_resets_statementness.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..28 - FN_DEF@0..27 + FN@0..27 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0158_lambda_ret_block.rast b/crates/ra_syntax/test_data/parser/inline/ok/0158_lambda_ret_block.rast index 08333a3254..9c071ec2e1 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0158_lambda_ret_block.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0158_lambda_ret_block.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..34 - FN_DEF@0..33 + FN@0..33 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0159_try_macro_fallback.rast b/crates/ra_syntax/test_data/parser/inline/ok/0159_try_macro_fallback.rast index 5f09e4f4af..fb46d4ce40 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0159_try_macro_fallback.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0159_try_macro_fallback.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..27 - FN_DEF@0..26 + FN@0..26 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0161_labeled_block.rast b/crates/ra_syntax/test_data/parser/inline/ok/0161_labeled_block.rast index 9efebd8b8a..9e9a5f9c5b 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0161_labeled_block.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0161_labeled_block.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..23 - FN_DEF@0..22 + FN@0..22 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..4 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0162_unsafe_block.rast b/crates/ra_syntax/test_data/parser/inline/ok/0162_unsafe_block.rast index 4991f2c36b..ca9a1183d6 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0162_unsafe_block.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0162_unsafe_block.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..22 - FN_DEF@0..21 + FN@0..21 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..4 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_fn.rast b/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_fn.rast index c0b8c0300c..680f354458 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_fn.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_fn.rast @@ -19,7 +19,7 @@ SOURCE_FILE@0..50 ASSOC_ITEM_LIST@15..49 L_CURLY@15..16 "{" WHITESPACE@16..21 "\n " - FN_DEF@21..47 + FN@21..47 DEFAULT_KW@21..28 "default" WHITESPACE@28..29 " " UNSAFE_KW@29..35 "unsafe" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0164_type_path_in_pattern.rast b/crates/ra_syntax/test_data/parser/inline/ok/0164_type_path_in_pattern.rast index 8688992750..f5e20b93dd 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0164_type_path_in_pattern.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0164_type_path_in_pattern.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..33 - FN_DEF@0..32 + FN@0..32 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/ok/0005_fn_item.rast b/crates/ra_syntax/test_data/parser/ok/0005_fn_item.rast index 0ec237f8e4..a7a2b11a72 100644 --- a/crates/ra_syntax/test_data/parser/ok/0005_fn_item.rast +++ b/crates/ra_syntax/test_data/parser/ok/0005_fn_item.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..13 - FN_DEF@0..12 + FN@0..12 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/ok/0008_mod_item.rast b/crates/ra_syntax/test_data/parser/ok/0008_mod_item.rast index 37b452ec43..ea26f1440d 100644 --- a/crates/ra_syntax/test_data/parser/ok/0008_mod_item.rast +++ b/crates/ra_syntax/test_data/parser/ok/0008_mod_item.rast @@ -26,7 +26,7 @@ SOURCE_FILE@0..118 ITEM_LIST@25..65 L_CURLY@25..26 "{" WHITESPACE@26..31 "\n " - FN_DEF@31..47 + FN@31..47 FN_KW@31..33 "fn" WHITESPACE@33..34 " " NAME@34..37 diff --git a/crates/ra_syntax/test_data/parser/ok/0011_outer_attribute.rast b/crates/ra_syntax/test_data/parser/ok/0011_outer_attribute.rast index 0b9bc58e8d..478fdba758 100644 --- a/crates/ra_syntax/test_data/parser/ok/0011_outer_attribute.rast +++ b/crates/ra_syntax/test_data/parser/ok/0011_outer_attribute.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..60 - FN_DEF@0..34 + FN@0..34 ATTR@0..12 POUND@0..1 "#" L_BRACK@1..2 "[" diff --git a/crates/ra_syntax/test_data/parser/ok/0012_visibility.rast b/crates/ra_syntax/test_data/parser/ok/0012_visibility.rast index 980b340496..83a93b5a9e 100644 --- a/crates/ra_syntax/test_data/parser/ok/0012_visibility.rast +++ b/crates/ra_syntax/test_data/parser/ok/0012_visibility.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..98 - FN_DEF@0..9 + FN@0..9 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..4 @@ -12,7 +12,7 @@ SOURCE_FILE@0..98 L_CURLY@7..8 "{" R_CURLY@8..9 "}" WHITESPACE@9..10 "\n" - FN_DEF@10..23 + FN@10..23 VISIBILITY@10..13 PUB_KW@10..13 "pub" WHITESPACE@13..14 " " @@ -28,7 +28,7 @@ SOURCE_FILE@0..98 L_CURLY@21..22 "{" R_CURLY@22..23 "}" WHITESPACE@23..24 "\n" - FN_DEF@24..44 + FN@24..44 VISIBILITY@24..34 PUB_KW@24..27 "pub" L_PAREN@27..28 "(" @@ -47,7 +47,7 @@ SOURCE_FILE@0..98 L_CURLY@42..43 "{" R_CURLY@43..44 "}" WHITESPACE@44..45 "\n" - FN_DEF@45..65 + FN@45..65 VISIBILITY@45..55 PUB_KW@45..48 "pub" L_PAREN@48..49 "(" @@ -66,7 +66,7 @@ SOURCE_FILE@0..98 L_CURLY@63..64 "{" R_CURLY@64..65 "}" WHITESPACE@65..66 "\n" - FN_DEF@66..97 + FN@66..97 VISIBILITY@66..87 PUB_KW@66..69 "pub" L_PAREN@69..70 "(" diff --git a/crates/ra_syntax/test_data/parser/ok/0017_attr_trailing_comma.rast b/crates/ra_syntax/test_data/parser/ok/0017_attr_trailing_comma.rast index 964cbf5dd3..a3e091ad36 100644 --- a/crates/ra_syntax/test_data/parser/ok/0017_attr_trailing_comma.rast +++ b/crates/ra_syntax/test_data/parser/ok/0017_attr_trailing_comma.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..23 - FN_DEF@0..22 + FN@0..22 ATTR@0..10 POUND@0..1 "#" L_BRACK@1..2 "[" diff --git a/crates/ra_syntax/test_data/parser/ok/0021_extern_fn.rast b/crates/ra_syntax/test_data/parser/ok/0021_extern_fn.rast index 873791f504..5524efaafe 100644 --- a/crates/ra_syntax/test_data/parser/ok/0021_extern_fn.rast +++ b/crates/ra_syntax/test_data/parser/ok/0021_extern_fn.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..71 - FN_DEF@0..19 + FN@0..19 ABI@0..6 EXTERN_KW@0..6 "extern" WHITESPACE@6..7 " " @@ -16,7 +16,7 @@ SOURCE_FILE@0..71 WHITESPACE@17..18 "\n" R_CURLY@18..19 "}" WHITESPACE@19..21 "\n\n" - FN_DEF@21..44 + FN@21..44 ABI@21..31 EXTERN_KW@21..27 "extern" WHITESPACE@27..28 " " @@ -35,7 +35,7 @@ SOURCE_FILE@0..71 WHITESPACE@42..43 "\n" R_CURLY@43..44 "}" WHITESPACE@44..46 "\n\n" - FN_DEF@46..70 + FN@46..70 ABI@46..57 EXTERN_KW@46..52 "extern" WHITESPACE@52..53 " " diff --git a/crates/ra_syntax/test_data/parser/ok/0025_extern_fn_in_block.rast b/crates/ra_syntax/test_data/parser/ok/0025_extern_fn_in_block.rast index 5701f566ef..bb6527b484 100644 --- a/crates/ra_syntax/test_data/parser/ok/0025_extern_fn_in_block.rast +++ b/crates/ra_syntax/test_data/parser/ok/0025_extern_fn_in_block.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..35 - FN_DEF@0..34 + FN@0..34 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 @@ -11,7 +11,7 @@ SOURCE_FILE@0..35 BLOCK_EXPR@10..34 L_CURLY@10..11 "{" WHITESPACE@11..16 "\n " - FN_DEF@16..32 + FN@16..32 ABI@16..22 EXTERN_KW@16..22 "extern" WHITESPACE@22..23 " " diff --git a/crates/ra_syntax/test_data/parser/ok/0026_const_fn_in_block.rast b/crates/ra_syntax/test_data/parser/ok/0026_const_fn_in_block.rast index b029d86921..5bcf54deb6 100644 --- a/crates/ra_syntax/test_data/parser/ok/0026_const_fn_in_block.rast +++ b/crates/ra_syntax/test_data/parser/ok/0026_const_fn_in_block.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..34 - FN_DEF@0..33 + FN@0..33 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 @@ -11,7 +11,7 @@ SOURCE_FILE@0..34 BLOCK_EXPR@10..33 L_CURLY@10..11 "{" WHITESPACE@11..16 "\n " - FN_DEF@16..31 + FN@16..31 CONST_KW@16..21 "const" WHITESPACE@21..22 " " FN_KW@22..24 "fn" diff --git a/crates/ra_syntax/test_data/parser/ok/0027_unsafe_fn_in_block.rast b/crates/ra_syntax/test_data/parser/ok/0027_unsafe_fn_in_block.rast index 299bbd1366..a7cc122951 100644 --- a/crates/ra_syntax/test_data/parser/ok/0027_unsafe_fn_in_block.rast +++ b/crates/ra_syntax/test_data/parser/ok/0027_unsafe_fn_in_block.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..53 - FN_DEF@0..52 + FN@0..52 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 @@ -11,7 +11,7 @@ SOURCE_FILE@0..53 BLOCK_EXPR@10..52 L_CURLY@10..11 "{" WHITESPACE@11..16 "\n " - FN_DEF@16..32 + FN@16..32 UNSAFE_KW@16..22 "unsafe" WHITESPACE@22..23 " " FN_KW@23..25 "fn" diff --git a/crates/ra_syntax/test_data/parser/ok/0028_operator_binding_power.rast b/crates/ra_syntax/test_data/parser/ok/0028_operator_binding_power.rast index de3c4b7869..efe0184848 100644 --- a/crates/ra_syntax/test_data/parser/ok/0028_operator_binding_power.rast +++ b/crates/ra_syntax/test_data/parser/ok/0028_operator_binding_power.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..248 - FN_DEF@0..247 + FN@0..247 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..16 diff --git a/crates/ra_syntax/test_data/parser/ok/0029_range_forms.rast b/crates/ra_syntax/test_data/parser/ok/0029_range_forms.rast index dc47d68a61..47e46f0097 100644 --- a/crates/ra_syntax/test_data/parser/ok/0029_range_forms.rast +++ b/crates/ra_syntax/test_data/parser/ok/0029_range_forms.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..153 - FN_DEF@0..152 + FN@0..152 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/ok/0030_string_suffixes.rast b/crates/ra_syntax/test_data/parser/ok/0030_string_suffixes.rast index 86c3b46c46..93f7661490 100644 --- a/crates/ra_syntax/test_data/parser/ok/0030_string_suffixes.rast +++ b/crates/ra_syntax/test_data/parser/ok/0030_string_suffixes.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..112 - FN_DEF@0..111 + FN@0..111 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/ok/0030_traits.rast b/crates/ra_syntax/test_data/parser/ok/0030_traits.rast index 63693de4f7..4bcf07ffbb 100644 --- a/crates/ra_syntax/test_data/parser/ok/0030_traits.rast +++ b/crates/ra_syntax/test_data/parser/ok/0030_traits.rast @@ -8,7 +8,7 @@ SOURCE_FILE@0..96 ASSOC_ITEM_LIST@15..36 L_CURLY@15..16 "{" WHITESPACE@16..21 "\n " - FN_DEF@21..34 + FN@21..34 FN_KW@21..23 "fn" WHITESPACE@23..24 " " NAME@24..31 @@ -29,7 +29,7 @@ SOURCE_FILE@0..96 ASSOC_ITEM_LIST@58..95 L_CURLY@58..59 "{" WHITESPACE@59..64 "\n " - FN_DEF@64..93 + FN@64..93 FN_KW@64..66 "fn" WHITESPACE@66..67 " " NAME@67..79 diff --git a/crates/ra_syntax/test_data/parser/ok/0031_extern.rast b/crates/ra_syntax/test_data/parser/ok/0031_extern.rast index ea285f52f6..0509f75042 100644 --- a/crates/ra_syntax/test_data/parser/ok/0031_extern.rast +++ b/crates/ra_syntax/test_data/parser/ok/0031_extern.rast @@ -6,7 +6,7 @@ SOURCE_FILE@0..1598 EXTERN_ITEM_LIST@7..1597 L_CURLY@7..8 "{" WHITESPACE@8..13 "\n " - FN_DEF@13..87 + FN@13..87 VISIBILITY@13..16 PUB_KW@13..16 "pub" WHITESPACE@16..17 " " @@ -69,7 +69,7 @@ SOURCE_FILE@0..1598 IDENT@81..86 "c_int" SEMICOLON@86..87 ";" WHITESPACE@87..92 "\n " - FN_DEF@92..167 + FN@92..167 VISIBILITY@92..95 PUB_KW@92..95 "pub" WHITESPACE@95..96 " " @@ -134,7 +134,7 @@ SOURCE_FILE@0..1598 IDENT@161..166 "c_int" SEMICOLON@166..167 ";" WHITESPACE@167..172 "\n " - FN_DEF@172..276 + FN@172..276 VISIBILITY@172..175 PUB_KW@172..175 "pub" WHITESPACE@175..176 " " @@ -199,7 +199,7 @@ SOURCE_FILE@0..1598 IDENT@270..275 "c_int" SEMICOLON@275..276 ";" WHITESPACE@276..281 "\n " - FN_DEF@281..341 + FN@281..341 VISIBILITY@281..284 PUB_KW@281..284 "pub" WHITESPACE@284..285 " " @@ -248,7 +248,7 @@ SOURCE_FILE@0..1598 IDENT@335..340 "c_int" SEMICOLON@340..341 ";" WHITESPACE@341..346 "\n " - FN_DEF@346..469 + FN@346..469 VISIBILITY@346..349 PUB_KW@346..349 "pub" WHITESPACE@349..350 " " @@ -317,7 +317,7 @@ SOURCE_FILE@0..1598 IDENT@463..468 "c_int" SEMICOLON@468..469 ";" WHITESPACE@469..474 "\n " - FN_DEF@474..691 + FN@474..691 VISIBILITY@474..477 PUB_KW@474..477 "pub" WHITESPACE@477..478 " " @@ -416,7 +416,7 @@ SOURCE_FILE@0..1598 IDENT@685..690 "c_int" SEMICOLON@690..691 ";" WHITESPACE@691..696 "\n " - FN_DEF@696..864 + FN@696..864 VISIBILITY@696..699 PUB_KW@696..699 "pub" WHITESPACE@699..700 " " @@ -510,7 +510,7 @@ SOURCE_FILE@0..1598 IDENT@858..863 "c_int" SEMICOLON@863..864 ";" WHITESPACE@864..869 "\n " - FN_DEF@869..992 + FN@869..992 VISIBILITY@869..872 PUB_KW@869..872 "pub" WHITESPACE@872..873 " " @@ -579,7 +579,7 @@ SOURCE_FILE@0..1598 IDENT@986..991 "c_int" SEMICOLON@991..992 ";" WHITESPACE@992..997 "\n " - FN_DEF@997..1173 + FN@997..1173 VISIBILITY@997..1000 PUB_KW@997..1000 "pub" WHITESPACE@1000..1001 " " @@ -690,7 +690,7 @@ SOURCE_FILE@0..1598 IDENT@1165..1172 "ssize_t" SEMICOLON@1172..1173 ";" WHITESPACE@1173..1178 "\n " - FN_DEF@1178..1289 + FN@1178..1289 VISIBILITY@1178..1181 PUB_KW@1178..1181 "pub" WHITESPACE@1181..1182 " " @@ -771,7 +771,7 @@ SOURCE_FILE@0..1598 IDENT@1281..1288 "ssize_t" SEMICOLON@1288..1289 ";" WHITESPACE@1289..1294 "\n " - FN_DEF@1294..1481 + FN@1294..1481 VISIBILITY@1294..1297 PUB_KW@1294..1297 "pub" WHITESPACE@1297..1298 " " @@ -888,7 +888,7 @@ SOURCE_FILE@0..1598 IDENT@1473..1480 "ssize_t" SEMICOLON@1480..1481 ";" WHITESPACE@1481..1486 "\n " - FN_DEF@1486..1595 + FN@1486..1595 VISIBILITY@1486..1489 PUB_KW@1486..1489 "pub" WHITESPACE@1489..1490 " " diff --git a/crates/ra_syntax/test_data/parser/ok/0032_where_for.rast b/crates/ra_syntax/test_data/parser/ok/0032_where_for.rast index 8d76c4e0b8..1b2325a2d5 100644 --- a/crates/ra_syntax/test_data/parser/ok/0032_where_for.rast +++ b/crates/ra_syntax/test_data/parser/ok/0032_where_for.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..116 - FN_DEF@0..115 + FN@0..115 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..21 diff --git a/crates/ra_syntax/test_data/parser/ok/0033_label_break.rast b/crates/ra_syntax/test_data/parser/ok/0033_label_break.rast index 13b730ded8..b3f29638c8 100644 --- a/crates/ra_syntax/test_data/parser/ok/0033_label_break.rast +++ b/crates/ra_syntax/test_data/parser/ok/0033_label_break.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..506 - FN_DEF@0..505 + FN@0..505 COMMENT@0..33 "// format with label ..." WHITESPACE@33..34 "\n" FN_KW@34..36 "fn" diff --git a/crates/ra_syntax/test_data/parser/ok/0034_crate_path_in_call.rast b/crates/ra_syntax/test_data/parser/ok/0034_crate_path_in_call.rast index 21874ae3a2..5ad8c570d2 100644 --- a/crates/ra_syntax/test_data/parser/ok/0034_crate_path_in_call.rast +++ b/crates/ra_syntax/test_data/parser/ok/0034_crate_path_in_call.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..62 - FN_DEF@0..61 + FN@0..61 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/ok/0035_weird_exprs.rast b/crates/ra_syntax/test_data/parser/ok/0035_weird_exprs.rast index bbdf896d10..2e36b54bcc 100644 --- a/crates/ra_syntax/test_data/parser/ok/0035_weird_exprs.rast +++ b/crates/ra_syntax/test_data/parser/ok/0035_weird_exprs.rast @@ -120,7 +120,7 @@ SOURCE_FILE@0..3813 WHITESPACE@447..449 "\n\n" COMMENT@449..518 "// Just a grab bag of ..." WHITESPACE@518..520 "\n\n" - FN_DEF@520..572 + FN@520..572 FN_KW@520..522 "fn" WHITESPACE@522..523 " " NAME@523..530 @@ -166,7 +166,7 @@ SOURCE_FILE@0..3813 WHITESPACE@570..571 " " R_CURLY@571..572 "}" WHITESPACE@572..574 "\n\n" - FN_DEF@574..624 + FN@574..624 FN_KW@574..576 "fn" WHITESPACE@576..577 " " NAME@577..582 @@ -178,7 +178,7 @@ SOURCE_FILE@0..3813 BLOCK_EXPR@585..624 L_CURLY@585..586 "{" WHITESPACE@586..591 "\n " - FN_DEF@591..607 + FN@591..607 FN_KW@591..593 "fn" WHITESPACE@593..594 " " NAME@594..595 @@ -217,7 +217,7 @@ SOURCE_FILE@0..3813 WHITESPACE@622..623 "\n" R_CURLY@623..624 "}" WHITESPACE@624..626 "\n\n" - FN_DEF@626..816 + FN@626..816 FN_KW@626..628 "fn" WHITESPACE@628..629 " " NAME@629..633 @@ -229,7 +229,7 @@ SOURCE_FILE@0..3813 BLOCK_EXPR@636..816 L_CURLY@636..637 "{" WHITESPACE@637..642 "\n " - FN_DEF@642..720 + FN@642..720 FN_KW@642..644 "fn" WHITESPACE@644..645 " " NAME@645..648 @@ -407,7 +407,7 @@ SOURCE_FILE@0..3813 WHITESPACE@814..815 "\n" R_CURLY@815..816 "}" WHITESPACE@816..818 "\n\n" - FN_DEF@818..1322 + FN@818..1322 FN_KW@818..820 "fn" WHITESPACE@820..821 " " NAME@821..832 @@ -572,7 +572,7 @@ SOURCE_FILE@0..3813 WHITESPACE@1320..1321 "\n" R_CURLY@1321..1322 "}" WHITESPACE@1322..1324 "\n\n" - FN_DEF@1324..1539 + FN@1324..1539 FN_KW@1324..1326 "fn" WHITESPACE@1326..1327 " " NAME@1327..1334 @@ -809,7 +809,7 @@ SOURCE_FILE@0..3813 WHITESPACE@1537..1538 "\n" R_CURLY@1538..1539 "}" WHITESPACE@1539..1541 "\n\n" - FN_DEF@1541..1741 + FN@1541..1741 FN_KW@1541..1543 "fn" WHITESPACE@1543..1544 " " NAME@1544..1557 @@ -830,7 +830,7 @@ SOURCE_FILE@0..3813 BLOCK_EXPR@1569..1741 L_CURLY@1569..1570 "{" WHITESPACE@1570..1575 "\n " - FN_DEF@1575..1598 + FN@1575..1598 FN_KW@1575..1577 "fn" WHITESPACE@1577..1578 " " NAME@1578..1579 @@ -988,7 +988,7 @@ SOURCE_FILE@0..3813 WHITESPACE@1739..1740 "\n" R_CURLY@1740..1741 "}" WHITESPACE@1741..1743 "\n\n" - FN_DEF@1743..1904 + FN@1743..1904 FN_KW@1743..1745 "fn" WHITESPACE@1745..1746 " " NAME@1746..1755 @@ -1131,7 +1131,7 @@ SOURCE_FILE@0..3813 WHITESPACE@1902..1903 "\n" R_CURLY@1903..1904 "}" WHITESPACE@1904..1906 "\n\n" - FN_DEF@1906..1960 + FN@1906..1960 FN_KW@1906..1908 "fn" WHITESPACE@1908..1909 " " NAME@1909..1921 @@ -1166,7 +1166,7 @@ SOURCE_FILE@0..3813 WHITESPACE@1958..1959 " " R_CURLY@1959..1960 "}" WHITESPACE@1960..1962 "\n\n" - FN_DEF@1962..2198 + FN@1962..2198 FN_KW@1962..1964 "fn" WHITESPACE@1964..1965 " " NAME@1965..1969 @@ -1284,7 +1284,7 @@ SOURCE_FILE@0..3813 WHITESPACE@2196..2197 "\n" R_CURLY@2197..2198 "}" WHITESPACE@2198..2200 "\n\n" - FN_DEF@2200..2693 + FN@2200..2693 FN_KW@2200..2202 "fn" WHITESPACE@2202..2203 " " NAME@2203..2205 @@ -1468,7 +1468,7 @@ SOURCE_FILE@0..3813 WHITESPACE@2691..2692 "\n" R_CURLY@2692..2693 "}" WHITESPACE@2693..2695 "\n\n" - FN_DEF@2695..2832 + FN@2695..2832 FN_KW@2695..2697 "fn" WHITESPACE@2697..2698 " " NAME@2698..2703 @@ -1548,7 +1548,7 @@ SOURCE_FILE@0..3813 WHITESPACE@2830..2831 "\n" R_CURLY@2831..2832 "}" WHITESPACE@2832..2834 "\n\n" - FN_DEF@2834..2906 + FN@2834..2906 FN_KW@2834..2836 "fn" WHITESPACE@2836..2837 " " NAME@2837..2842 @@ -1599,7 +1599,7 @@ SOURCE_FILE@0..3813 WHITESPACE@2904..2905 "\n" R_CURLY@2905..2906 "}" WHITESPACE@2906..2908 "\n\n" - FN_DEF@2908..3042 + FN@2908..3042 FN_KW@2908..2910 "fn" WHITESPACE@2910..2911 " " NAME@2911..2929 @@ -1722,7 +1722,7 @@ SOURCE_FILE@0..3813 WHITESPACE@3040..3041 "\n" R_CURLY@3041..3042 "}" WHITESPACE@3042..3044 "\n\n" - FN_DEF@3044..3514 + FN@3044..3514 FN_KW@3044..3046 "fn" WHITESPACE@3046..3047 " " NAME@3047..3057 @@ -2056,7 +2056,7 @@ SOURCE_FILE@0..3813 WHITESPACE@3512..3513 "\n" R_CURLY@3513..3514 "}" WHITESPACE@3514..3516 "\n\n" - FN_DEF@3516..3552 + FN@3516..3552 FN_KW@3516..3518 "fn" WHITESPACE@3518..3519 " " NAME@3519..3525 @@ -2090,7 +2090,7 @@ SOURCE_FILE@0..3813 WHITESPACE@3550..3551 "\n" R_CURLY@3551..3552 "}" WHITESPACE@3552..3554 "\n\n" - FN_DEF@3554..3812 + FN@3554..3812 VISIBILITY@3554..3557 PUB_KW@3554..3557 "pub" WHITESPACE@3557..3558 " " diff --git a/crates/ra_syntax/test_data/parser/ok/0036_fully_qualified.rast b/crates/ra_syntax/test_data/parser/ok/0036_fully_qualified.rast index a64a82e944..a5f09e3645 100644 --- a/crates/ra_syntax/test_data/parser/ok/0036_fully_qualified.rast +++ b/crates/ra_syntax/test_data/parser/ok/0036_fully_qualified.rast @@ -1,7 +1,7 @@ SOURCE_FILE@0..157 COMMENT@0..60 "// https://github.com ..." WHITESPACE@60..62 "\n\n" - FN_DEF@62..156 + FN@62..156 VISIBILITY@62..65 PUB_KW@62..65 "pub" WHITESPACE@65..66 " " diff --git a/crates/ra_syntax/test_data/parser/ok/0038_where_pred_type.rast b/crates/ra_syntax/test_data/parser/ok/0038_where_pred_type.rast index 7fd4140900..22168eaf1a 100644 --- a/crates/ra_syntax/test_data/parser/ok/0038_where_pred_type.rast +++ b/crates/ra_syntax/test_data/parser/ok/0038_where_pred_type.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..34 - FN_DEF@0..34 + FN@0..34 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/ok/0039_raw_fn_item.rast b/crates/ra_syntax/test_data/parser/ok/0039_raw_fn_item.rast index 17be2c2386..68a366354e 100644 --- a/crates/ra_syntax/test_data/parser/ok/0039_raw_fn_item.rast +++ b/crates/ra_syntax/test_data/parser/ok/0039_raw_fn_item.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..15 - FN_DEF@0..14 + FN@0..14 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..8 diff --git a/crates/ra_syntax/test_data/parser/ok/0041_raw_keywords.rast b/crates/ra_syntax/test_data/parser/ok/0041_raw_keywords.rast index acf32a8523..92ede8ccb6 100644 --- a/crates/ra_syntax/test_data/parser/ok/0041_raw_keywords.rast +++ b/crates/ra_syntax/test_data/parser/ok/0041_raw_keywords.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..59 - FN_DEF@0..59 + FN@0..59 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/ok/0042_ufcs_call_list.rast b/crates/ra_syntax/test_data/parser/ok/0042_ufcs_call_list.rast index 573edc0819..4f0c688220 100644 --- a/crates/ra_syntax/test_data/parser/ok/0042_ufcs_call_list.rast +++ b/crates/ra_syntax/test_data/parser/ok/0042_ufcs_call_list.rast @@ -20,7 +20,7 @@ SOURCE_FILE@0..199 ASSOC_ITEM_LIST@84..141 L_CURLY@84..85 "{" WHITESPACE@85..90 "\n " - FN_DEF@90..139 + FN@90..139 FN_KW@90..92 "fn" WHITESPACE@92..93 " " NAME@93..96 @@ -55,7 +55,7 @@ SOURCE_FILE@0..199 WHITESPACE@139..140 "\n" R_CURLY@140..141 "}" WHITESPACE@141..143 "\n\n" - FN_DEF@143..161 + FN@143..161 FN_KW@143..145 "fn" WHITESPACE@145..146 " " NAME@146..149 @@ -78,7 +78,7 @@ SOURCE_FILE@0..199 L_CURLY@159..160 "{" R_CURLY@160..161 "}" WHITESPACE@161..163 "\n\n" - FN_DEF@163..198 + FN@163..198 FN_KW@163..165 "fn" WHITESPACE@165..166 " " NAME@166..170 diff --git a/crates/ra_syntax/test_data/parser/ok/0043_complex_assignment.rast b/crates/ra_syntax/test_data/parser/ok/0043_complex_assignment.rast index 900eeb445a..22eb22e3c4 100644 --- a/crates/ra_syntax/test_data/parser/ok/0043_complex_assignment.rast +++ b/crates/ra_syntax/test_data/parser/ok/0043_complex_assignment.rast @@ -30,7 +30,7 @@ SOURCE_FILE@0..160 WHITESPACE@88..89 " " R_CURLY@89..90 "}" WHITESPACE@90..92 "\n\n" - FN_DEF@92..159 + FN@92..159 FN_KW@92..94 "fn" WHITESPACE@94..95 " " NAME@95..98 diff --git a/crates/ra_syntax/test_data/parser/ok/0044_let_attrs.rast b/crates/ra_syntax/test_data/parser/ok/0044_let_attrs.rast index 6d941487b1..c9e6d88eb5 100644 --- a/crates/ra_syntax/test_data/parser/ok/0044_let_attrs.rast +++ b/crates/ra_syntax/test_data/parser/ok/0044_let_attrs.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..166 - FN_DEF@0..165 + FN@0..165 COMMENT@0..60 "// https://github.com ..." WHITESPACE@60..61 "\n" FN_KW@61..63 "fn" diff --git a/crates/ra_syntax/test_data/parser/ok/0045_block_inner_attrs.rast b/crates/ra_syntax/test_data/parser/ok/0045_block_inner_attrs.rast index 69aa0ba4d3..5ebc53618c 100644 --- a/crates/ra_syntax/test_data/parser/ok/0045_block_inner_attrs.rast +++ b/crates/ra_syntax/test_data/parser/ok/0045_block_inner_attrs.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..686 - FN_DEF@0..461 + FN@0..461 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..8 @@ -101,7 +101,7 @@ SOURCE_FILE@0..686 ASSOC_ITEM_LIST@538..685 L_CURLY@538..539 "{" WHITESPACE@539..544 "\n " - FN_DEF@544..683 + FN@544..683 FN_KW@544..546 "fn" WHITESPACE@546..547 " " NAME@547..558 diff --git a/crates/ra_syntax/test_data/parser/ok/0047_minus_in_inner_pattern.rast b/crates/ra_syntax/test_data/parser/ok/0047_minus_in_inner_pattern.rast index 38e44e48a1..29a5d48e64 100644 --- a/crates/ra_syntax/test_data/parser/ok/0047_minus_in_inner_pattern.rast +++ b/crates/ra_syntax/test_data/parser/ok/0047_minus_in_inner_pattern.rast @@ -1,7 +1,7 @@ SOURCE_FILE@0..395 COMMENT@0..60 "// https://github.com ..." WHITESPACE@60..62 "\n\n" - FN_DEF@62..341 + FN@62..341 FN_KW@62..64 "fn" WHITESPACE@64..65 " " NAME@65..69 @@ -288,7 +288,7 @@ SOURCE_FILE@0..395 WHITESPACE@365..366 "\n" R_CURLY@366..367 "}" WHITESPACE@367..369 "\n\n" - FN_DEF@369..394 + FN@369..394 FN_KW@369..371 "fn" WHITESPACE@371..372 " " NAME@372..375 diff --git a/crates/ra_syntax/test_data/parser/ok/0048_compound_assignment.rast b/crates/ra_syntax/test_data/parser/ok/0048_compound_assignment.rast index 28233c5d0f..662576e5f4 100644 --- a/crates/ra_syntax/test_data/parser/ok/0048_compound_assignment.rast +++ b/crates/ra_syntax/test_data/parser/ok/0048_compound_assignment.rast @@ -1,7 +1,7 @@ SOURCE_FILE@0..257 COMMENT@0..58 "// https://github.com ..." WHITESPACE@58..60 "\n\n" - FN_DEF@60..256 + FN@60..256 FN_KW@60..62 "fn" WHITESPACE@62..63 " " NAME@63..82 diff --git a/crates/ra_syntax/test_data/parser/ok/0049_async_block.rast b/crates/ra_syntax/test_data/parser/ok/0049_async_block.rast index 0569488f86..57ecad3cfa 100644 --- a/crates/ra_syntax/test_data/parser/ok/0049_async_block.rast +++ b/crates/ra_syntax/test_data/parser/ok/0049_async_block.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..47 - FN_DEF@0..45 + FN@0..45 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/ok/0050_async_block_as_argument.rast b/crates/ra_syntax/test_data/parser/ok/0050_async_block_as_argument.rast index 7847da085e..798e81ca65 100644 --- a/crates/ra_syntax/test_data/parser/ok/0050_async_block_as_argument.rast +++ b/crates/ra_syntax/test_data/parser/ok/0050_async_block_as_argument.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..95 - FN_DEF@0..52 + FN@0..52 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 @@ -52,7 +52,7 @@ SOURCE_FILE@0..95 L_CURLY@50..51 "{" R_CURLY@51..52 "}" WHITESPACE@52..54 "\n\n" - FN_DEF@54..94 + FN@54..94 FN_KW@54..56 "fn" WHITESPACE@56..57 " " NAME@57..61 diff --git a/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.rast b/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.rast index 919c690de8..9a173b0028 100644 --- a/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.rast +++ b/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..519 - FN_DEF@0..37 + FN@0..37 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..5 @@ -41,7 +41,7 @@ SOURCE_FILE@0..519 L_CURLY@35..36 "{" R_CURLY@36..37 "}" WHITESPACE@37..38 "\n" - FN_DEF@38..62 + FN@38..62 FN_KW@38..40 "fn" WHITESPACE@40..41 " " NAME@41..43 @@ -83,7 +83,7 @@ SOURCE_FILE@0..519 EXTERN_ITEM_LIST@75..128 L_CURLY@75..76 "{" WHITESPACE@76..77 " " - FN_DEF@77..126 + FN@77..126 FN_KW@77..79 "fn" WHITESPACE@79..80 " " NAME@80..86 @@ -132,7 +132,7 @@ SOURCE_FILE@0..519 WHITESPACE@126..127 " " R_CURLY@127..128 "}" WHITESPACE@128..130 "\n\n" - FN_DEF@130..172 + FN@130..172 FN_KW@130..132 "fn" WHITESPACE@132..133 " " NAME@133..136 @@ -195,7 +195,7 @@ SOURCE_FILE@0..519 ASSOC_ITEM_LIST@184..236 L_CURLY@184..185 "{" WHITESPACE@185..190 "\n " - FN_DEF@190..234 + FN@190..234 FN_KW@190..192 "fn" WHITESPACE@192..193 " " NAME@193..196 @@ -263,7 +263,7 @@ SOURCE_FILE@0..519 ASSOC_ITEM_LIST@245..519 L_CURLY@245..246 "{" WHITESPACE@246..252 "\n " - FN_DEF@252..277 + FN@252..277 FN_KW@252..254 "fn" WHITESPACE@254..255 " " NAME@255..256 @@ -287,7 +287,7 @@ SOURCE_FILE@0..519 L_CURLY@275..276 "{" R_CURLY@276..277 "}" WHITESPACE@277..283 "\n " - FN_DEF@283..305 + FN@283..305 FN_KW@283..285 "fn" WHITESPACE@285..286 " " NAME@286..288 @@ -311,7 +311,7 @@ SOURCE_FILE@0..519 L_CURLY@303..304 "{" R_CURLY@304..305 "}" WHITESPACE@305..311 "\n " - FN_DEF@311..334 + FN@311..334 FN_KW@311..313 "fn" WHITESPACE@313..314 " " NAME@314..316 @@ -336,7 +336,7 @@ SOURCE_FILE@0..519 L_CURLY@332..333 "{" R_CURLY@333..334 "}" WHITESPACE@334..340 "\n " - FN_DEF@340..371 + FN@340..371 FN_KW@340..342 "fn" WHITESPACE@342..343 " " NAME@343..345 @@ -368,7 +368,7 @@ SOURCE_FILE@0..519 L_CURLY@369..370 "{" R_CURLY@370..371 "}" WHITESPACE@371..377 "\n " - FN_DEF@377..407 + FN@377..407 FN_KW@377..379 "fn" WHITESPACE@379..380 " " NAME@380..382 @@ -400,7 +400,7 @@ SOURCE_FILE@0..519 L_CURLY@405..406 "{" R_CURLY@406..407 "}" WHITESPACE@407..413 "\n " - FN_DEF@413..447 + FN@413..447 FN_KW@413..415 "fn" WHITESPACE@415..416 " " NAME@416..418 @@ -434,7 +434,7 @@ SOURCE_FILE@0..519 L_CURLY@445..446 "{" R_CURLY@446..447 "}" WHITESPACE@447..453 "\n " - FN_DEF@453..480 + FN@453..480 FN_KW@453..455 "fn" WHITESPACE@455..456 " " NAME@456..457 @@ -465,7 +465,7 @@ SOURCE_FILE@0..519 L_CURLY@478..479 "{" R_CURLY@479..480 "}" WHITESPACE@480..486 "\n " - FN_DEF@486..517 + FN@486..517 FN_KW@486..488 "fn" WHITESPACE@488..489 " " NAME@489..490 diff --git a/crates/ra_syntax/test_data/parser/ok/0052_for_range_block.rast b/crates/ra_syntax/test_data/parser/ok/0052_for_range_block.rast index 65cfa7bc56..a300003986 100644 --- a/crates/ra_syntax/test_data/parser/ok/0052_for_range_block.rast +++ b/crates/ra_syntax/test_data/parser/ok/0052_for_range_block.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..80 - FN_DEF@0..79 + FN@0..79 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/ok/0054_qual_path_in_type_arg.rast b/crates/ra_syntax/test_data/parser/ok/0054_qual_path_in_type_arg.rast index d6aec7ab9a..e3997ac5b8 100644 --- a/crates/ra_syntax/test_data/parser/ok/0054_qual_path_in_type_arg.rast +++ b/crates/ra_syntax/test_data/parser/ok/0054_qual_path_in_type_arg.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..88 - FN_DEF@0..26 + FN@0..26 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..4 @@ -35,7 +35,7 @@ SOURCE_FILE@0..88 L_CURLY@24..25 "{" R_CURLY@25..26 "}" WHITESPACE@26..28 "\n\n" - FN_DEF@28..56 + FN@28..56 FN_KW@28..30 "fn" WHITESPACE@30..31 " " NAME@31..32 @@ -77,7 +77,7 @@ SOURCE_FILE@0..88 L_CURLY@54..55 "{" R_CURLY@55..56 "}" WHITESPACE@56..58 "\n\n" - FN_DEF@58..87 + FN@58..87 FN_KW@58..60 "fn" WHITESPACE@60..61 " " NAME@61..62 diff --git a/crates/ra_syntax/test_data/parser/ok/0055_dot_dot_dot.rast b/crates/ra_syntax/test_data/parser/ok/0055_dot_dot_dot.rast index 9e0cec35fb..1c893180c0 100644 --- a/crates/ra_syntax/test_data/parser/ok/0055_dot_dot_dot.rast +++ b/crates/ra_syntax/test_data/parser/ok/0055_dot_dot_dot.rast @@ -12,7 +12,7 @@ SOURCE_FILE@0..49 R_PAREN@10..11 ")" SEMICOLON@11..12 ";" WHITESPACE@12..14 "\n\n" - FN_DEF@14..48 + FN@14..48 FN_KW@14..16 "fn" WHITESPACE@16..17 " " NAME@17..21 diff --git a/crates/ra_syntax/test_data/parser/ok/0056_neq_in_type.rast b/crates/ra_syntax/test_data/parser/ok/0056_neq_in_type.rast index 7fa3033acb..3ef916e556 100644 --- a/crates/ra_syntax/test_data/parser/ok/0056_neq_in_type.rast +++ b/crates/ra_syntax/test_data/parser/ok/0056_neq_in_type.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..71 - FN_DEF@0..70 + FN@0..70 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/ok/0057_loop_in_call.rast b/crates/ra_syntax/test_data/parser/ok/0057_loop_in_call.rast index d939680168..53410a1eee 100644 --- a/crates/ra_syntax/test_data/parser/ok/0057_loop_in_call.rast +++ b/crates/ra_syntax/test_data/parser/ok/0057_loop_in_call.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..50 - FN_DEF@0..17 + FN@0..17 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 @@ -23,7 +23,7 @@ SOURCE_FILE@0..50 L_CURLY@15..16 "{" R_CURLY@16..17 "}" WHITESPACE@17..19 "\n\n" - FN_DEF@19..50 + FN@19..50 FN_KW@19..21 "fn" WHITESPACE@21..22 " " NAME@22..26 diff --git a/crates/ra_syntax/test_data/parser/ok/0058_unary_expr_precedence.rast b/crates/ra_syntax/test_data/parser/ok/0058_unary_expr_precedence.rast index b5c72ee369..a1dfd58f26 100644 --- a/crates/ra_syntax/test_data/parser/ok/0058_unary_expr_precedence.rast +++ b/crates/ra_syntax/test_data/parser/ok/0058_unary_expr_precedence.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..79 - FN_DEF@0..78 + FN@0..78 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..6 diff --git a/crates/ra_syntax/test_data/parser/ok/0059_loops_in_parens.rast b/crates/ra_syntax/test_data/parser/ok/0059_loops_in_parens.rast index ddcb139c11..767b516a25 100644 --- a/crates/ra_syntax/test_data/parser/ok/0059_loops_in_parens.rast +++ b/crates/ra_syntax/test_data/parser/ok/0059_loops_in_parens.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..105 - FN_DEF@0..104 + FN@0..104 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/ok/0060_as_range.rast b/crates/ra_syntax/test_data/parser/ok/0060_as_range.rast index 098152fc31..1fd1a28884 100644 --- a/crates/ra_syntax/test_data/parser/ok/0060_as_range.rast +++ b/crates/ra_syntax/test_data/parser/ok/0060_as_range.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..56 - FN_DEF@0..55 + FN@0..55 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/ok/0061_match_full_range.rast b/crates/ra_syntax/test_data/parser/ok/0061_match_full_range.rast index c6e9829769..ba49c115b5 100644 --- a/crates/ra_syntax/test_data/parser/ok/0061_match_full_range.rast +++ b/crates/ra_syntax/test_data/parser/ok/0061_match_full_range.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..35 - FN_DEF@0..34 + FN@0..34 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..7 diff --git a/crates/ra_syntax/test_data/parser/ok/0062_macro_2.0.rast b/crates/ra_syntax/test_data/parser/ok/0062_macro_2.0.rast index bf791ee2be..0c22c31a4f 100644 --- a/crates/ra_syntax/test_data/parser/ok/0062_macro_2.0.rast +++ b/crates/ra_syntax/test_data/parser/ok/0062_macro_2.0.rast @@ -51,7 +51,7 @@ SOURCE_FILE@0..349 WHITESPACE@91..92 "\n" R_CURLY@92..93 "}" WHITESPACE@93..95 "\n\n" - FN_DEF@95..348 + FN@95..348 ATTR@95..102 POUND@95..96 "#" L_BRACK@96..97 "[" diff --git a/crates/ra_syntax/test_data/parser/ok/0063_trait_fn_patterns.rast b/crates/ra_syntax/test_data/parser/ok/0063_trait_fn_patterns.rast index 40619b46e2..a87bbf4eb9 100644 --- a/crates/ra_syntax/test_data/parser/ok/0063_trait_fn_patterns.rast +++ b/crates/ra_syntax/test_data/parser/ok/0063_trait_fn_patterns.rast @@ -8,7 +8,7 @@ SOURCE_FILE@0..170 ASSOC_ITEM_LIST@8..169 L_CURLY@8..9 "{" WHITESPACE@9..14 "\n " - FN_DEF@14..46 + FN@14..46 FN_KW@14..16 "fn" WHITESPACE@16..17 " " NAME@17..19 @@ -50,7 +50,7 @@ SOURCE_FILE@0..170 L_CURLY@44..45 "{" R_CURLY@45..46 "}" WHITESPACE@46..51 "\n " - FN_DEF@51..74 + FN@51..74 FN_KW@51..53 "fn" WHITESPACE@53..54 " " NAME@54..56 @@ -92,7 +92,7 @@ SOURCE_FILE@0..170 L_CURLY@72..73 "{" R_CURLY@73..74 "}" WHITESPACE@74..79 "\n " - FN_DEF@79..108 + FN@79..108 FN_KW@79..81 "fn" WHITESPACE@81..82 " " NAME@82..84 @@ -123,7 +123,7 @@ SOURCE_FILE@0..170 L_CURLY@106..107 "{" R_CURLY@107..108 "}" WHITESPACE@108..113 "\n " - FN_DEF@113..135 + FN@113..135 FN_KW@113..115 "fn" WHITESPACE@115..116 " " NAME@116..118 @@ -155,7 +155,7 @@ SOURCE_FILE@0..170 L_CURLY@133..134 "{" R_CURLY@134..135 "}" WHITESPACE@135..140 "\n " - FN_DEF@140..167 + FN@140..167 FN_KW@140..142 "fn" WHITESPACE@142..143 " " NAME@143..146 diff --git a/crates/ra_syntax/test_data/parser/ok/0063_variadic_fun.rast b/crates/ra_syntax/test_data/parser/ok/0063_variadic_fun.rast index 5a9f07c895..7adedb02e3 100644 --- a/crates/ra_syntax/test_data/parser/ok/0063_variadic_fun.rast +++ b/crates/ra_syntax/test_data/parser/ok/0063_variadic_fun.rast @@ -8,7 +8,7 @@ SOURCE_FILE@0..126 EXTERN_ITEM_LIST@11..125 L_CURLY@11..12 "{" WHITESPACE@12..17 "\n " - FN_DEF@17..40 + FN@17..40 FN_KW@17..19 "fn" WHITESPACE@19..20 " " NAME@20..21 @@ -37,7 +37,7 @@ SOURCE_FILE@0..126 R_PAREN@38..39 ")" SEMICOLON@39..40 ";" WHITESPACE@40..45 "\n " - FN_DEF@45..70 + FN@45..70 FN_KW@45..47 "fn" WHITESPACE@47..48 " " NAME@48..49 @@ -69,7 +69,7 @@ SOURCE_FILE@0..126 R_PAREN@68..69 ")" SEMICOLON@69..70 ";" WHITESPACE@70..75 "\n " - FN_DEF@75..123 + FN@75..123 FN_KW@75..77 "fn" WHITESPACE@77..78 " " NAME@78..79 diff --git a/crates/ra_syntax/test_data/parser/ok/0064_impl_fn_params.rast b/crates/ra_syntax/test_data/parser/ok/0064_impl_fn_params.rast index 7b026e33b0..ef0eca47cc 100644 --- a/crates/ra_syntax/test_data/parser/ok/0064_impl_fn_params.rast +++ b/crates/ra_syntax/test_data/parser/ok/0064_impl_fn_params.rast @@ -11,7 +11,7 @@ SOURCE_FILE@0..137 ASSOC_ITEM_LIST@7..136 L_CURLY@7..8 "{" WHITESPACE@8..13 "\n " - FN_DEF@13..45 + FN@13..45 FN_KW@13..15 "fn" WHITESPACE@15..16 " " NAME@16..18 @@ -53,7 +53,7 @@ SOURCE_FILE@0..137 L_CURLY@43..44 "{" R_CURLY@44..45 "}" WHITESPACE@45..50 "\n " - FN_DEF@50..73 + FN@50..73 FN_KW@50..52 "fn" WHITESPACE@52..53 " " NAME@53..55 @@ -95,7 +95,7 @@ SOURCE_FILE@0..137 L_CURLY@71..72 "{" R_CURLY@72..73 "}" WHITESPACE@73..78 "\n " - FN_DEF@78..107 + FN@78..107 FN_KW@78..80 "fn" WHITESPACE@80..81 " " NAME@81..83 @@ -126,7 +126,7 @@ SOURCE_FILE@0..137 L_CURLY@105..106 "{" R_CURLY@106..107 "}" WHITESPACE@107..112 "\n " - FN_DEF@112..134 + FN@112..134 FN_KW@112..114 "fn" WHITESPACE@114..115 " " NAME@115..117 diff --git a/crates/ra_syntax/test_data/parser/ok/0065_comment_newline.rast b/crates/ra_syntax/test_data/parser/ok/0065_comment_newline.rast index d1fffdd637..29bd38c051 100644 --- a/crates/ra_syntax/test_data/parser/ok/0065_comment_newline.rast +++ b/crates/ra_syntax/test_data/parser/ok/0065_comment_newline.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..26 - FN_DEF@0..25 + FN@0..25 COMMENT@0..11 "/// Example" WHITESPACE@11..13 "\n\n" FN_KW@13..15 "fn" diff --git a/crates/ra_syntax/test_data/parser/ok/0065_plus_after_fn_trait_bound.rast b/crates/ra_syntax/test_data/parser/ok/0065_plus_after_fn_trait_bound.rast index eb2f8eb3cf..7996dc121a 100644 --- a/crates/ra_syntax/test_data/parser/ok/0065_plus_after_fn_trait_bound.rast +++ b/crates/ra_syntax/test_data/parser/ok/0065_plus_after_fn_trait_bound.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..40 - FN_DEF@0..39 + FN@0..39 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..4 diff --git a/crates/ra_syntax/test_data/parser/ok/0067_where_for_pred.rast b/crates/ra_syntax/test_data/parser/ok/0067_where_for_pred.rast index 5035851031..e4c2578f6e 100644 --- a/crates/ra_syntax/test_data/parser/ok/0067_where_for_pred.rast +++ b/crates/ra_syntax/test_data/parser/ok/0067_where_for_pred.rast @@ -1,5 +1,5 @@ SOURCE_FILE@0..374 - FN_DEF@0..55 + FN@0..55 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..12 @@ -59,7 +59,7 @@ SOURCE_FILE@0..374 WHITESPACE@53..54 "\n" R_CURLY@54..55 "}" WHITESPACE@55..56 "\n" - FN_DEF@56..107 + FN@56..107 FN_KW@56..58 "fn" WHITESPACE@58..59 " " NAME@59..66 @@ -110,7 +110,7 @@ SOURCE_FILE@0..374 WHITESPACE@105..106 "\n" R_CURLY@106..107 "}" WHITESPACE@107..108 "\n" - FN_DEF@108..170 + FN@108..170 FN_KW@108..110 "fn" WHITESPACE@110..111 " " NAME@111..121 @@ -177,7 +177,7 @@ SOURCE_FILE@0..374 WHITESPACE@168..169 "\n" R_CURLY@169..170 "}" WHITESPACE@170..171 "\n" - FN_DEF@171..223 + FN@171..223 FN_KW@171..173 "fn" WHITESPACE@173..174 " " NAME@174..183 @@ -231,7 +231,7 @@ SOURCE_FILE@0..374 WHITESPACE@221..222 "\n" R_CURLY@222..223 "}" WHITESPACE@223..224 "\n" - FN_DEF@224..300 + FN@224..300 FN_KW@224..226 "fn" WHITESPACE@226..227 " " NAME@227..236 @@ -313,7 +313,7 @@ SOURCE_FILE@0..374 WHITESPACE@298..299 "\n" R_CURLY@299..300 "}" WHITESPACE@300..301 "\n" - FN_DEF@301..373 + FN@301..373 FN_KW@301..303 "fn" WHITESPACE@303..304 " " NAME@304..314 diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs index 87a1367ac2..3a0780eb5f 100644 --- a/crates/rust-analyzer/src/handlers.rs +++ b/crates/rust-analyzer/src/handlers.rs @@ -1095,7 +1095,7 @@ pub(crate) fn handle_call_hierarchy_prepare( let RangeInfo { range: _, info: navs } = nav_info; let res = navs .into_iter() - .filter(|it| it.kind == SyntaxKind::FN_DEF) + .filter(|it| it.kind == SyntaxKind::FN) .map(|it| to_proto::call_hierarchy_item(&snap, it)) .collect::>>()?; diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs index c6935c029b..f86e55d399 100644 --- a/crates/rust-analyzer/src/to_proto.rs +++ b/crates/rust-analyzer/src/to_proto.rs @@ -31,7 +31,7 @@ pub(crate) fn range(line_index: &LineIndex, range: TextRange) -> lsp_types::Rang pub(crate) fn symbol_kind(syntax_kind: SyntaxKind) -> lsp_types::SymbolKind { match syntax_kind { - SyntaxKind::FN_DEF => lsp_types::SymbolKind::Function, + SyntaxKind::FN => lsp_types::SymbolKind::Function, SyntaxKind::STRUCT_DEF => lsp_types::SymbolKind::Struct, SyntaxKind::ENUM_DEF => lsp_types::SymbolKind::Enum, SyntaxKind::ENUM_VARIANT => lsp_types::SymbolKind::EnumMember, diff --git a/docs/dev/syntax.md b/docs/dev/syntax.md index c2864bbbc6..d4bc4b07c4 100644 --- a/docs/dev/syntax.md +++ b/docs/dev/syntax.md @@ -82,7 +82,7 @@ Points of note: An input like `fn f() { 90 + 2 }` might be parsed as ``` -FN_DEF@0..17 +FN@0..17 FN_KW@0..2 "fn" WHITESPACE@2..3 " " NAME@3..4 @@ -342,7 +342,7 @@ pub struct FnDef { impl AstNode for FnDef { fn cast(syntax: SyntaxNode) -> Option { match kind { - FN_DEF => Some(FnDef { syntax }), + FN => Some(FnDef { syntax }), _ => None, } } diff --git a/xtask/src/ast_src.rs b/xtask/src/ast_src.rs index 3a58217c47..40693ed17c 100644 --- a/xtask/src/ast_src.rs +++ b/xtask/src/ast_src.rs @@ -96,7 +96,7 @@ pub(crate) const KINDS_SRC: KindsSrc = KindsSrc { "STRUCT_DEF", "UNION_DEF", "ENUM_DEF", - "FN_DEF", + "FN", "RET_TYPE", "EXTERN_CRATE", "MODULE", diff --git a/xtask/src/codegen/gen_syntax.rs b/xtask/src/codegen/gen_syntax.rs index c77fc8a8d0..072527208c 100644 --- a/xtask/src/codegen/gen_syntax.rs +++ b/xtask/src/codegen/gen_syntax.rs @@ -471,6 +471,7 @@ impl Field { "::" => "coloncolon", "#" => "pound", "?" => "question_mark", + "," => "comma", _ => name, }; format_ident!("{}_token", name) @@ -599,13 +600,9 @@ fn lower_rule(acc: &mut Vec, grammar: &Grammar, rule: &Rule) { } } -// (T (',' T)* ','?)? +// (T (',' T)* ','?) fn lower_comma_list(acc: &mut Vec, grammar: &Grammar, rule: &Rule) -> bool { let rule = match rule { - Rule::Opt(it) => it, - _ => return false, - }; - let rule = match &**rule { Rule::Seq(it) => it, _ => return false, }; diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram index 449b0242fb..98968dece9 100644 --- a/xtask/src/codegen/rust.ungram +++ b/xtask/src/codegen/rust.ungram @@ -8,7 +8,7 @@ Item = | EnumDef | ExternBlock | ExternCrate -| FnDef +| Fn | ImplDef | MacroCall | Module @@ -42,12 +42,33 @@ UseTree = UseTreeList = '{' (UseTree (',' UseTree)* ','?)? '}' -FnDef = - Attr* Visibility? Abi? 'const' 'default' 'async' 'unsafe' 'fn' Name TypeParamList? - ParamList RetType? +Fn = + Attr* Visibility? + 'default'? ('async' | 'const')? 'unsafe'? Abi? + 'fn' Name TypeParamList? ParamList RetType? WhereClause? (body:BlockExpr | ';') +Abi = + 'extern' 'string'? + +ParamList = + '('( + (Param (',' Param)* ','?)? + | SelfParam ','? + | SelfParam ',' (Param (',' Param)* ','?) + )')' + +SelfParam = + Attr* ( + ('&' 'lifetime'?)? 'mut'? 'self' + | 'mut'? 'self' ':' ascribed_type:TypeRef + ) + +Param = + Attr* Pat (':' ascribed_type:TypeRef) +| '...' + RetType = '->' TypeRef @@ -388,9 +409,6 @@ WherePred = WhereClause = 'where' predicates:WherePred* -Abi = - 'string' - ExprStmt = Attr* Expr ';' @@ -398,16 +416,6 @@ LetStmt = Attr* 'let' Pat (':' ascribed_type:TypeRef) '=' initializer:Expr ';' -ParamList = - '(' SelfParam Param* ')' - -SelfParam = - Attr* ('&' 'lifetime'?)? 'mut'? 'self' (':' ascribed_type:TypeRef) - -Param = - Attr* Pat (':' ascribed_type:TypeRef) -| '...' - Path = (qualifier:Path '::')? segment:PathSegment @@ -465,13 +473,13 @@ TypeRef = | DynTraitType AssocItem = - FnDef + Fn | TypeAliasDef | ConstDef | MacroCall ExternItem = - FnDef | StaticDef + Fn | StaticDef AttrInput = Literal