diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-07-30 14:26:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-30 14:26:15 +0100 |
commit | ee00679331b87dacc5fe608f153be160c1cb144c (patch) | |
tree | f80ef7823490a6904b3f7bf57a4609ca4c4743dc /crates | |
parent | 96c3ff1c573f97e5089fc0ba01ede6fe43693668 (diff) | |
parent | eb2f8063444b11257111f4f8ade990ec810e0361 (diff) |
Merge #5591
5591: Rename TypeAliasDef -> TypeAlias r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Diffstat (limited to 'crates')
268 files changed, 783 insertions, 789 deletions
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 a2d9006e4..1e4d4748c 100644 --- a/crates/ra_assists/src/handlers/add_missing_impl_members.rs +++ b/crates/ra_assists/src/handlers/add_missing_impl_members.rs | |||
@@ -118,8 +118,8 @@ fn add_missing_impl_members_inner( | |||
118 | 118 | ||
119 | let def_name = |item: &ast::AssocItem| -> Option<SmolStr> { | 119 | let def_name = |item: &ast::AssocItem| -> Option<SmolStr> { |
120 | match item { | 120 | match item { |
121 | ast::AssocItem::FnDef(def) => def.name(), | 121 | ast::AssocItem::Fn(def) => def.name(), |
122 | ast::AssocItem::TypeAliasDef(def) => def.name(), | 122 | ast::AssocItem::TypeAlias(def) => def.name(), |
123 | ast::AssocItem::ConstDef(def) => def.name(), | 123 | ast::AssocItem::ConstDef(def) => def.name(), |
124 | ast::AssocItem::MacroCall(_) => None, | 124 | ast::AssocItem::MacroCall(_) => None, |
125 | } | 125 | } |
@@ -129,13 +129,13 @@ fn add_missing_impl_members_inner( | |||
129 | let missing_items = get_missing_assoc_items(&ctx.sema, &impl_def) | 129 | let missing_items = get_missing_assoc_items(&ctx.sema, &impl_def) |
130 | .iter() | 130 | .iter() |
131 | .map(|i| match i { | 131 | .map(|i| match i { |
132 | hir::AssocItem::Function(i) => ast::AssocItem::FnDef(i.source(ctx.db()).value), | 132 | hir::AssocItem::Function(i) => ast::AssocItem::Fn(i.source(ctx.db()).value), |
133 | hir::AssocItem::TypeAlias(i) => ast::AssocItem::TypeAliasDef(i.source(ctx.db()).value), | 133 | hir::AssocItem::TypeAlias(i) => ast::AssocItem::TypeAlias(i.source(ctx.db()).value), |
134 | hir::AssocItem::Const(i) => ast::AssocItem::ConstDef(i.source(ctx.db()).value), | 134 | hir::AssocItem::Const(i) => ast::AssocItem::ConstDef(i.source(ctx.db()).value), |
135 | }) | 135 | }) |
136 | .filter(|t| def_name(&t).is_some()) | 136 | .filter(|t| def_name(&t).is_some()) |
137 | .filter(|t| match t { | 137 | .filter(|t| match t { |
138 | ast::AssocItem::FnDef(def) => match mode { | 138 | ast::AssocItem::Fn(def) => match mode { |
139 | AddMissingImplMembersMode::DefaultMethodsOnly => def.body().is_some(), | 139 | AddMissingImplMembersMode::DefaultMethodsOnly => def.body().is_some(), |
140 | AddMissingImplMembersMode::NoDefaultMethods => def.body().is_none(), | 140 | AddMissingImplMembersMode::NoDefaultMethods => def.body().is_none(), |
141 | }, | 141 | }, |
@@ -158,10 +158,8 @@ fn add_missing_impl_members_inner( | |||
158 | .into_iter() | 158 | .into_iter() |
159 | .map(|it| ast_transform::apply(&*ast_transform, it)) | 159 | .map(|it| ast_transform::apply(&*ast_transform, it)) |
160 | .map(|it| match it { | 160 | .map(|it| match it { |
161 | ast::AssocItem::FnDef(def) => ast::AssocItem::FnDef(add_body(def)), | 161 | ast::AssocItem::Fn(def) => ast::AssocItem::Fn(add_body(def)), |
162 | ast::AssocItem::TypeAliasDef(def) => { | 162 | ast::AssocItem::TypeAlias(def) => ast::AssocItem::TypeAlias(def.remove_bounds()), |
163 | ast::AssocItem::TypeAliasDef(def.remove_bounds()) | ||
164 | } | ||
165 | _ => it, | 163 | _ => it, |
166 | }) | 164 | }) |
167 | .map(|it| edit::remove_attrs_and_docs(&it)); | 165 | .map(|it| edit::remove_attrs_and_docs(&it)); |
@@ -174,7 +172,7 @@ fn add_missing_impl_members_inner( | |||
174 | Some(cap) => { | 172 | Some(cap) => { |
175 | let mut cursor = Cursor::Before(first_new_item.syntax()); | 173 | let mut cursor = Cursor::Before(first_new_item.syntax()); |
176 | let placeholder; | 174 | let placeholder; |
177 | if let ast::AssocItem::FnDef(func) = &first_new_item { | 175 | if let ast::AssocItem::Fn(func) = &first_new_item { |
178 | if let Some(m) = func.syntax().descendants().find_map(ast::MacroCall::cast) { | 176 | if let Some(m) = func.syntax().descendants().find_map(ast::MacroCall::cast) { |
179 | if m.syntax().text() == "todo!()" { | 177 | if m.syntax().text() == "todo!()" { |
180 | placeholder = m; | 178 | placeholder = m; |
@@ -192,7 +190,7 @@ fn add_missing_impl_members_inner( | |||
192 | }) | 190 | }) |
193 | } | 191 | } |
194 | 192 | ||
195 | fn add_body(fn_def: ast::FnDef) -> ast::FnDef { | 193 | fn add_body(fn_def: ast::Fn) -> ast::Fn { |
196 | if fn_def.body().is_some() { | 194 | if fn_def.body().is_some() { |
197 | return fn_def; | 195 | return fn_def; |
198 | } | 196 | } |
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 def00f7d8..52e24af6c 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; | |||
20 | pub(crate) fn change_return_type_to_result(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { | 20 | pub(crate) fn change_return_type_to_result(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { |
21 | let ret_type = ctx.find_node_at_offset::<ast::RetType>()?; | 21 | let ret_type = ctx.find_node_at_offset::<ast::RetType>()?; |
22 | // FIXME: extend to lambdas as well | 22 | // FIXME: extend to lambdas as well |
23 | let fn_def = ret_type.syntax().parent().and_then(ast::FnDef::cast)?; | 23 | let fn_def = ret_type.syntax().parent().and_then(ast::Fn::cast)?; |
24 | 24 | ||
25 | let type_ref = &ret_type.type_ref()?; | 25 | let type_ref = &ret_type.type_ref()?; |
26 | let ret_type_str = type_ref.syntax().text().to_string(); | 26 | 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 4343b423c..c3e1f2803 100644 --- a/crates/ra_assists/src/handlers/change_visibility.rs +++ b/crates/ra_assists/src/handlers/change_visibility.rs | |||
@@ -1,9 +1,7 @@ | |||
1 | use ra_syntax::{ | 1 | use ra_syntax::{ |
2 | ast::{self, NameOwner, VisibilityOwner}, | 2 | ast::{self, NameOwner, VisibilityOwner}, |
3 | AstNode, | 3 | AstNode, |
4 | SyntaxKind::{ | 4 | SyntaxKind::{CONST_DEF, ENUM_DEF, FN, MODULE, STATIC_DEF, STRUCT_DEF, TRAIT_DEF, VISIBILITY}, |
5 | CONST_DEF, ENUM_DEF, FN_DEF, MODULE, STATIC_DEF, STRUCT_DEF, TRAIT_DEF, VISIBILITY, | ||
6 | }, | ||
7 | T, | 5 | T, |
8 | }; | 6 | }; |
9 | use test_utils::mark; | 7 | use test_utils::mark; |
@@ -38,7 +36,7 @@ fn add_vis(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { | |||
38 | 36 | ||
39 | let (offset, target) = if let Some(keyword) = item_keyword { | 37 | let (offset, target) = if let Some(keyword) = item_keyword { |
40 | let parent = keyword.parent(); | 38 | let parent = keyword.parent(); |
41 | let def_kws = vec![CONST_DEF, STATIC_DEF, FN_DEF, MODULE, STRUCT_DEF, ENUM_DEF, TRAIT_DEF]; | 39 | let def_kws = vec![CONST_DEF, STATIC_DEF, FN, MODULE, STRUCT_DEF, ENUM_DEF, TRAIT_DEF]; |
42 | // Parent is not a definition, can't add visibility | 40 | // Parent is not a definition, can't add visibility |
43 | if !def_kws.iter().any(|&def_kw| def_kw == parent.kind()) { | 41 | if !def_kws.iter().any(|&def_kw| def_kw == parent.kind()) { |
44 | return None; | 42 | return None; |
diff --git a/crates/ra_assists/src/handlers/early_return.rs b/crates/ra_assists/src/handlers/early_return.rs index 330459f3c..3650289fd 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::{ | |||
8 | make, | 8 | make, |
9 | }, | 9 | }, |
10 | AstNode, | 10 | AstNode, |
11 | SyntaxKind::{FN_DEF, LOOP_EXPR, L_CURLY, R_CURLY, WHILE_EXPR, WHITESPACE}, | 11 | SyntaxKind::{FN, LOOP_EXPR, L_CURLY, R_CURLY, WHILE_EXPR, WHITESPACE}, |
12 | SyntaxNode, | 12 | SyntaxNode, |
13 | }; | 13 | }; |
14 | 14 | ||
@@ -88,7 +88,7 @@ pub(crate) fn convert_to_guarded_return(acc: &mut Assists, ctx: &AssistContext) | |||
88 | 88 | ||
89 | let early_expression: ast::Expr = match parent_container.kind() { | 89 | let early_expression: ast::Expr = match parent_container.kind() { |
90 | WHILE_EXPR | LOOP_EXPR => make::expr_continue(), | 90 | WHILE_EXPR | LOOP_EXPR => make::expr_continue(), |
91 | FN_DEF => make::expr_return(), | 91 | FN => make::expr_return(), |
92 | _ => return None, | 92 | _ => return None, |
93 | }; | 93 | }; |
94 | 94 | ||
diff --git a/crates/ra_assists/src/handlers/generate_function.rs b/crates/ra_assists/src/handlers/generate_function.rs index b721b96bb..006d0ffb2 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 { | |||
82 | insert_offset: TextSize, | 82 | insert_offset: TextSize, |
83 | placeholder_expr: ast::MacroCall, | 83 | placeholder_expr: ast::MacroCall, |
84 | leading_ws: String, | 84 | leading_ws: String, |
85 | fn_def: ast::FnDef, | 85 | fn_def: ast::Fn, |
86 | trailing_ws: String, | 86 | trailing_ws: String, |
87 | file: FileId, | 87 | file: FileId, |
88 | } | 88 | } |
diff --git a/crates/ra_assists/src/handlers/generate_new.rs b/crates/ra_assists/src/handlers/generate_new.rs index 25bc171bf..4dff0ae4d 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<Opti | |||
160 | fn has_new_fn(imp: &ast::ImplDef) -> bool { | 160 | fn has_new_fn(imp: &ast::ImplDef) -> bool { |
161 | if let Some(il) = imp.assoc_item_list() { | 161 | if let Some(il) = imp.assoc_item_list() { |
162 | for item in il.assoc_items() { | 162 | for item in il.assoc_items() { |
163 | if let ast::AssocItem::FnDef(f) = item { | 163 | if let ast::AssocItem::Fn(f) = item { |
164 | if let Some(name) = f.name() { | 164 | if let Some(name) = f.name() { |
165 | if name.text().eq_ignore_ascii_case("new") { | 165 | if name.text().eq_ignore_ascii_case("new") { |
166 | return true; | 166 | 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 967593031..f3774fab1 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) - | |||
38 | let lifetime_token = ctx | 38 | let lifetime_token = ctx |
39 | .find_token_at_offset(SyntaxKind::LIFETIME) | 39 | .find_token_at_offset(SyntaxKind::LIFETIME) |
40 | .filter(|lifetime| lifetime.text() == "'_")?; | 40 | .filter(|lifetime| lifetime.text() == "'_")?; |
41 | if let Some(fn_def) = lifetime_token.ancestors().find_map(ast::FnDef::cast) { | 41 | if let Some(fn_def) = lifetime_token.ancestors().find_map(ast::Fn::cast) { |
42 | generate_fn_def_assist(acc, &fn_def, lifetime_token.text_range()) | 42 | generate_fn_def_assist(acc, &fn_def, lifetime_token.text_range()) |
43 | } else if let Some(impl_def) = lifetime_token.ancestors().find_map(ast::ImplDef::cast) { | 43 | } else if let Some(impl_def) = lifetime_token.ancestors().find_map(ast::ImplDef::cast) { |
44 | generate_impl_def_assist(acc, &impl_def, lifetime_token.text_range()) | 44 | 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) - | |||
50 | /// Generate the assist for the fn def case | 50 | /// Generate the assist for the fn def case |
51 | fn generate_fn_def_assist( | 51 | fn generate_fn_def_assist( |
52 | acc: &mut Assists, | 52 | acc: &mut Assists, |
53 | fn_def: &ast::FnDef, | 53 | fn_def: &ast::Fn, |
54 | lifetime_loc: TextRange, | 54 | lifetime_loc: TextRange, |
55 | ) -> Option<()> { | 55 | ) -> Option<()> { |
56 | let param_list: ast::ParamList = fn_def.param_list()?; | 56 | 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 6b73fff44..dae6198ed 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 | |||
37 | 37 | ||
38 | let anchor = match_ast! { | 38 | let anchor = match_ast! { |
39 | match parent { | 39 | match parent { |
40 | ast::FnDef(it) => it.body()?.syntax().clone().into(), | 40 | ast::Fn(it) => it.body()?.syntax().clone().into(), |
41 | ast::TraitDef(it) => it.assoc_item_list()?.syntax().clone().into(), | 41 | ast::TraitDef(it) => it.assoc_item_list()?.syntax().clone().into(), |
42 | ast::ImplDef(it) => it.assoc_item_list()?.syntax().clone().into(), | 42 | ast::ImplDef(it) => it.assoc_item_list()?.syntax().clone().into(), |
43 | ast::EnumDef(it) => it.variant_list()?.syntax().clone().into(), | 43 | 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 27c33df23..748be011b 100644 --- a/crates/ra_assists/src/utils.rs +++ b/crates/ra_assists/src/utils.rs | |||
@@ -66,13 +66,13 @@ pub fn get_missing_assoc_items( | |||
66 | if let Some(item_list) = impl_def.assoc_item_list() { | 66 | if let Some(item_list) = impl_def.assoc_item_list() { |
67 | for item in item_list.assoc_items() { | 67 | for item in item_list.assoc_items() { |
68 | match item { | 68 | match item { |
69 | ast::AssocItem::FnDef(f) => { | 69 | ast::AssocItem::Fn(f) => { |
70 | if let Some(n) = f.name() { | 70 | if let Some(n) = f.name() { |
71 | impl_fns_consts.insert(n.syntax().to_string()); | 71 | impl_fns_consts.insert(n.syntax().to_string()); |
72 | } | 72 | } |
73 | } | 73 | } |
74 | 74 | ||
75 | ast::AssocItem::TypeAliasDef(t) => { | 75 | ast::AssocItem::TypeAlias(t) => { |
76 | if let Some(n) = t.name() { | 76 | if let Some(n) = t.name() { |
77 | impl_type.insert(n.syntax().to_string()); | 77 | impl_type.insert(n.syntax().to_string()); |
78 | } | 78 | } |
diff --git a/crates/ra_hir/src/has_source.rs b/crates/ra_hir/src/has_source.rs index 76c32fc17..1557b7c83 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 { | |||
81 | } | 81 | } |
82 | } | 82 | } |
83 | impl HasSource for Function { | 83 | impl HasSource for Function { |
84 | type Ast = ast::FnDef; | 84 | type Ast = ast::Fn; |
85 | fn source(self, db: &dyn HirDatabase) -> InFile<ast::FnDef> { | 85 | fn source(self, db: &dyn HirDatabase) -> InFile<ast::Fn> { |
86 | self.id.lookup(db.upcast()).source(db.upcast()) | 86 | self.id.lookup(db.upcast()).source(db.upcast()) |
87 | } | 87 | } |
88 | } | 88 | } |
@@ -105,8 +105,8 @@ impl HasSource for Trait { | |||
105 | } | 105 | } |
106 | } | 106 | } |
107 | impl HasSource for TypeAlias { | 107 | impl HasSource for TypeAlias { |
108 | type Ast = ast::TypeAliasDef; | 108 | type Ast = ast::TypeAlias; |
109 | fn source(self, db: &dyn HirDatabase) -> InFile<ast::TypeAliasDef> { | 109 | fn source(self, db: &dyn HirDatabase) -> InFile<ast::TypeAlias> { |
110 | self.id.lookup(db.upcast()).source(db.upcast()) | 110 | self.id.lookup(db.upcast()).source(db.upcast()) |
111 | } | 111 | } |
112 | } | 112 | } |
diff --git a/crates/ra_hir/src/semantics.rs b/crates/ra_hir/src/semantics.rs index 1436b1afe..054405966 100644 --- a/crates/ra_hir/src/semantics.rs +++ b/crates/ra_hir/src/semantics.rs | |||
@@ -582,10 +582,10 @@ to_def_impls![ | |||
582 | (crate::Union, ast::UnionDef, union_to_def), | 582 | (crate::Union, ast::UnionDef, union_to_def), |
583 | (crate::Trait, ast::TraitDef, trait_to_def), | 583 | (crate::Trait, ast::TraitDef, trait_to_def), |
584 | (crate::ImplDef, ast::ImplDef, impl_to_def), | 584 | (crate::ImplDef, ast::ImplDef, impl_to_def), |
585 | (crate::TypeAlias, ast::TypeAliasDef, type_alias_to_def), | 585 | (crate::TypeAlias, ast::TypeAlias, type_alias_to_def), |
586 | (crate::Const, ast::ConstDef, const_to_def), | 586 | (crate::Const, ast::ConstDef, const_to_def), |
587 | (crate::Static, ast::StaticDef, static_to_def), | 587 | (crate::Static, ast::StaticDef, static_to_def), |
588 | (crate::Function, ast::FnDef, fn_to_def), | 588 | (crate::Function, ast::Fn, fn_to_def), |
589 | (crate::Field, ast::RecordFieldDef, record_field_to_def), | 589 | (crate::Field, ast::RecordFieldDef, record_field_to_def), |
590 | (crate::Field, ast::TupleFieldDef, tuple_field_to_def), | 590 | (crate::Field, ast::TupleFieldDef, tuple_field_to_def), |
591 | (crate::EnumVariant, ast::EnumVariant, enum_variant_to_def), | 591 | (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 42e5a1bdb..d23a1974b 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<'_, '_> { | |||
71 | pub(super) fn impl_to_def(&mut self, src: InFile<ast::ImplDef>) -> Option<ImplId> { | 71 | pub(super) fn impl_to_def(&mut self, src: InFile<ast::ImplDef>) -> Option<ImplId> { |
72 | self.to_def(src, keys::IMPL) | 72 | self.to_def(src, keys::IMPL) |
73 | } | 73 | } |
74 | pub(super) fn fn_to_def(&mut self, src: InFile<ast::FnDef>) -> Option<FunctionId> { | 74 | pub(super) fn fn_to_def(&mut self, src: InFile<ast::Fn>) -> Option<FunctionId> { |
75 | self.to_def(src, keys::FUNCTION) | 75 | self.to_def(src, keys::FUNCTION) |
76 | } | 76 | } |
77 | pub(super) fn struct_to_def(&mut self, src: InFile<ast::StructDef>) -> Option<StructId> { | 77 | pub(super) fn struct_to_def(&mut self, src: InFile<ast::StructDef>) -> Option<StructId> { |
@@ -89,10 +89,7 @@ impl SourceToDefCtx<'_, '_> { | |||
89 | pub(super) fn const_to_def(&mut self, src: InFile<ast::ConstDef>) -> Option<ConstId> { | 89 | pub(super) fn const_to_def(&mut self, src: InFile<ast::ConstDef>) -> Option<ConstId> { |
90 | self.to_def(src, keys::CONST) | 90 | self.to_def(src, keys::CONST) |
91 | } | 91 | } |
92 | pub(super) fn type_alias_to_def( | 92 | pub(super) fn type_alias_to_def(&mut self, src: InFile<ast::TypeAlias>) -> Option<TypeAliasId> { |
93 | &mut self, | ||
94 | src: InFile<ast::TypeAliasDef>, | ||
95 | ) -> Option<TypeAliasId> { | ||
96 | self.to_def(src, keys::TYPE_ALIAS) | 93 | self.to_def(src, keys::TYPE_ALIAS) |
97 | } | 94 | } |
98 | pub(super) fn record_field_to_def( | 95 | pub(super) fn record_field_to_def( |
@@ -171,7 +168,7 @@ impl SourceToDefCtx<'_, '_> { | |||
171 | let def = self.impl_to_def(container.with_value(it))?; | 168 | let def = self.impl_to_def(container.with_value(it))?; |
172 | def.into() | 169 | def.into() |
173 | }, | 170 | }, |
174 | ast::FnDef(it) => { | 171 | ast::Fn(it) => { |
175 | let def = self.fn_to_def(container.with_value(it))?; | 172 | let def = self.fn_to_def(container.with_value(it))?; |
176 | DefWithBodyId::from(def).into() | 173 | DefWithBodyId::from(def).into() |
177 | }, | 174 | }, |
@@ -195,7 +192,7 @@ impl SourceToDefCtx<'_, '_> { | |||
195 | let def = self.const_to_def(container.with_value(it))?; | 192 | let def = self.const_to_def(container.with_value(it))?; |
196 | DefWithBodyId::from(def).into() | 193 | DefWithBodyId::from(def).into() |
197 | }, | 194 | }, |
198 | ast::TypeAliasDef(it) => { | 195 | ast::TypeAlias(it) => { |
199 | let def = self.type_alias_to_def(container.with_value(it))?; | 196 | let def = self.type_alias_to_def(container.with_value(it))?; |
200 | def.into() | 197 | def.into() |
201 | }, | 198 | }, |
@@ -213,11 +210,11 @@ impl SourceToDefCtx<'_, '_> { | |||
213 | for container in src.cloned().ancestors_with_macros(self.db.upcast()).skip(1) { | 210 | for container in src.cloned().ancestors_with_macros(self.db.upcast()).skip(1) { |
214 | let res: GenericDefId = match_ast! { | 211 | let res: GenericDefId = match_ast! { |
215 | match (container.value) { | 212 | match (container.value) { |
216 | ast::FnDef(it) => self.fn_to_def(container.with_value(it))?.into(), | 213 | ast::Fn(it) => self.fn_to_def(container.with_value(it))?.into(), |
217 | ast::StructDef(it) => self.struct_to_def(container.with_value(it))?.into(), | 214 | ast::StructDef(it) => self.struct_to_def(container.with_value(it))?.into(), |
218 | ast::EnumDef(it) => self.enum_to_def(container.with_value(it))?.into(), | 215 | ast::EnumDef(it) => self.enum_to_def(container.with_value(it))?.into(), |
219 | ast::TraitDef(it) => self.trait_to_def(container.with_value(it))?.into(), | 216 | ast::TraitDef(it) => self.trait_to_def(container.with_value(it))?.into(), |
220 | ast::TypeAliasDef(it) => self.type_alias_to_def(container.with_value(it))?.into(), | 217 | ast::TypeAlias(it) => self.type_alias_to_def(container.with_value(it))?.into(), |
221 | ast::ImplDef(it) => self.impl_to_def(container.with_value(it))?.into(), | 218 | ast::ImplDef(it) => self.impl_to_def(container.with_value(it))?.into(), |
222 | _ => continue, | 219 | _ => continue, |
223 | } | 220 | } |
@@ -233,7 +230,7 @@ impl SourceToDefCtx<'_, '_> { | |||
233 | match (container.value) { | 230 | match (container.value) { |
234 | ast::ConstDef(it) => self.const_to_def(container.with_value(it))?.into(), | 231 | ast::ConstDef(it) => self.const_to_def(container.with_value(it))?.into(), |
235 | ast::StaticDef(it) => self.static_to_def(container.with_value(it))?.into(), | 232 | ast::StaticDef(it) => self.static_to_def(container.with_value(it))?.into(), |
236 | ast::FnDef(it) => self.fn_to_def(container.with_value(it))?.into(), | 233 | ast::Fn(it) => self.fn_to_def(container.with_value(it))?.into(), |
237 | _ => continue, | 234 | _ => continue, |
238 | } | 235 | } |
239 | }; | 236 | }; |
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index 5c57d8bde..f463997e7 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs | |||
@@ -627,14 +627,14 @@ impl ExprCollector<'_> { | |||
627 | .items() | 627 | .items() |
628 | .filter_map(|item| { | 628 | .filter_map(|item| { |
629 | let (def, name): (ModuleDefId, Option<ast::Name>) = match item { | 629 | let (def, name): (ModuleDefId, Option<ast::Name>) = match item { |
630 | ast::Item::FnDef(def) => { | 630 | ast::Item::Fn(def) => { |
631 | let id = self.find_inner_item(&def)?; | 631 | let id = self.find_inner_item(&def)?; |
632 | ( | 632 | ( |
633 | FunctionLoc { container: container.into(), id }.intern(self.db).into(), | 633 | FunctionLoc { container: container.into(), id }.intern(self.db).into(), |
634 | def.name(), | 634 | def.name(), |
635 | ) | 635 | ) |
636 | } | 636 | } |
637 | ast::Item::TypeAliasDef(def) => { | 637 | ast::Item::TypeAlias(def) => { |
638 | let id = self.find_inner_item(&def)?; | 638 | let id = self.find_inner_item(&def)?; |
639 | ( | 639 | ( |
640 | TypeAliasLoc { container: container.into(), id }.intern(self.db).into(), | 640 | TypeAliasLoc { 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 0bab9c6d8..ea61ac217 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 { | |||
413 | mod_items! { | 413 | mod_items! { |
414 | Import in imports -> ast::Use, | 414 | Import in imports -> ast::Use, |
415 | ExternCrate in extern_crates -> ast::ExternCrate, | 415 | ExternCrate in extern_crates -> ast::ExternCrate, |
416 | Function in functions -> ast::FnDef, | 416 | Function in functions -> ast::Fn, |
417 | Struct in structs -> ast::StructDef, | 417 | Struct in structs -> ast::StructDef, |
418 | Union in unions -> ast::UnionDef, | 418 | Union in unions -> ast::UnionDef, |
419 | Enum in enums -> ast::EnumDef, | 419 | Enum in enums -> ast::EnumDef, |
@@ -421,7 +421,7 @@ mod_items! { | |||
421 | Static in statics -> ast::StaticDef, | 421 | Static in statics -> ast::StaticDef, |
422 | Trait in traits -> ast::TraitDef, | 422 | Trait in traits -> ast::TraitDef, |
423 | Impl in impls -> ast::ImplDef, | 423 | Impl in impls -> ast::ImplDef, |
424 | TypeAlias in type_aliases -> ast::TypeAliasDef, | 424 | TypeAlias in type_aliases -> ast::TypeAlias, |
425 | Mod in mods -> ast::Module, | 425 | Mod in mods -> ast::Module, |
426 | MacroCall in macro_calls -> ast::MacroCall, | 426 | MacroCall in macro_calls -> ast::MacroCall, |
427 | } | 427 | } |
@@ -505,7 +505,7 @@ pub struct Function { | |||
505 | pub params: Box<[TypeRef]>, | 505 | pub params: Box<[TypeRef]>, |
506 | pub is_varargs: bool, | 506 | pub is_varargs: bool, |
507 | pub ret_type: TypeRef, | 507 | pub ret_type: TypeRef, |
508 | pub ast_id: FileAstId<ast::FnDef>, | 508 | pub ast_id: FileAstId<ast::Fn>, |
509 | } | 509 | } |
510 | 510 | ||
511 | #[derive(Debug, Clone, Eq, PartialEq)] | 511 | #[derive(Debug, Clone, Eq, PartialEq)] |
@@ -592,7 +592,7 @@ pub struct TypeAlias { | |||
592 | pub bounds: Box<[TypeBound]>, | 592 | pub bounds: Box<[TypeBound]>, |
593 | pub generic_params: GenericParamsId, | 593 | pub generic_params: GenericParamsId, |
594 | pub type_ref: Option<TypeRef>, | 594 | pub type_ref: Option<TypeRef>, |
595 | pub ast_id: FileAstId<ast::TypeAliasDef>, | 595 | pub ast_id: FileAstId<ast::TypeAlias>, |
596 | } | 596 | } |
597 | 597 | ||
598 | #[derive(Debug, Clone, Eq, PartialEq)] | 598 | #[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 8bd0362dc..4cfc68f53 100644 --- a/crates/ra_hir_def/src/item_tree/lower.rs +++ b/crates/ra_hir_def/src/item_tree/lower.rs | |||
@@ -78,8 +78,8 @@ impl Ctx { | |||
78 | ast::Item::StructDef(_) | 78 | ast::Item::StructDef(_) |
79 | | ast::Item::UnionDef(_) | 79 | | ast::Item::UnionDef(_) |
80 | | ast::Item::EnumDef(_) | 80 | | ast::Item::EnumDef(_) |
81 | | ast::Item::FnDef(_) | 81 | | ast::Item::Fn(_) |
82 | | ast::Item::TypeAliasDef(_) | 82 | | ast::Item::TypeAlias(_) |
83 | | ast::Item::ConstDef(_) | 83 | | ast::Item::ConstDef(_) |
84 | | ast::Item::StaticDef(_) | 84 | | ast::Item::StaticDef(_) |
85 | | ast::Item::MacroCall(_) => { | 85 | | ast::Item::MacroCall(_) => { |
@@ -103,8 +103,8 @@ impl Ctx { | |||
103 | ast::Item::StructDef(ast) => self.lower_struct(ast).map(Into::into), | 103 | ast::Item::StructDef(ast) => self.lower_struct(ast).map(Into::into), |
104 | ast::Item::UnionDef(ast) => self.lower_union(ast).map(Into::into), | 104 | ast::Item::UnionDef(ast) => self.lower_union(ast).map(Into::into), |
105 | ast::Item::EnumDef(ast) => self.lower_enum(ast).map(Into::into), | 105 | ast::Item::EnumDef(ast) => self.lower_enum(ast).map(Into::into), |
106 | ast::Item::FnDef(ast) => self.lower_function(ast).map(Into::into), | 106 | ast::Item::Fn(ast) => self.lower_function(ast).map(Into::into), |
107 | ast::Item::TypeAliasDef(ast) => self.lower_type_alias(ast).map(Into::into), | 107 | ast::Item::TypeAlias(ast) => self.lower_type_alias(ast).map(Into::into), |
108 | ast::Item::StaticDef(ast) => self.lower_static(ast).map(Into::into), | 108 | ast::Item::StaticDef(ast) => self.lower_static(ast).map(Into::into), |
109 | ast::Item::ConstDef(ast) => Some(self.lower_const(ast).into()), | 109 | ast::Item::ConstDef(ast) => Some(self.lower_const(ast).into()), |
110 | ast::Item::Module(ast) => self.lower_module(ast).map(Into::into), | 110 | ast::Item::Module(ast) => self.lower_module(ast).map(Into::into), |
@@ -155,8 +155,8 @@ impl Ctx { | |||
155 | 155 | ||
156 | fn lower_assoc_item(&mut self, item: &ast::AssocItem) -> Option<AssocItem> { | 156 | fn lower_assoc_item(&mut self, item: &ast::AssocItem) -> Option<AssocItem> { |
157 | match item { | 157 | match item { |
158 | ast::AssocItem::FnDef(ast) => self.lower_function(ast).map(Into::into), | 158 | ast::AssocItem::Fn(ast) => self.lower_function(ast).map(Into::into), |
159 | ast::AssocItem::TypeAliasDef(ast) => self.lower_type_alias(ast).map(Into::into), | 159 | ast::AssocItem::TypeAlias(ast) => self.lower_type_alias(ast).map(Into::into), |
160 | ast::AssocItem::ConstDef(ast) => Some(self.lower_const(ast).into()), | 160 | ast::AssocItem::ConstDef(ast) => Some(self.lower_const(ast).into()), |
161 | ast::AssocItem::MacroCall(ast) => self.lower_macro_call(ast).map(Into::into), | 161 | ast::AssocItem::MacroCall(ast) => self.lower_macro_call(ast).map(Into::into), |
162 | } | 162 | } |
@@ -277,7 +277,7 @@ impl Ctx { | |||
277 | Some(res) | 277 | Some(res) |
278 | } | 278 | } |
279 | 279 | ||
280 | fn lower_function(&mut self, func: &ast::FnDef) -> Option<FileItemTreeId<Function>> { | 280 | fn lower_function(&mut self, func: &ast::Fn) -> Option<FileItemTreeId<Function>> { |
281 | let visibility = self.lower_visibility(func); | 281 | let visibility = self.lower_visibility(func); |
282 | let name = func.name()?.as_name(); | 282 | let name = func.name()?.as_name(); |
283 | 283 | ||
@@ -348,7 +348,7 @@ impl Ctx { | |||
348 | 348 | ||
349 | fn lower_type_alias( | 349 | fn lower_type_alias( |
350 | &mut self, | 350 | &mut self, |
351 | type_alias: &ast::TypeAliasDef, | 351 | type_alias: &ast::TypeAlias, |
352 | ) -> Option<FileItemTreeId<TypeAlias>> { | 352 | ) -> Option<FileItemTreeId<TypeAlias>> { |
353 | let name = type_alias.name()?.as_name(); | 353 | let name = type_alias.name()?.as_name(); |
354 | let type_ref = type_alias.type_ref().map(|it| self.lower_type_ref(&it)); | 354 | let type_ref = type_alias.type_ref().map(|it| self.lower_type_ref(&it)); |
@@ -547,7 +547,7 @@ impl Ctx { | |||
547 | self.collect_inner_items(item.syntax()); | 547 | self.collect_inner_items(item.syntax()); |
548 | let attrs = Attrs::new(&item, &self.hygiene); | 548 | let attrs = Attrs::new(&item, &self.hygiene); |
549 | let id: ModItem = match item { | 549 | let id: ModItem = match item { |
550 | ast::ExternItem::FnDef(ast) => { | 550 | ast::ExternItem::Fn(ast) => { |
551 | let func = self.lower_function(&ast)?; | 551 | let func = self.lower_function(&ast)?; |
552 | self.data().functions[func.index].is_unsafe = true; | 552 | self.data().functions[func.index].is_unsafe = true; |
553 | func.into() | 553 | 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 3f2e29d9e..a8f5da1c1 100644 --- a/crates/ra_hir_def/src/item_tree/tests.rs +++ b/crates/ra_hir_def/src/item_tree/tests.rs | |||
@@ -236,13 +236,13 @@ fn smoke() { | |||
236 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("on_trait"))] }, input: None }]) }] | 236 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("on_trait"))] }, input: None }]) }] |
237 | Trait { name: Name(Text("Tr")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(0), auto: false, items: [TypeAlias(Idx::<TypeAlias>(0)), Const(Idx::<Const>(0)), Function(Idx::<Function>(0)), Function(Idx::<Function>(1))], ast_id: FileAstId::<ra_syntax::ast::generated::nodes::TraitDef>(2) } | 237 | Trait { name: Name(Text("Tr")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(0), auto: false, items: [TypeAlias(Idx::<TypeAlias>(0)), Const(Idx::<Const>(0)), Function(Idx::<Function>(0)), Function(Idx::<Function>(1))], ast_id: FileAstId::<ra_syntax::ast::generated::nodes::TraitDef>(2) } |
238 | > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_ty"))] }, input: None }]) }] | 238 | > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_ty"))] }, input: None }]) }] |
239 | > TypeAlias { name: Name(Text("AssocTy")), visibility: RawVisibilityId("pub(self)"), bounds: [Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Tr"))] }, generic_args: [Some(GenericArgs { args: [Type(Tuple([]))], has_self_type: false, bindings: [] })] })], generic_params: GenericParamsId(4294967295), type_ref: None, ast_id: FileAstId::<ra_syntax::ast::generated::nodes::TypeAliasDef>(8) } | 239 | > TypeAlias { name: Name(Text("AssocTy")), visibility: RawVisibilityId("pub(self)"), bounds: [Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Tr"))] }, generic_args: [Some(GenericArgs { args: [Type(Tuple([]))], has_self_type: false, bindings: [] })] })], generic_params: GenericParamsId(4294967295), type_ref: None, ast_id: FileAstId::<ra_syntax::ast::generated::nodes::TypeAlias>(8) } |
240 | > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_const"))] }, input: None }]) }] | 240 | > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_const"))] }, input: None }]) }] |
241 | > 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::<ra_syntax::ast::generated::nodes::ConstDef>(9) } | 241 | > 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::<ra_syntax::ast::generated::nodes::ConstDef>(9) } |
242 | > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_method"))] }, input: None }]) }] | 242 | > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_method"))] }, input: None }]) }] |
243 | > 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::<ra_syntax::ast::generated::nodes::FnDef>(10) } | 243 | > 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::<ra_syntax::ast::generated::nodes::Fn>(10) } |
244 | > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_dfl_method"))] }, input: None }]) }] | 244 | > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_dfl_method"))] }, input: None }]) }] |
245 | > 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::<ra_syntax::ast::generated::nodes::FnDef>(11) } | 245 | > 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::<ra_syntax::ast::generated::nodes::Fn>(11) } |
246 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct0"))] }, input: None }]) }] | 246 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct0"))] }, input: None }]) }] |
247 | Struct { name: Name(Text("Struct0")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(1), fields: Unit, ast_id: FileAstId::<ra_syntax::ast::generated::nodes::StructDef>(3), kind: Unit } | 247 | Struct { name: Name(Text("Struct0")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(1), fields: Unit, ast_id: FileAstId::<ra_syntax::ast::generated::nodes::StructDef>(3), kind: Unit } |
248 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct1"))] }, input: None }]) }] | 248 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct1"))] }, input: None }]) }] |
@@ -275,12 +275,12 @@ fn simple_inner_items() { | |||
275 | 275 | ||
276 | top-level items: | 276 | top-level items: |
277 | 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::<Function>(1))], ast_id: FileAstId::<ra_syntax::ast::generated::nodes::ImplDef>(0) } | 277 | 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::<Function>(1))], ast_id: FileAstId::<ra_syntax::ast::generated::nodes::ImplDef>(0) } |
278 | > 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::<ra_syntax::ast::generated::nodes::FnDef>(1) } | 278 | > 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::<ra_syntax::ast::generated::nodes::Fn>(1) } |
279 | 279 | ||
280 | inner items: | 280 | inner items: |
281 | 281 | ||
282 | for AST FileAstId::<ra_syntax::ast::generated::nodes::Item>(2): | 282 | for AST FileAstId::<ra_syntax::ast::generated::nodes::Item>(2): |
283 | 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::<ra_syntax::ast::generated::nodes::FnDef>(2) } | 283 | 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::<ra_syntax::ast::generated::nodes::Fn>(2) } |
284 | 284 | ||
285 | "#]], | 285 | "#]], |
286 | ); | 286 | ); |
@@ -303,9 +303,9 @@ fn extern_attrs() { | |||
303 | 303 | ||
304 | top-level items: | 304 | top-level items: |
305 | #[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 }]) }] | 305 | #[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 }]) }] |
306 | 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::<ra_syntax::ast::generated::nodes::FnDef>(1) } | 306 | 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::<ra_syntax::ast::generated::nodes::Fn>(1) } |
307 | #[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 }]) }] | 307 | #[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 }]) }] |
308 | 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::<ra_syntax::ast::generated::nodes::FnDef>(2) } | 308 | 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::<ra_syntax::ast::generated::nodes::Fn>(2) } |
309 | "##]], | 309 | "##]], |
310 | ); | 310 | ); |
311 | } | 311 | } |
@@ -329,9 +329,9 @@ fn trait_attrs() { | |||
329 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("trait_attr"))] }, input: None }]) }] | 329 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("trait_attr"))] }, input: None }]) }] |
330 | Trait { name: Name(Text("Tr")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(0), auto: false, items: [Function(Idx::<Function>(0)), Function(Idx::<Function>(1))], ast_id: FileAstId::<ra_syntax::ast::generated::nodes::TraitDef>(0) } | 330 | Trait { name: Name(Text("Tr")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(0), auto: false, items: [Function(Idx::<Function>(0)), Function(Idx::<Function>(1))], ast_id: FileAstId::<ra_syntax::ast::generated::nodes::TraitDef>(0) } |
331 | > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_a"))] }, input: None }]) }] | 331 | > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_a"))] }, input: None }]) }] |
332 | > 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::<ra_syntax::ast::generated::nodes::FnDef>(1) } | 332 | > 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::<ra_syntax::ast::generated::nodes::Fn>(1) } |
333 | > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_b"))] }, input: None }]) }] | 333 | > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_b"))] }, input: None }]) }] |
334 | > 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::<ra_syntax::ast::generated::nodes::FnDef>(2) } | 334 | > 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::<ra_syntax::ast::generated::nodes::Fn>(2) } |
335 | "##]], | 335 | "##]], |
336 | ); | 336 | ); |
337 | } | 337 | } |
@@ -355,9 +355,9 @@ fn impl_attrs() { | |||
355 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("impl_attr"))] }, input: None }]) }] | 355 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("impl_attr"))] }, input: None }]) }] |
356 | 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::<Function>(0)), Function(Idx::<Function>(1))], ast_id: FileAstId::<ra_syntax::ast::generated::nodes::ImplDef>(0) } | 356 | 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::<Function>(0)), Function(Idx::<Function>(1))], ast_id: FileAstId::<ra_syntax::ast::generated::nodes::ImplDef>(0) } |
357 | > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_a"))] }, input: None }]) }] | 357 | > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_a"))] }, input: None }]) }] |
358 | > 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::<ra_syntax::ast::generated::nodes::FnDef>(1) } | 358 | > 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::<ra_syntax::ast::generated::nodes::Fn>(1) } |
359 | > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_b"))] }, input: None }]) }] | 359 | > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("attr_b"))] }, input: None }]) }] |
360 | > 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::<ra_syntax::ast::generated::nodes::FnDef>(2) } | 360 | > 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::<ra_syntax::ast::generated::nodes::Fn>(2) } |
361 | "##]], | 361 | "##]], |
362 | ); | 362 | ); |
363 | } | 363 | } |
@@ -408,13 +408,13 @@ fn inner_item_attrs() { | |||
408 | inner attrs: Attrs { entries: None } | 408 | inner attrs: Attrs { entries: None } |
409 | 409 | ||
410 | top-level items: | 410 | top-level items: |
411 | 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::<ra_syntax::ast::generated::nodes::FnDef>(0) } | 411 | 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::<ra_syntax::ast::generated::nodes::Fn>(0) } |
412 | 412 | ||
413 | inner items: | 413 | inner items: |
414 | 414 | ||
415 | for AST FileAstId::<ra_syntax::ast::generated::nodes::Item>(1): | 415 | for AST FileAstId::<ra_syntax::ast::generated::nodes::Item>(1): |
416 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("on_inner"))] }, input: None }]) }] | 416 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("on_inner"))] }, input: None }]) }] |
417 | 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::<ra_syntax::ast::generated::nodes::FnDef>(1) } | 417 | 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::<ra_syntax::ast::generated::nodes::Fn>(1) } |
418 | 418 | ||
419 | "##]], | 419 | "##]], |
420 | ); | 420 | ); |
diff --git a/crates/ra_hir_def/src/keys.rs b/crates/ra_hir_def/src/keys.rs index a7349a21d..f627eab1f 100644 --- a/crates/ra_hir_def/src/keys.rs +++ b/crates/ra_hir_def/src/keys.rs | |||
@@ -14,10 +14,10 @@ use crate::{ | |||
14 | 14 | ||
15 | pub type Key<K, V> = crate::dyn_map::Key<InFile<K>, V, AstPtrPolicy<K, V>>; | 15 | pub type Key<K, V> = crate::dyn_map::Key<InFile<K>, V, AstPtrPolicy<K, V>>; |
16 | 16 | ||
17 | pub const FUNCTION: Key<ast::FnDef, FunctionId> = Key::new(); | 17 | pub const FUNCTION: Key<ast::Fn, FunctionId> = Key::new(); |
18 | pub const CONST: Key<ast::ConstDef, ConstId> = Key::new(); | 18 | pub const CONST: Key<ast::ConstDef, ConstId> = Key::new(); |
19 | pub const STATIC: Key<ast::StaticDef, StaticId> = Key::new(); | 19 | pub const STATIC: Key<ast::StaticDef, StaticId> = Key::new(); |
20 | pub const TYPE_ALIAS: Key<ast::TypeAliasDef, TypeAliasId> = Key::new(); | 20 | pub const TYPE_ALIAS: Key<ast::TypeAlias, TypeAliasId> = Key::new(); |
21 | pub const IMPL: Key<ast::ImplDef, ImplId> = Key::new(); | 21 | pub const IMPL: Key<ast::ImplDef, ImplId> = Key::new(); |
22 | pub const TRAIT: Key<ast::TraitDef, TraitId> = Key::new(); | 22 | pub const TRAIT: Key<ast::TraitDef, TraitId> = Key::new(); |
23 | pub const STRUCT: Key<ast::StructDef, StructId> = Key::new(); | 23 | pub const STRUCT: Key<ast::StructDef, StructId> = Key::new(); |
diff --git a/crates/ra_hir_ty/src/tests.rs b/crates/ra_hir_ty/src/tests.rs index 45bc14c37..016e689ff 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) { | |||
81 | fn type_at_range(db: &TestDB, pos: FileRange) -> Ty { | 81 | fn type_at_range(db: &TestDB, pos: FileRange) -> Ty { |
82 | let file = db.parse(pos.file_id).ok().unwrap(); | 82 | let file = db.parse(pos.file_id).ok().unwrap(); |
83 | let expr = algo::find_node_at_range::<ast::Expr>(file.syntax(), pos.range).unwrap(); | 83 | let expr = algo::find_node_at_range::<ast::Expr>(file.syntax(), pos.range).unwrap(); |
84 | let fn_def = expr.syntax().ancestors().find_map(ast::FnDef::cast).unwrap(); | 84 | let fn_def = expr.syntax().ancestors().find_map(ast::Fn::cast).unwrap(); |
85 | let module = db.module_for_file(pos.file_id); | 85 | let module = db.module_for_file(pos.file_id); |
86 | let func = *module.child_by_source(db)[keys::FUNCTION] | 86 | let func = *module.child_by_source(db)[keys::FUNCTION] |
87 | .get(&InFile::new(pos.file_id.into(), fn_def)) | 87 | .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 c28af8ab3..1fcaf4a32 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 | |||
59 | if let Some(nav) = syntax.ancestors().find_map(|node| { | 59 | if let Some(nav) = syntax.ancestors().find_map(|node| { |
60 | match_ast! { | 60 | match_ast! { |
61 | match node { | 61 | match node { |
62 | ast::FnDef(it) => { | 62 | ast::Fn(it) => { |
63 | let def = sema.to_def(&it)?; | 63 | let def = sema.to_def(&it)?; |
64 | Some(def.to_nav(sema.db)) | 64 | Some(def.to_nav(sema.db)) |
65 | }, | 65 | }, |
@@ -181,8 +181,8 @@ fn caller() { | |||
181 | call<|>ee(); | 181 | call<|>ee(); |
182 | } | 182 | } |
183 | "#, | 183 | "#, |
184 | "callee FN_DEF FileId(1) 0..14 3..9", | 184 | "callee FN FileId(1) 0..14 3..9", |
185 | &["caller FN_DEF FileId(1) 15..44 18..24 : [33..39]"], | 185 | &["caller FN FileId(1) 15..44 18..24 : [33..39]"], |
186 | &[], | 186 | &[], |
187 | ); | 187 | ); |
188 | } | 188 | } |
@@ -197,8 +197,8 @@ fn caller() { | |||
197 | callee(); | 197 | callee(); |
198 | } | 198 | } |
199 | "#, | 199 | "#, |
200 | "callee FN_DEF FileId(1) 0..14 3..9", | 200 | "callee FN FileId(1) 0..14 3..9", |
201 | &["caller FN_DEF FileId(1) 15..44 18..24 : [33..39]"], | 201 | &["caller FN FileId(1) 15..44 18..24 : [33..39]"], |
202 | &[], | 202 | &[], |
203 | ); | 203 | ); |
204 | } | 204 | } |
@@ -214,8 +214,8 @@ fn caller() { | |||
214 | callee(); | 214 | callee(); |
215 | } | 215 | } |
216 | "#, | 216 | "#, |
217 | "callee FN_DEF FileId(1) 0..14 3..9", | 217 | "callee FN FileId(1) 0..14 3..9", |
218 | &["caller FN_DEF FileId(1) 15..58 18..24 : [33..39, 47..53]"], | 218 | &["caller FN FileId(1) 15..58 18..24 : [33..39, 47..53]"], |
219 | &[], | 219 | &[], |
220 | ); | 220 | ); |
221 | } | 221 | } |
@@ -234,10 +234,10 @@ fn caller2() { | |||
234 | callee(); | 234 | callee(); |
235 | } | 235 | } |
236 | "#, | 236 | "#, |
237 | "callee FN_DEF FileId(1) 0..14 3..9", | 237 | "callee FN FileId(1) 0..14 3..9", |
238 | &[ | 238 | &[ |
239 | "caller1 FN_DEF FileId(1) 15..45 18..25 : [34..40]", | 239 | "caller1 FN FileId(1) 15..45 18..25 : [34..40]", |
240 | "caller2 FN_DEF FileId(1) 47..77 50..57 : [66..72]", | 240 | "caller2 FN FileId(1) 47..77 50..57 : [66..72]", |
241 | ], | 241 | ], |
242 | &[], | 242 | &[], |
243 | ); | 243 | ); |
@@ -263,10 +263,10 @@ mod tests { | |||
263 | } | 263 | } |
264 | } | 264 | } |
265 | "#, | 265 | "#, |
266 | "callee FN_DEF FileId(1) 0..14 3..9", | 266 | "callee FN FileId(1) 0..14 3..9", |
267 | &[ | 267 | &[ |
268 | "caller1 FN_DEF FileId(1) 15..45 18..25 : [34..40]", | 268 | "caller1 FN FileId(1) 15..45 18..25 : [34..40]", |
269 | "test_caller FN_DEF FileId(1) 95..149 110..121 : [134..140]", | 269 | "test_caller FN FileId(1) 95..149 110..121 : [134..140]", |
270 | ], | 270 | ], |
271 | &[], | 271 | &[], |
272 | ); | 272 | ); |
@@ -287,8 +287,8 @@ fn caller() { | |||
287 | //- /foo/mod.rs | 287 | //- /foo/mod.rs |
288 | pub fn callee() {} | 288 | pub fn callee() {} |
289 | "#, | 289 | "#, |
290 | "callee FN_DEF FileId(2) 0..18 7..13", | 290 | "callee FN FileId(2) 0..18 7..13", |
291 | &["caller FN_DEF FileId(1) 27..56 30..36 : [45..51]"], | 291 | &["caller FN FileId(1) 27..56 30..36 : [45..51]"], |
292 | &[], | 292 | &[], |
293 | ); | 293 | ); |
294 | } | 294 | } |
@@ -304,9 +304,9 @@ fn call<|>er() { | |||
304 | callee(); | 304 | callee(); |
305 | } | 305 | } |
306 | "#, | 306 | "#, |
307 | "caller FN_DEF FileId(1) 15..58 18..24", | 307 | "caller FN FileId(1) 15..58 18..24", |
308 | &[], | 308 | &[], |
309 | &["callee FN_DEF FileId(1) 0..14 3..9 : [33..39, 47..53]"], | 309 | &["callee FN FileId(1) 0..14 3..9 : [33..39, 47..53]"], |
310 | ); | 310 | ); |
311 | } | 311 | } |
312 | 312 | ||
@@ -325,9 +325,9 @@ fn call<|>er() { | |||
325 | //- /foo/mod.rs | 325 | //- /foo/mod.rs |
326 | pub fn callee() {} | 326 | pub fn callee() {} |
327 | "#, | 327 | "#, |
328 | "caller FN_DEF FileId(1) 27..56 30..36", | 328 | "caller FN FileId(1) 27..56 30..36", |
329 | &[], | 329 | &[], |
330 | &["callee FN_DEF FileId(2) 0..18 7..13 : [45..51]"], | 330 | &["callee FN FileId(2) 0..18 7..13 : [45..51]"], |
331 | ); | 331 | ); |
332 | } | 332 | } |
333 | 333 | ||
@@ -348,9 +348,9 @@ fn caller3() { | |||
348 | 348 | ||
349 | } | 349 | } |
350 | "#, | 350 | "#, |
351 | "caller2 FN_DEF FileId(1) 33..64 36..43", | 351 | "caller2 FN FileId(1) 33..64 36..43", |
352 | &["caller1 FN_DEF FileId(1) 0..31 3..10 : [19..26]"], | 352 | &["caller1 FN FileId(1) 0..31 3..10 : [19..26]"], |
353 | &["caller3 FN_DEF FileId(1) 66..83 69..76 : [52..59]"], | 353 | &["caller3 FN FileId(1) 66..83 69..76 : [52..59]"], |
354 | ); | 354 | ); |
355 | } | 355 | } |
356 | 356 | ||
@@ -368,9 +368,9 @@ fn main() { | |||
368 | a<|>() | 368 | a<|>() |
369 | } | 369 | } |
370 | "#, | 370 | "#, |
371 | "a FN_DEF FileId(1) 0..18 3..4", | 371 | "a FN FileId(1) 0..18 3..4", |
372 | &["main FN_DEF FileId(1) 31..52 34..38 : [47..48]"], | 372 | &["main FN FileId(1) 31..52 34..38 : [47..48]"], |
373 | &["b FN_DEF FileId(1) 20..29 23..24 : [13..14]"], | 373 | &["b FN FileId(1) 20..29 23..24 : [13..14]"], |
374 | ); | 374 | ); |
375 | 375 | ||
376 | check_hierarchy( | 376 | check_hierarchy( |
@@ -385,8 +385,8 @@ fn main() { | |||
385 | a() | 385 | a() |
386 | } | 386 | } |
387 | "#, | 387 | "#, |
388 | "b FN_DEF FileId(1) 20..29 23..24", | 388 | "b FN FileId(1) 20..29 23..24", |
389 | &["a FN_DEF FileId(1) 0..18 3..4 : [13..14]"], | 389 | &["a FN FileId(1) 0..18 3..4 : [13..14]"], |
390 | &[], | 390 | &[], |
391 | ); | 391 | ); |
392 | } | 392 | } |
diff --git a/crates/ra_ide/src/completion/complete_fn_param.rs b/crates/ra_ide/src/completion/complete_fn_param.rs index d4b6112a5..406334257 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) | |||
19 | 19 | ||
20 | let mut params = FxHashMap::default(); | 20 | let mut params = FxHashMap::default(); |
21 | 21 | ||
22 | let me = ctx.token.ancestors().find_map(ast::FnDef::cast); | 22 | let me = ctx.token.ancestors().find_map(ast::Fn::cast); |
23 | let mut process_fn = |func: ast::FnDef| { | 23 | let mut process_fn = |func: ast::Fn| { |
24 | if Some(&func) == me.as_ref() { | 24 | if Some(&func) == me.as_ref() { |
25 | return; | 25 | return; |
26 | } | 26 | } |
@@ -34,15 +34,15 @@ pub(super) fn complete_fn_param(acc: &mut Completions, ctx: &CompletionContext) | |||
34 | match_ast! { | 34 | match_ast! { |
35 | match node { | 35 | match node { |
36 | ast::SourceFile(it) => it.items().filter_map(|item| match item { | 36 | ast::SourceFile(it) => it.items().filter_map(|item| match item { |
37 | ast::Item::FnDef(it) => Some(it), | 37 | ast::Item::Fn(it) => Some(it), |
38 | _ => None, | 38 | _ => None, |
39 | }).for_each(&mut process_fn), | 39 | }).for_each(&mut process_fn), |
40 | ast::ItemList(it) => it.items().filter_map(|item| match item { | 40 | ast::ItemList(it) => it.items().filter_map(|item| match item { |
41 | ast::Item::FnDef(it) => Some(it), | 41 | ast::Item::Fn(it) => Some(it), |
42 | _ => None, | 42 | _ => None, |
43 | }).for_each(&mut process_fn), | 43 | }).for_each(&mut process_fn), |
44 | ast::AssocItemList(it) => it.assoc_items().filter_map(|item| match item { | 44 | ast::AssocItemList(it) => it.assoc_items().filter_map(|item| match item { |
45 | ast::AssocItem::FnDef(it) => Some(it), | 45 | ast::AssocItem::Fn(it) => Some(it), |
46 | _ => None, | 46 | _ => None, |
47 | }).for_each(&mut process_fn), | 47 | }).for_each(&mut process_fn), |
48 | _ => continue, | 48 | _ => continue, |
diff --git a/crates/ra_ide/src/completion/complete_keyword.rs b/crates/ra_ide/src/completion/complete_keyword.rs index 1581b2d5d..b62064797 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 | |||
169 | 169 | ||
170 | fn complete_return( | 170 | fn complete_return( |
171 | ctx: &CompletionContext, | 171 | ctx: &CompletionContext, |
172 | fn_def: &ast::FnDef, | 172 | fn_def: &ast::Fn, |
173 | can_be_stmt: bool, | 173 | can_be_stmt: bool, |
174 | ) -> Option<CompletionItem> { | 174 | ) -> Option<CompletionItem> { |
175 | let snip = match (can_be_stmt, fn_def.ret_type().is_some()) { | 175 | 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 cf716540f..7d9050a6b 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 @@ | |||
2 | //! | 2 | //! |
3 | //! This module adds the completion items related to implementing associated | 3 | //! This module adds the completion items related to implementing associated |
4 | //! items within a `impl Trait for Struct` block. The current context node | 4 | //! items within a `impl Trait for Struct` block. The current context node |
5 | //! must be within either a `FN_DEF`, `TYPE_ALIAS_DEF`, or `CONST_DEF` node | 5 | //! must be within either a `FN`, `TYPE_ALIAS`, or `CONST_DEF` node |
6 | //! and an direct child of an `IMPL_DEF`. | 6 | //! and an direct child of an `IMPL_DEF`. |
7 | //! | 7 | //! |
8 | //! # Examples | 8 | //! # Examples |
@@ -63,7 +63,7 @@ pub(crate) fn complete_trait_impl(acc: &mut Completions, ctx: &CompletionContext | |||
63 | } | 63 | } |
64 | }), | 64 | }), |
65 | 65 | ||
66 | SyntaxKind::FN_DEF => { | 66 | SyntaxKind::FN => { |
67 | for missing_fn in get_missing_assoc_items(&ctx.sema, &impl_def) | 67 | for missing_fn in get_missing_assoc_items(&ctx.sema, &impl_def) |
68 | .into_iter() | 68 | .into_iter() |
69 | .filter_map(|item| match item { | 69 | .filter_map(|item| match item { |
@@ -75,7 +75,7 @@ pub(crate) fn complete_trait_impl(acc: &mut Completions, ctx: &CompletionContext | |||
75 | } | 75 | } |
76 | } | 76 | } |
77 | 77 | ||
78 | SyntaxKind::TYPE_ALIAS_DEF => { | 78 | SyntaxKind::TYPE_ALIAS => { |
79 | for missing_fn in get_missing_assoc_items(&ctx.sema, &impl_def) | 79 | for missing_fn in get_missing_assoc_items(&ctx.sema, &impl_def) |
80 | .into_iter() | 80 | .into_iter() |
81 | .filter_map(|item| match item { | 81 | .filter_map(|item| match item { |
@@ -106,8 +106,8 @@ pub(crate) fn complete_trait_impl(acc: &mut Completions, ctx: &CompletionContext | |||
106 | 106 | ||
107 | fn completion_match(ctx: &CompletionContext) -> Option<(SyntaxNode, ImplDef)> { | 107 | fn completion_match(ctx: &CompletionContext) -> Option<(SyntaxNode, ImplDef)> { |
108 | let (trigger, impl_def_offset) = ctx.token.ancestors().find_map(|p| match p.kind() { | 108 | let (trigger, impl_def_offset) = ctx.token.ancestors().find_map(|p| match p.kind() { |
109 | SyntaxKind::FN_DEF | 109 | SyntaxKind::FN |
110 | | SyntaxKind::TYPE_ALIAS_DEF | 110 | | SyntaxKind::TYPE_ALIAS |
111 | | SyntaxKind::CONST_DEF | 111 | | SyntaxKind::CONST_DEF |
112 | | SyntaxKind::BLOCK_EXPR => Some((p, 2)), | 112 | | SyntaxKind::BLOCK_EXPR => Some((p, 2)), |
113 | SyntaxKind::NAME_REF => Some((p, 5)), | 113 | SyntaxKind::NAME_REF => Some((p, 5)), |
diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs index cc55f6dd6..221d7847e 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> { | |||
35 | pub(super) krate: Option<hir::Crate>, | 35 | pub(super) krate: Option<hir::Crate>, |
36 | pub(super) expected_type: Option<Type>, | 36 | pub(super) expected_type: Option<Type>, |
37 | pub(super) name_ref_syntax: Option<ast::NameRef>, | 37 | pub(super) name_ref_syntax: Option<ast::NameRef>, |
38 | pub(super) function_syntax: Option<ast::FnDef>, | 38 | pub(super) function_syntax: Option<ast::Fn>, |
39 | pub(super) use_item_syntax: Option<ast::Use>, | 39 | pub(super) use_item_syntax: Option<ast::Use>, |
40 | pub(super) record_lit_syntax: Option<ast::RecordLit>, | 40 | pub(super) record_lit_syntax: Option<ast::RecordLit>, |
41 | pub(super) record_pat_syntax: Option<ast::RecordPat>, | 41 | pub(super) record_pat_syntax: Option<ast::RecordPat>, |
@@ -349,7 +349,7 @@ impl<'a> CompletionContext<'a> { | |||
349 | .sema | 349 | .sema |
350 | .ancestors_with_macros(self.token.parent()) | 350 | .ancestors_with_macros(self.token.parent()) |
351 | .take_while(|it| it.kind() != SOURCE_FILE && it.kind() != MODULE) | 351 | .take_while(|it| it.kind() != SOURCE_FILE && it.kind() != MODULE) |
352 | .find_map(ast::FnDef::cast); | 352 | .find_map(ast::Fn::cast); |
353 | 353 | ||
354 | self.record_field_syntax = self | 354 | self.record_field_syntax = self |
355 | .sema | 355 | .sema |
diff --git a/crates/ra_ide/src/completion/patterns.rs b/crates/ra_ide/src/completion/patterns.rs index 175209d8a..b8408da4e 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 { | |||
134 | NodeOrToken::Token(token) => token.parent(), | 134 | NodeOrToken::Token(token) => token.parent(), |
135 | }; | 135 | }; |
136 | for node in leaf.ancestors() { | 136 | for node in leaf.ancestors() { |
137 | if node.kind() == FN_DEF || node.kind() == LAMBDA_EXPR { | 137 | if node.kind() == FN || node.kind() == LAMBDA_EXPR { |
138 | break; | 138 | break; |
139 | } | 139 | } |
140 | let loop_body = match_ast! { | 140 | let loop_body = match_ast! { |
diff --git a/crates/ra_ide/src/display.rs b/crates/ra_ide/src/display.rs index 6d4151dd8..6d93726bf 100644 --- a/crates/ra_ide/src/display.rs +++ b/crates/ra_ide/src/display.rs | |||
@@ -16,7 +16,7 @@ pub use navigation_target::NavigationTarget; | |||
16 | pub(crate) use navigation_target::{ToNav, TryToNav}; | 16 | pub(crate) use navigation_target::{ToNav, TryToNav}; |
17 | pub(crate) use short_label::ShortLabel; | 17 | pub(crate) use short_label::ShortLabel; |
18 | 18 | ||
19 | pub(crate) fn function_declaration(node: &ast::FnDef) -> String { | 19 | pub(crate) fn function_declaration(node: &ast::Fn) -> String { |
20 | let mut buf = String::new(); | 20 | let mut buf = String::new(); |
21 | if let Some(vis) = node.visibility() { | 21 | if let Some(vis) = node.visibility() { |
22 | format_to!(buf, "{} ", vis); | 22 | format_to!(buf, "{} ", vis); |
@@ -65,7 +65,7 @@ pub(crate) fn const_label(node: &ast::ConstDef) -> String { | |||
65 | label.trim().to_owned() | 65 | label.trim().to_owned() |
66 | } | 66 | } |
67 | 67 | ||
68 | pub(crate) fn type_label(node: &ast::TypeAliasDef) -> String { | 68 | pub(crate) fn type_label(node: &ast::TypeAlias) -> String { |
69 | let label: String = node | 69 | let label: String = node |
70 | .syntax() | 70 | .syntax() |
71 | .children_with_tokens() | 71 | .children_with_tokens() |
diff --git a/crates/ra_ide/src/display/navigation_target.rs b/crates/ra_ide/src/display/navigation_target.rs index fd245705c..4f19c7ed4 100644 --- a/crates/ra_ide/src/display/navigation_target.rs +++ b/crates/ra_ide/src/display/navigation_target.rs | |||
@@ -379,12 +379,12 @@ pub(crate) fn docs_from_symbol(db: &RootDatabase, symbol: &FileSymbol) -> Option | |||
379 | 379 | ||
380 | match_ast! { | 380 | match_ast! { |
381 | match node { | 381 | match node { |
382 | ast::FnDef(it) => it.doc_comment_text(), | 382 | ast::Fn(it) => it.doc_comment_text(), |
383 | ast::StructDef(it) => it.doc_comment_text(), | 383 | ast::StructDef(it) => it.doc_comment_text(), |
384 | ast::EnumDef(it) => it.doc_comment_text(), | 384 | ast::EnumDef(it) => it.doc_comment_text(), |
385 | ast::TraitDef(it) => it.doc_comment_text(), | 385 | ast::TraitDef(it) => it.doc_comment_text(), |
386 | ast::Module(it) => it.doc_comment_text(), | 386 | ast::Module(it) => it.doc_comment_text(), |
387 | ast::TypeAliasDef(it) => it.doc_comment_text(), | 387 | ast::TypeAlias(it) => it.doc_comment_text(), |
388 | ast::ConstDef(it) => it.doc_comment_text(), | 388 | ast::ConstDef(it) => it.doc_comment_text(), |
389 | ast::StaticDef(it) => it.doc_comment_text(), | 389 | ast::StaticDef(it) => it.doc_comment_text(), |
390 | ast::RecordFieldDef(it) => it.doc_comment_text(), | 390 | ast::RecordFieldDef(it) => it.doc_comment_text(), |
@@ -404,12 +404,12 @@ pub(crate) fn description_from_symbol(db: &RootDatabase, symbol: &FileSymbol) -> | |||
404 | 404 | ||
405 | match_ast! { | 405 | match_ast! { |
406 | match node { | 406 | match node { |
407 | ast::FnDef(it) => it.short_label(), | 407 | ast::Fn(it) => it.short_label(), |
408 | ast::StructDef(it) => it.short_label(), | 408 | ast::StructDef(it) => it.short_label(), |
409 | ast::EnumDef(it) => it.short_label(), | 409 | ast::EnumDef(it) => it.short_label(), |
410 | ast::TraitDef(it) => it.short_label(), | 410 | ast::TraitDef(it) => it.short_label(), |
411 | ast::Module(it) => it.short_label(), | 411 | ast::Module(it) => it.short_label(), |
412 | ast::TypeAliasDef(it) => it.short_label(), | 412 | ast::TypeAlias(it) => it.short_label(), |
413 | ast::ConstDef(it) => it.short_label(), | 413 | ast::ConstDef(it) => it.short_label(), |
414 | ast::StaticDef(it) => it.short_label(), | 414 | ast::StaticDef(it) => it.short_label(), |
415 | ast::RecordFieldDef(it) => it.short_label(), | 415 | ast::RecordFieldDef(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 5588130a1..e2c95be06 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 { | |||
7 | fn short_label(&self) -> Option<String>; | 7 | fn short_label(&self) -> Option<String>; |
8 | } | 8 | } |
9 | 9 | ||
10 | impl ShortLabel for ast::FnDef { | 10 | impl ShortLabel for ast::Fn { |
11 | fn short_label(&self) -> Option<String> { | 11 | fn short_label(&self) -> Option<String> { |
12 | Some(crate::display::function_declaration(self)) | 12 | Some(crate::display::function_declaration(self)) |
13 | } | 13 | } |
@@ -47,7 +47,7 @@ impl ShortLabel for ast::Module { | |||
47 | } | 47 | } |
48 | } | 48 | } |
49 | 49 | ||
50 | impl ShortLabel for ast::TypeAliasDef { | 50 | impl ShortLabel for ast::TypeAlias { |
51 | fn short_label(&self) -> Option<String> { | 51 | fn short_label(&self) -> Option<String> { |
52 | short_label_from_node(self, "type ") | 52 | short_label_from_node(self, "type ") |
53 | } | 53 | } |
diff --git a/crates/ra_ide/src/file_structure.rs b/crates/ra_ide/src/file_structure.rs index 1f6a3febf..8ef977761 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<StructureNode> { | |||
111 | 111 | ||
112 | match_ast! { | 112 | match_ast! { |
113 | match node { | 113 | match node { |
114 | ast::FnDef(it) => { | 114 | ast::Fn(it) => { |
115 | let mut detail = String::from("fn"); | 115 | let mut detail = String::from("fn"); |
116 | if let Some(type_param_list) = it.type_param_list() { | 116 | if let Some(type_param_list) = it.type_param_list() { |
117 | collapse_ws(type_param_list.syntax(), &mut detail); | 117 | collapse_ws(type_param_list.syntax(), &mut detail); |
@@ -132,7 +132,7 @@ fn structure_node(node: &SyntaxNode) -> Option<StructureNode> { | |||
132 | ast::EnumVariant(it) => decl(it), | 132 | ast::EnumVariant(it) => decl(it), |
133 | ast::TraitDef(it) => decl(it), | 133 | ast::TraitDef(it) => decl(it), |
134 | ast::Module(it) => decl(it), | 134 | ast::Module(it) => decl(it), |
135 | ast::TypeAliasDef(it) => { | 135 | ast::TypeAlias(it) => { |
136 | let ty = it.type_ref(); | 136 | let ty = it.type_ref(); |
137 | decl_with_type_ref(it, ty) | 137 | decl_with_type_ref(it, ty) |
138 | }, | 138 | }, |
@@ -271,7 +271,7 @@ fn very_obsolete() {} | |||
271 | label: "bar1", | 271 | label: "bar1", |
272 | navigation_range: 43..47, | 272 | navigation_range: 43..47, |
273 | node_range: 40..52, | 273 | node_range: 40..52, |
274 | kind: FN_DEF, | 274 | kind: FN, |
275 | detail: Some( | 275 | detail: Some( |
276 | "fn()", | 276 | "fn()", |
277 | ), | 277 | ), |
@@ -284,7 +284,7 @@ fn very_obsolete() {} | |||
284 | label: "bar2", | 284 | label: "bar2", |
285 | navigation_range: 60..64, | 285 | navigation_range: 60..64, |
286 | node_range: 57..81, | 286 | node_range: 57..81, |
287 | kind: FN_DEF, | 287 | kind: FN, |
288 | detail: Some( | 288 | detail: Some( |
289 | "fn<T>(t: T) -> T", | 289 | "fn<T>(t: T) -> T", |
290 | ), | 290 | ), |
@@ -297,7 +297,7 @@ fn very_obsolete() {} | |||
297 | label: "bar3", | 297 | label: "bar3", |
298 | navigation_range: 89..93, | 298 | navigation_range: 89..93, |
299 | node_range: 86..156, | 299 | node_range: 86..156, |
300 | kind: FN_DEF, | 300 | kind: FN, |
301 | detail: Some( | 301 | detail: Some( |
302 | "fn<A, B>(a: A, b: B) -> Vec< u32 >", | 302 | "fn<A, B>(a: A, b: B) -> Vec< u32 >", |
303 | ), | 303 | ), |
@@ -339,7 +339,7 @@ fn very_obsolete() {} | |||
339 | label: "T", | 339 | label: "T", |
340 | navigation_range: 186..187, | 340 | navigation_range: 186..187, |
341 | node_range: 181..193, | 341 | node_range: 181..193, |
342 | kind: TYPE_ALIAS_DEF, | 342 | kind: TYPE_ALIAS, |
343 | detail: Some( | 343 | detail: Some( |
344 | "()", | 344 | "()", |
345 | ), | 345 | ), |
@@ -417,7 +417,7 @@ fn very_obsolete() {} | |||
417 | label: "obsolete", | 417 | label: "obsolete", |
418 | navigation_range: 428..436, | 418 | navigation_range: 428..436, |
419 | node_range: 411..441, | 419 | node_range: 411..441, |
420 | kind: FN_DEF, | 420 | kind: FN, |
421 | detail: Some( | 421 | detail: Some( |
422 | "fn()", | 422 | "fn()", |
423 | ), | 423 | ), |
@@ -428,7 +428,7 @@ fn very_obsolete() {} | |||
428 | label: "very_obsolete", | 428 | label: "very_obsolete", |
429 | navigation_range: 481..494, | 429 | navigation_range: 481..494, |
430 | node_range: 443..499, | 430 | node_range: 443..499, |
431 | kind: FN_DEF, | 431 | kind: FN, |
432 | detail: Some( | 432 | detail: Some( |
433 | "fn()", | 433 | "fn()", |
434 | ), | 434 | ), |
diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs index d067c339d..4ef7efd26 100644 --- a/crates/ra_ide/src/hover.rs +++ b/crates/ra_ide/src/hover.rs | |||
@@ -1361,7 +1361,7 @@ fn foo_<|>test() {} | |||
1361 | 11..19, | 1361 | 11..19, |
1362 | ), | 1362 | ), |
1363 | name: "foo_test", | 1363 | name: "foo_test", |
1364 | kind: FN_DEF, | 1364 | kind: FN, |
1365 | container_name: None, | 1365 | container_name: None, |
1366 | description: None, | 1366 | description: None, |
1367 | docs: None, | 1367 | docs: None, |
diff --git a/crates/ra_ide/src/references.rs b/crates/ra_ide/src/references.rs index fe1c074d1..8d3452a83 100644 --- a/crates/ra_ide/src/references.rs +++ b/crates/ra_ide/src/references.rs | |||
@@ -376,7 +376,7 @@ impl Foo { | |||
376 | } | 376 | } |
377 | "#, | 377 | "#, |
378 | ); | 378 | ); |
379 | check_result(refs, "f FN_DEF FileId(1) 27..43 30..31 Other", &[]); | 379 | check_result(refs, "f FN FileId(1) 27..43 30..31 Other", &[]); |
380 | } | 380 | } |
381 | 381 | ||
382 | #[test] | 382 | #[test] |
@@ -514,7 +514,7 @@ pub(super) struct Foo<|> { | |||
514 | let refs = analysis.find_all_refs(pos, None).unwrap().unwrap(); | 514 | let refs = analysis.find_all_refs(pos, None).unwrap().unwrap(); |
515 | check_result( | 515 | check_result( |
516 | refs, | 516 | refs, |
517 | "quux FN_DEF FileId(1) 19..35 26..30 Other", | 517 | "quux FN FileId(1) 19..35 26..30 Other", |
518 | &["FileId(2) 16..20 StructLiteral", "FileId(3) 16..20 StructLiteral"], | 518 | &["FileId(2) 16..20 StructLiteral", "FileId(3) 16..20 StructLiteral"], |
519 | ); | 519 | ); |
520 | 520 | ||
@@ -522,7 +522,7 @@ pub(super) struct Foo<|> { | |||
522 | analysis.find_all_refs(pos, Some(SearchScope::single_file(bar))).unwrap().unwrap(); | 522 | analysis.find_all_refs(pos, Some(SearchScope::single_file(bar))).unwrap().unwrap(); |
523 | check_result( | 523 | check_result( |
524 | refs, | 524 | refs, |
525 | "quux FN_DEF FileId(1) 19..35 26..30 Other", | 525 | "quux FN FileId(1) 19..35 26..30 Other", |
526 | &["FileId(3) 16..20 StructLiteral"], | 526 | &["FileId(3) 16..20 StructLiteral"], |
527 | ); | 527 | ); |
528 | } | 528 | } |
@@ -619,7 +619,7 @@ fn main() { | |||
619 | ); | 619 | ); |
620 | check_result( | 620 | check_result( |
621 | refs, | 621 | refs, |
622 | "new FN_DEF FileId(1) 54..101 61..64 Other", | 622 | "new FN FileId(1) 54..101 61..64 Other", |
623 | &["FileId(1) 146..149 StructLiteral"], | 623 | &["FileId(1) 146..149 StructLiteral"], |
624 | ); | 624 | ); |
625 | } | 625 | } |
@@ -646,7 +646,7 @@ fn main() { | |||
646 | let refs = analysis.find_all_refs(pos, None).unwrap().unwrap(); | 646 | let refs = analysis.find_all_refs(pos, None).unwrap().unwrap(); |
647 | check_result( | 647 | check_result( |
648 | refs, | 648 | refs, |
649 | "f FN_DEF FileId(1) 26..35 29..30 Other", | 649 | "f FN FileId(1) 26..35 29..30 Other", |
650 | &["FileId(2) 11..12 Other", "FileId(2) 28..29 StructLiteral"], | 650 | &["FileId(2) 11..12 Other", "FileId(2) 28..29 StructLiteral"], |
651 | ); | 651 | ); |
652 | } | 652 | } |
diff --git a/crates/ra_ide/src/references/rename.rs b/crates/ra_ide/src/references/rename.rs index 8735ec53c..d8ffb8c84 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( | |||
149 | let source_file = sema.parse(position.file_id); | 149 | let source_file = sema.parse(position.file_id); |
150 | let syn = source_file.syntax(); | 150 | let syn = source_file.syntax(); |
151 | 151 | ||
152 | let fn_def = find_node_at_offset::<ast::FnDef>(syn, position.offset)?; | 152 | let fn_def = find_node_at_offset::<ast::Fn>(syn, position.offset)?; |
153 | let params = fn_def.param_list()?; | 153 | let params = fn_def.param_list()?; |
154 | if params.self_param().is_some() { | 154 | if params.self_param().is_some() { |
155 | return None; // method already has self param | 155 | return None; // method already has self param |
@@ -221,7 +221,7 @@ fn rename_self_to_param( | |||
221 | let syn = source_file.syntax(); | 221 | let syn = source_file.syntax(); |
222 | 222 | ||
223 | let text = sema.db.file_text(position.file_id); | 223 | let text = sema.db.file_text(position.file_id); |
224 | let fn_def = find_node_at_offset::<ast::FnDef>(syn, position.offset)?; | 224 | let fn_def = find_node_at_offset::<ast::Fn>(syn, position.offset)?; |
225 | let search_range = fn_def.syntax().text_range(); | 225 | let search_range = fn_def.syntax().text_range(); |
226 | 226 | ||
227 | let mut edits: Vec<SourceFileEdit> = vec![]; | 227 | let mut edits: Vec<SourceFileEdit> = vec![]; |
diff --git a/crates/ra_ide/src/runnables.rs b/crates/ra_ide/src/runnables.rs index f612835c2..3b7162b84 100644 --- a/crates/ra_ide/src/runnables.rs +++ b/crates/ra_ide/src/runnables.rs | |||
@@ -102,7 +102,7 @@ pub(crate) fn runnable( | |||
102 | ) -> Option<Runnable> { | 102 | ) -> Option<Runnable> { |
103 | match_ast! { | 103 | match_ast! { |
104 | match item { | 104 | match item { |
105 | ast::FnDef(it) => runnable_fn(sema, it, file_id), | 105 | ast::Fn(it) => runnable_fn(sema, it, file_id), |
106 | ast::Module(it) => runnable_mod(sema, it, file_id), | 106 | ast::Module(it) => runnable_mod(sema, it, file_id), |
107 | _ => None, | 107 | _ => None, |
108 | } | 108 | } |
@@ -111,7 +111,7 @@ pub(crate) fn runnable( | |||
111 | 111 | ||
112 | fn runnable_fn( | 112 | fn runnable_fn( |
113 | sema: &Semantics<RootDatabase>, | 113 | sema: &Semantics<RootDatabase>, |
114 | fn_def: ast::FnDef, | 114 | fn_def: ast::Fn, |
115 | file_id: FileId, | 115 | file_id: FileId, |
116 | ) -> Option<Runnable> { | 116 | ) -> Option<Runnable> { |
117 | let name_string = fn_def.name()?.text().to_string(); | 117 | let name_string = fn_def.name()?.text().to_string(); |
@@ -188,7 +188,7 @@ pub struct TestAttr { | |||
188 | } | 188 | } |
189 | 189 | ||
190 | impl TestAttr { | 190 | impl TestAttr { |
191 | fn from_fn(fn_def: &ast::FnDef) -> TestAttr { | 191 | fn from_fn(fn_def: &ast::Fn) -> TestAttr { |
192 | let ignore = fn_def | 192 | let ignore = fn_def |
193 | .attrs() | 193 | .attrs() |
194 | .filter_map(|attr| attr.simple_name()) | 194 | .filter_map(|attr| attr.simple_name()) |
@@ -203,7 +203,7 @@ impl TestAttr { | |||
203 | /// | 203 | /// |
204 | /// It may produce false positives, for example, `#[wasm_bindgen_test]` requires a different command to run the test, | 204 | /// It may produce false positives, for example, `#[wasm_bindgen_test]` requires a different command to run the test, |
205 | /// but it's better than not to have the runnables for the tests at all. | 205 | /// but it's better than not to have the runnables for the tests at all. |
206 | fn has_test_related_attribute(fn_def: &ast::FnDef) -> bool { | 206 | fn has_test_related_attribute(fn_def: &ast::Fn) -> bool { |
207 | fn_def | 207 | fn_def |
208 | .attrs() | 208 | .attrs() |
209 | .filter_map(|attr| attr.path()) | 209 | .filter_map(|attr| attr.path()) |
@@ -211,7 +211,7 @@ fn has_test_related_attribute(fn_def: &ast::FnDef) -> bool { | |||
211 | .any(|attribute_text| attribute_text.contains("test")) | 211 | .any(|attribute_text| attribute_text.contains("test")) |
212 | } | 212 | } |
213 | 213 | ||
214 | fn has_doc_test(fn_def: &ast::FnDef) -> bool { | 214 | fn has_doc_test(fn_def: &ast::Fn) -> bool { |
215 | fn_def.doc_comment_text().map_or(false, |comment| comment.contains("```")) | 215 | fn_def.doc_comment_text().map_or(false, |comment| comment.contains("```")) |
216 | } | 216 | } |
217 | 217 | ||
@@ -246,7 +246,7 @@ fn has_test_function_or_multiple_test_submodules(module: &ast::Module) -> bool { | |||
246 | 246 | ||
247 | for item in item_list.items() { | 247 | for item in item_list.items() { |
248 | match item { | 248 | match item { |
249 | ast::Item::FnDef(f) => { | 249 | ast::Item::Fn(f) => { |
250 | if has_test_related_attribute(&f) { | 250 | if has_test_related_attribute(&f) { |
251 | return true; | 251 | return true; |
252 | } | 252 | } |
@@ -320,7 +320,7 @@ fn bench() {} | |||
320 | 4..8, | 320 | 4..8, |
321 | ), | 321 | ), |
322 | name: "main", | 322 | name: "main", |
323 | kind: FN_DEF, | 323 | kind: FN, |
324 | container_name: None, | 324 | container_name: None, |
325 | description: None, | 325 | description: None, |
326 | docs: None, | 326 | docs: None, |
@@ -338,7 +338,7 @@ fn bench() {} | |||
338 | 26..34, | 338 | 26..34, |
339 | ), | 339 | ), |
340 | name: "test_foo", | 340 | name: "test_foo", |
341 | kind: FN_DEF, | 341 | kind: FN, |
342 | container_name: None, | 342 | container_name: None, |
343 | description: None, | 343 | description: None, |
344 | docs: None, | 344 | docs: None, |
@@ -363,7 +363,7 @@ fn bench() {} | |||
363 | 62..70, | 363 | 62..70, |
364 | ), | 364 | ), |
365 | name: "test_foo", | 365 | name: "test_foo", |
366 | kind: FN_DEF, | 366 | kind: FN, |
367 | container_name: None, | 367 | container_name: None, |
368 | description: None, | 368 | description: None, |
369 | docs: None, | 369 | docs: None, |
@@ -388,7 +388,7 @@ fn bench() {} | |||
388 | 89..94, | 388 | 89..94, |
389 | ), | 389 | ), |
390 | name: "bench", | 390 | name: "bench", |
391 | kind: FN_DEF, | 391 | kind: FN, |
392 | container_name: None, | 392 | container_name: None, |
393 | description: None, | 393 | description: None, |
394 | docs: None, | 394 | docs: None, |
@@ -431,7 +431,7 @@ fn foo() {} | |||
431 | 4..8, | 431 | 4..8, |
432 | ), | 432 | ), |
433 | name: "main", | 433 | name: "main", |
434 | kind: FN_DEF, | 434 | kind: FN, |
435 | container_name: None, | 435 | container_name: None, |
436 | description: None, | 436 | description: None, |
437 | docs: None, | 437 | docs: None, |
@@ -447,7 +447,7 @@ fn foo() {} | |||
447 | full_range: 15..57, | 447 | full_range: 15..57, |
448 | focus_range: None, | 448 | focus_range: None, |
449 | name: "foo", | 449 | name: "foo", |
450 | kind: FN_DEF, | 450 | kind: FN, |
451 | container_name: None, | 451 | container_name: None, |
452 | description: None, | 452 | description: None, |
453 | docs: None, | 453 | docs: None, |
@@ -493,7 +493,7 @@ impl Data { | |||
493 | 4..8, | 493 | 4..8, |
494 | ), | 494 | ), |
495 | name: "main", | 495 | name: "main", |
496 | kind: FN_DEF, | 496 | kind: FN, |
497 | container_name: None, | 497 | container_name: None, |
498 | description: None, | 498 | description: None, |
499 | docs: None, | 499 | docs: None, |
@@ -509,7 +509,7 @@ impl Data { | |||
509 | full_range: 44..98, | 509 | full_range: 44..98, |
510 | focus_range: None, | 510 | focus_range: None, |
511 | name: "foo", | 511 | name: "foo", |
512 | kind: FN_DEF, | 512 | kind: FN, |
513 | container_name: None, | 513 | container_name: None, |
514 | description: None, | 514 | description: None, |
515 | docs: None, | 515 | docs: None, |
@@ -570,7 +570,7 @@ mod test_mod { | |||
570 | 35..44, | 570 | 35..44, |
571 | ), | 571 | ), |
572 | name: "test_foo1", | 572 | name: "test_foo1", |
573 | kind: FN_DEF, | 573 | kind: FN, |
574 | container_name: None, | 574 | container_name: None, |
575 | description: None, | 575 | description: None, |
576 | docs: None, | 576 | docs: None, |
@@ -670,7 +670,7 @@ mod root_tests { | |||
670 | 107..121, | 670 | 107..121, |
671 | ), | 671 | ), |
672 | name: "nested_test_11", | 672 | name: "nested_test_11", |
673 | kind: FN_DEF, | 673 | kind: FN, |
674 | container_name: None, | 674 | container_name: None, |
675 | description: None, | 675 | description: None, |
676 | docs: None, | 676 | docs: None, |
@@ -695,7 +695,7 @@ mod root_tests { | |||
695 | 163..177, | 695 | 163..177, |
696 | ), | 696 | ), |
697 | name: "nested_test_12", | 697 | name: "nested_test_12", |
698 | kind: FN_DEF, | 698 | kind: FN, |
699 | container_name: None, | 699 | container_name: None, |
700 | description: None, | 700 | description: None, |
701 | docs: None, | 701 | docs: None, |
@@ -740,7 +740,7 @@ mod root_tests { | |||
740 | 258..271, | 740 | 258..271, |
741 | ), | 741 | ), |
742 | name: "nested_test_2", | 742 | name: "nested_test_2", |
743 | kind: FN_DEF, | 743 | kind: FN, |
744 | container_name: None, | 744 | container_name: None, |
745 | description: None, | 745 | description: None, |
746 | docs: None, | 746 | docs: None, |
@@ -783,7 +783,7 @@ fn test_foo1() {} | |||
783 | 36..45, | 783 | 36..45, |
784 | ), | 784 | ), |
785 | name: "test_foo1", | 785 | name: "test_foo1", |
786 | kind: FN_DEF, | 786 | kind: FN, |
787 | container_name: None, | 787 | container_name: None, |
788 | description: None, | 788 | description: None, |
789 | docs: None, | 789 | docs: None, |
@@ -831,7 +831,7 @@ fn test_foo1() {} | |||
831 | 58..67, | 831 | 58..67, |
832 | ), | 832 | ), |
833 | name: "test_foo1", | 833 | name: "test_foo1", |
834 | kind: FN_DEF, | 834 | kind: FN, |
835 | container_name: None, | 835 | container_name: None, |
836 | description: None, | 836 | description: None, |
837 | docs: None, | 837 | docs: None, |
diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs index d456d5d36..8d52fb6e4 100644 --- a/crates/ra_ide/src/syntax_highlighting.rs +++ b/crates/ra_ide/src/syntax_highlighting.rs | |||
@@ -464,7 +464,7 @@ fn highlight_element( | |||
464 | let db = sema.db; | 464 | let db = sema.db; |
465 | let mut binding_hash = None; | 465 | let mut binding_hash = None; |
466 | let highlight: Highlight = match element.kind() { | 466 | let highlight: Highlight = match element.kind() { |
467 | FN_DEF => { | 467 | FN => { |
468 | bindings_shadow_count.clear(); | 468 | bindings_shadow_count.clear(); |
469 | return None; | 469 | return None; |
470 | } | 470 | } |
@@ -709,11 +709,11 @@ fn highlight_name_by_syntax(name: ast::Name) -> Highlight { | |||
709 | ENUM_DEF => HighlightTag::Enum, | 709 | ENUM_DEF => HighlightTag::Enum, |
710 | UNION_DEF => HighlightTag::Union, | 710 | UNION_DEF => HighlightTag::Union, |
711 | TRAIT_DEF => HighlightTag::Trait, | 711 | TRAIT_DEF => HighlightTag::Trait, |
712 | TYPE_ALIAS_DEF => HighlightTag::TypeAlias, | 712 | TYPE_ALIAS => HighlightTag::TypeAlias, |
713 | TYPE_PARAM => HighlightTag::TypeParam, | 713 | TYPE_PARAM => HighlightTag::TypeParam, |
714 | RECORD_FIELD_DEF => HighlightTag::Field, | 714 | RECORD_FIELD_DEF => HighlightTag::Field, |
715 | MODULE => HighlightTag::Module, | 715 | MODULE => HighlightTag::Module, |
716 | FN_DEF => HighlightTag::Function, | 716 | FN => HighlightTag::Function, |
717 | CONST_DEF => HighlightTag::Constant, | 717 | CONST_DEF => HighlightTag::Constant, |
718 | STATIC_DEF => HighlightTag::Static, | 718 | STATIC_DEF => HighlightTag::Static, |
719 | ENUM_VARIANT => HighlightTag::EnumVariant, | 719 | ENUM_VARIANT => HighlightTag::EnumVariant, |
diff --git a/crates/ra_ide/src/syntax_tree.rs b/crates/ra_ide/src/syntax_tree.rs index f716a3861..07217e808 100644 --- a/crates/ra_ide/src/syntax_tree.rs +++ b/crates/ra_ide/src/syntax_tree.rs | |||
@@ -116,7 +116,7 @@ mod tests { | |||
116 | syn.trim(), | 116 | syn.trim(), |
117 | r#" | 117 | r#" |
118 | SOURCE_FILE@0..11 | 118 | SOURCE_FILE@0..11 |
119 | FN_DEF@0..11 | 119 | FN@0..11 |
120 | FN_KW@0..2 "fn" | 120 | FN_KW@0..2 "fn" |
121 | WHITESPACE@2..3 " " | 121 | WHITESPACE@2..3 " " |
122 | NAME@3..6 | 122 | NAME@3..6 |
@@ -148,7 +148,7 @@ fn test() { | |||
148 | syn.trim(), | 148 | syn.trim(), |
149 | r#" | 149 | r#" |
150 | SOURCE_FILE@0..60 | 150 | SOURCE_FILE@0..60 |
151 | FN_DEF@0..60 | 151 | FN@0..60 |
152 | FN_KW@0..2 "fn" | 152 | FN_KW@0..2 "fn" |
153 | WHITESPACE@2..3 " " | 153 | WHITESPACE@2..3 " " |
154 | NAME@3..7 | 154 | NAME@3..7 |
@@ -190,7 +190,7 @@ SOURCE_FILE@0..60 | |||
190 | assert_eq_text!( | 190 | assert_eq_text!( |
191 | syn.trim(), | 191 | syn.trim(), |
192 | r#" | 192 | r#" |
193 | FN_DEF@0..11 | 193 | FN@0..11 |
194 | FN_KW@0..2 "fn" | 194 | FN_KW@0..2 "fn" |
195 | WHITESPACE@2..3 " " | 195 | WHITESPACE@2..3 " " |
196 | NAME@3..6 | 196 | NAME@3..6 |
@@ -258,7 +258,7 @@ fn bar() { | |||
258 | syn.trim(), | 258 | syn.trim(), |
259 | r#" | 259 | r#" |
260 | SOURCE_FILE@0..12 | 260 | SOURCE_FILE@0..12 |
261 | FN_DEF@0..12 | 261 | FN@0..12 |
262 | FN_KW@0..2 "fn" | 262 | FN_KW@0..2 "fn" |
263 | WHITESPACE@2..3 " " | 263 | WHITESPACE@2..3 " " |
264 | NAME@3..6 | 264 | NAME@3..6 |
@@ -292,7 +292,7 @@ fn bar() { | |||
292 | syn.trim(), | 292 | syn.trim(), |
293 | r#" | 293 | r#" |
294 | SOURCE_FILE@0..12 | 294 | SOURCE_FILE@0..12 |
295 | FN_DEF@0..12 | 295 | FN@0..12 |
296 | FN_KW@0..2 "fn" | 296 | FN_KW@0..2 "fn" |
297 | WHITESPACE@2..3 " " | 297 | WHITESPACE@2..3 " " |
298 | NAME@3..6 | 298 | NAME@3..6 |
@@ -325,7 +325,7 @@ fn bar() { | |||
325 | syn.trim(), | 325 | syn.trim(), |
326 | r#" | 326 | r#" |
327 | SOURCE_FILE@0..25 | 327 | SOURCE_FILE@0..25 |
328 | FN_DEF@0..12 | 328 | FN@0..12 |
329 | FN_KW@0..2 "fn" | 329 | FN_KW@0..2 "fn" |
330 | WHITESPACE@2..3 " " | 330 | WHITESPACE@2..3 " " |
331 | NAME@3..6 | 331 | NAME@3..6 |
@@ -339,7 +339,7 @@ SOURCE_FILE@0..25 | |||
339 | WHITESPACE@10..11 "\n" | 339 | WHITESPACE@10..11 "\n" |
340 | R_CURLY@11..12 "}" | 340 | R_CURLY@11..12 "}" |
341 | WHITESPACE@12..13 "\n" | 341 | WHITESPACE@12..13 "\n" |
342 | FN_DEF@13..25 | 342 | FN@13..25 |
343 | FN_KW@13..15 "fn" | 343 | FN_KW@13..15 "fn" |
344 | WHITESPACE@15..16 " " | 344 | WHITESPACE@15..16 " " |
345 | NAME@16..19 | 345 | NAME@16..19 |
diff --git a/crates/ra_ide_db/src/defs.rs b/crates/ra_ide_db/src/defs.rs index 1464c5f2a..0e73a8932 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<RootDatabase>, name: &ast::Name) -> Option | |||
174 | let def: hir::EnumVariant = sema.to_def(&it)?; | 174 | let def: hir::EnumVariant = sema.to_def(&it)?; |
175 | Some(NameClass::Definition(Definition::ModuleDef(def.into()))) | 175 | Some(NameClass::Definition(Definition::ModuleDef(def.into()))) |
176 | }, | 176 | }, |
177 | ast::FnDef(it) => { | 177 | ast::Fn(it) => { |
178 | let def: hir::Function = sema.to_def(&it)?; | 178 | let def: hir::Function = sema.to_def(&it)?; |
179 | Some(NameClass::Definition(Definition::ModuleDef(def.into()))) | 179 | Some(NameClass::Definition(Definition::ModuleDef(def.into()))) |
180 | }, | 180 | }, |
@@ -182,7 +182,7 @@ pub fn classify_name(sema: &Semantics<RootDatabase>, name: &ast::Name) -> Option | |||
182 | let def: hir::Const = sema.to_def(&it)?; | 182 | let def: hir::Const = sema.to_def(&it)?; |
183 | Some(NameClass::Definition(Definition::ModuleDef(def.into()))) | 183 | Some(NameClass::Definition(Definition::ModuleDef(def.into()))) |
184 | }, | 184 | }, |
185 | ast::TypeAliasDef(it) => { | 185 | ast::TypeAlias(it) => { |
186 | let def: hir::TypeAlias = sema.to_def(&it)?; | 186 | let def: hir::TypeAlias = sema.to_def(&it)?; |
187 | Some(NameClass::Definition(Definition::ModuleDef(def.into()))) | 187 | Some(NameClass::Definition(Definition::ModuleDef(def.into()))) |
188 | }, | 188 | }, |
diff --git a/crates/ra_ide_db/src/symbol_index.rs b/crates/ra_ide_db/src/symbol_index.rs index 131e2a128..b4e85b88e 100644 --- a/crates/ra_ide_db/src/symbol_index.rs +++ b/crates/ra_ide_db/src/symbol_index.rs | |||
@@ -344,7 +344,7 @@ impl Query { | |||
344 | } | 344 | } |
345 | 345 | ||
346 | fn is_type(kind: SyntaxKind) -> bool { | 346 | fn is_type(kind: SyntaxKind) -> bool { |
347 | matches!(kind, STRUCT_DEF | ENUM_DEF | TRAIT_DEF | TYPE_ALIAS_DEF) | 347 | matches!(kind, STRUCT_DEF | ENUM_DEF | TRAIT_DEF | TYPE_ALIAS) |
348 | } | 348 | } |
349 | 349 | ||
350 | /// The actual data that is stored in the index. It should be as compact as | 350 | /// The actual data that is stored in the index. It should be as compact as |
@@ -397,12 +397,12 @@ fn to_symbol(node: &SyntaxNode) -> Option<(SmolStr, SyntaxNodePtr, TextRange)> { | |||
397 | } | 397 | } |
398 | match_ast! { | 398 | match_ast! { |
399 | match node { | 399 | match node { |
400 | ast::FnDef(it) => decl(it), | 400 | ast::Fn(it) => decl(it), |
401 | ast::StructDef(it) => decl(it), | 401 | ast::StructDef(it) => decl(it), |
402 | ast::EnumDef(it) => decl(it), | 402 | ast::EnumDef(it) => decl(it), |
403 | ast::TraitDef(it) => decl(it), | 403 | ast::TraitDef(it) => decl(it), |
404 | ast::Module(it) => decl(it), | 404 | ast::Module(it) => decl(it), |
405 | ast::TypeAliasDef(it) => decl(it), | 405 | ast::TypeAlias(it) => decl(it), |
406 | ast::ConstDef(it) => decl(it), | 406 | ast::ConstDef(it) => decl(it), |
407 | ast::StaticDef(it) => decl(it), | 407 | ast::StaticDef(it) => decl(it), |
408 | ast::MacroCall(it) => { | 408 | ast::MacroCall(it) => { |
diff --git a/crates/ra_mbe/src/tests.rs b/crates/ra_mbe/src/tests.rs index c43003fd6..220690cdd 100644 --- a/crates/ra_mbe/src/tests.rs +++ b/crates/ra_mbe/src/tests.rs | |||
@@ -258,7 +258,7 @@ fn test_expr_order() { | |||
258 | assert_eq_text!( | 258 | assert_eq_text!( |
259 | dump.trim(), | 259 | dump.trim(), |
260 | r#"MACRO_ITEMS@0..15 | 260 | r#"MACRO_ITEMS@0..15 |
261 | FN_DEF@0..15 | 261 | FN@0..15 |
262 | FN_KW@0..2 "fn" | 262 | FN_KW@0..2 "fn" |
263 | NAME@2..5 | 263 | NAME@2..5 |
264 | IDENT@2..5 "bar" | 264 | IDENT@2..5 "bar" |
diff --git a/crates/ra_parser/src/grammar/items.rs b/crates/ra_parser/src/grammar/items.rs index 3b73e5346..664b23f6a 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 | |||
180 | // unsafe const fn bar() {} | 180 | // unsafe const fn bar() {} |
181 | T![fn] => { | 181 | T![fn] => { |
182 | fn_def(p); | 182 | fn_def(p); |
183 | m.complete(p, FN_DEF); | 183 | m.complete(p, FN); |
184 | } | 184 | } |
185 | 185 | ||
186 | // test unsafe_trait | 186 | // test unsafe_trait |
@@ -380,7 +380,7 @@ fn type_def(p: &mut Parser, m: Marker) { | |||
380 | types::type_(p); | 380 | types::type_(p); |
381 | } | 381 | } |
382 | p.expect(T![;]); | 382 | p.expect(T![;]); |
383 | m.complete(p, TYPE_ALIAS_DEF); | 383 | m.complete(p, TYPE_ALIAS); |
384 | } | 384 | } |
385 | 385 | ||
386 | pub(crate) fn mod_item(p: &mut Parser, m: Marker) { | 386 | pub(crate) fn mod_item(p: &mut Parser, m: Marker) { |
diff --git a/crates/ra_parser/src/syntax_kind/generated.rs b/crates/ra_parser/src/syntax_kind/generated.rs index 4f35e0baa..b84c3fc79 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 { | |||
126 | STRUCT_DEF, | 126 | STRUCT_DEF, |
127 | UNION_DEF, | 127 | UNION_DEF, |
128 | ENUM_DEF, | 128 | ENUM_DEF, |
129 | FN_DEF, | 129 | FN, |
130 | RET_TYPE, | 130 | RET_TYPE, |
131 | EXTERN_CRATE, | 131 | EXTERN_CRATE, |
132 | MODULE, | 132 | MODULE, |
@@ -135,7 +135,7 @@ pub enum SyntaxKind { | |||
135 | CONST_DEF, | 135 | CONST_DEF, |
136 | TRAIT_DEF, | 136 | TRAIT_DEF, |
137 | IMPL_DEF, | 137 | IMPL_DEF, |
138 | TYPE_ALIAS_DEF, | 138 | TYPE_ALIAS, |
139 | MACRO_CALL, | 139 | MACRO_CALL, |
140 | TOKEN_TREE, | 140 | TOKEN_TREE, |
141 | MACRO_DEF, | 141 | MACRO_DEF, |
diff --git a/crates/ra_syntax/src/ast/edit.rs b/crates/ra_syntax/src/ast/edit.rs index 6ebe10ff6..0110300af 100644 --- a/crates/ra_syntax/src/ast/edit.rs +++ b/crates/ra_syntax/src/ast/edit.rs | |||
@@ -29,9 +29,9 @@ impl ast::BinExpr { | |||
29 | } | 29 | } |
30 | } | 30 | } |
31 | 31 | ||
32 | impl ast::FnDef { | 32 | impl ast::Fn { |
33 | #[must_use] | 33 | #[must_use] |
34 | pub fn with_body(&self, body: ast::BlockExpr) -> ast::FnDef { | 34 | pub fn with_body(&self, body: ast::BlockExpr) -> ast::Fn { |
35 | let mut to_insert: ArrayVec<[SyntaxElement; 2]> = ArrayVec::new(); | 35 | let mut to_insert: ArrayVec<[SyntaxElement; 2]> = ArrayVec::new(); |
36 | let old_body_or_semi: SyntaxElement = if let Some(old_body) = self.body() { | 36 | let old_body_or_semi: SyntaxElement = if let Some(old_body) = self.body() { |
37 | old_body.syntax().clone().into() | 37 | old_body.syntax().clone().into() |
@@ -192,9 +192,9 @@ impl ast::RecordFieldList { | |||
192 | } | 192 | } |
193 | } | 193 | } |
194 | 194 | ||
195 | impl ast::TypeAliasDef { | 195 | impl ast::TypeAlias { |
196 | #[must_use] | 196 | #[must_use] |
197 | pub fn remove_bounds(&self) -> ast::TypeAliasDef { | 197 | pub fn remove_bounds(&self) -> ast::TypeAlias { |
198 | let colon = match self.colon_token() { | 198 | let colon = match self.colon_token() { |
199 | Some(it) => it, | 199 | Some(it) => it, |
200 | None => return self.clone(), | 200 | None => return self.clone(), |
diff --git a/crates/ra_syntax/src/ast/expr_ext.rs b/crates/ra_syntax/src/ast/expr_ext.rs index 69c85c809..8692b9bb5 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 { | |||
401 | Some(it) => it, | 401 | Some(it) => it, |
402 | None => return true, | 402 | None => return true, |
403 | }; | 403 | }; |
404 | !matches!(parent.kind(), FN_DEF | IF_EXPR | WHILE_EXPR | LOOP_EXPR | EFFECT_EXPR) | 404 | !matches!(parent.kind(), FN | IF_EXPR | WHILE_EXPR | LOOP_EXPR | EFFECT_EXPR) |
405 | } | 405 | } |
406 | } | 406 | } |
407 | 407 | ||
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index be657699f..ad8ccf1ce 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 { | |||
79 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } | 79 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
80 | } | 80 | } |
81 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 81 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
82 | pub struct FnDef { | 82 | pub struct Fn { |
83 | pub(crate) syntax: SyntaxNode, | 83 | pub(crate) syntax: SyntaxNode, |
84 | } | 84 | } |
85 | impl ast::AttrsOwner for FnDef {} | 85 | impl ast::AttrsOwner for Fn {} |
86 | impl ast::NameOwner for FnDef {} | 86 | impl ast::NameOwner for Fn {} |
87 | impl ast::VisibilityOwner for FnDef {} | 87 | impl ast::VisibilityOwner for Fn {} |
88 | impl ast::TypeParamsOwner for FnDef {} | 88 | impl ast::TypeParamsOwner for Fn {} |
89 | impl FnDef { | 89 | impl Fn { |
90 | pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) } | ||
91 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } | ||
92 | pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } | 90 | pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } |
93 | pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) } | 91 | pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) } |
92 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } | ||
94 | pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } | 93 | pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } |
94 | pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) } | ||
95 | pub fn fn_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![fn]) } | 95 | pub fn fn_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![fn]) } |
96 | pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) } | 96 | pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) } |
97 | pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) } | 97 | pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) } |
@@ -183,15 +183,15 @@ impl TraitDef { | |||
183 | pub fn assoc_item_list(&self) -> Option<AssocItemList> { support::child(&self.syntax) } | 183 | pub fn assoc_item_list(&self) -> Option<AssocItemList> { support::child(&self.syntax) } |
184 | } | 184 | } |
185 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 185 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
186 | pub struct TypeAliasDef { | 186 | pub struct TypeAlias { |
187 | pub(crate) syntax: SyntaxNode, | 187 | pub(crate) syntax: SyntaxNode, |
188 | } | 188 | } |
189 | impl ast::AttrsOwner for TypeAliasDef {} | 189 | impl ast::AttrsOwner for TypeAlias {} |
190 | impl ast::NameOwner for TypeAliasDef {} | 190 | impl ast::NameOwner for TypeAlias {} |
191 | impl ast::VisibilityOwner for TypeAliasDef {} | 191 | impl ast::VisibilityOwner for TypeAlias {} |
192 | impl ast::TypeParamsOwner for TypeAliasDef {} | 192 | impl ast::TypeParamsOwner for TypeAlias {} |
193 | impl ast::TypeBoundsOwner for TypeAliasDef {} | 193 | impl ast::TypeBoundsOwner for TypeAlias {} |
194 | impl TypeAliasDef { | 194 | impl TypeAlias { |
195 | pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } | 195 | pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } |
196 | pub fn type_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![type]) } | 196 | pub fn type_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![type]) } |
197 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } | 197 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
@@ -303,7 +303,9 @@ impl UseTreeList { | |||
303 | pub struct Abi { | 303 | pub struct Abi { |
304 | pub(crate) syntax: SyntaxNode, | 304 | pub(crate) syntax: SyntaxNode, |
305 | } | 305 | } |
306 | impl Abi {} | 306 | impl Abi { |
307 | pub fn extern_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![extern]) } | ||
308 | } | ||
307 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 309 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
308 | pub struct TypeParamList { | 310 | pub struct TypeParamList { |
309 | pub(crate) syntax: SyntaxNode, | 311 | pub(crate) syntax: SyntaxNode, |
@@ -321,8 +323,9 @@ pub struct ParamList { | |||
321 | } | 323 | } |
322 | impl ParamList { | 324 | impl ParamList { |
323 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) } | 325 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) } |
324 | pub fn self_param(&self) -> Option<SelfParam> { support::child(&self.syntax) } | ||
325 | pub fn params(&self) -> AstChildren<Param> { support::children(&self.syntax) } | 326 | pub fn params(&self) -> AstChildren<Param> { support::children(&self.syntax) } |
327 | pub fn self_param(&self) -> Option<SelfParam> { support::child(&self.syntax) } | ||
328 | pub fn comma_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![,]) } | ||
326 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } | 329 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } |
327 | } | 330 | } |
328 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 331 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
@@ -355,6 +358,39 @@ impl BlockExpr { | |||
355 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } | 358 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } |
356 | } | 359 | } |
357 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 360 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
361 | pub struct Param { | ||
362 | pub(crate) syntax: SyntaxNode, | ||
363 | } | ||
364 | impl ast::AttrsOwner for Param {} | ||
365 | impl ast::TypeAscriptionOwner for Param {} | ||
366 | impl Param { | ||
367 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } | ||
368 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } | ||
369 | pub fn dotdotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![...]) } | ||
370 | } | ||
371 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
372 | pub struct SelfParam { | ||
373 | pub(crate) syntax: SyntaxNode, | ||
374 | } | ||
375 | impl ast::AttrsOwner for SelfParam {} | ||
376 | impl ast::TypeAscriptionOwner for SelfParam {} | ||
377 | impl SelfParam { | ||
378 | pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) } | ||
379 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { | ||
380 | support::token(&self.syntax, T![lifetime]) | ||
381 | } | ||
382 | pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) } | ||
383 | pub fn self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![self]) } | ||
384 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } | ||
385 | } | ||
386 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
387 | pub struct TypeBoundList { | ||
388 | pub(crate) syntax: SyntaxNode, | ||
389 | } | ||
390 | impl TypeBoundList { | ||
391 | pub fn bounds(&self) -> AstChildren<TypeBound> { support::children(&self.syntax) } | ||
392 | } | ||
393 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
358 | pub struct RecordFieldDefList { | 394 | pub struct RecordFieldDefList { |
359 | pub(crate) syntax: SyntaxNode, | 395 | pub(crate) syntax: SyntaxNode, |
360 | } | 396 | } |
@@ -415,13 +451,6 @@ impl EnumVariant { | |||
415 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 451 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
416 | } | 452 | } |
417 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 453 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
418 | pub struct TypeBoundList { | ||
419 | pub(crate) syntax: SyntaxNode, | ||
420 | } | ||
421 | impl TypeBoundList { | ||
422 | pub fn bounds(&self) -> AstChildren<TypeBound> { support::children(&self.syntax) } | ||
423 | } | ||
424 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
425 | pub struct AssocItemList { | 454 | pub struct AssocItemList { |
426 | pub(crate) syntax: SyntaxNode, | 455 | pub(crate) syntax: SyntaxNode, |
427 | } | 456 | } |
@@ -1173,32 +1202,6 @@ impl LetStmt { | |||
1173 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } | 1202 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
1174 | } | 1203 | } |
1175 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1204 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1176 | pub struct SelfParam { | ||
1177 | pub(crate) syntax: SyntaxNode, | ||
1178 | } | ||
1179 | impl ast::AttrsOwner for SelfParam {} | ||
1180 | impl ast::TypeAscriptionOwner for SelfParam {} | ||
1181 | impl SelfParam { | ||
1182 | pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) } | ||
1183 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { | ||
1184 | support::token(&self.syntax, T![lifetime]) | ||
1185 | } | ||
1186 | pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) } | ||
1187 | pub fn self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![self]) } | ||
1188 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } | ||
1189 | } | ||
1190 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1191 | pub struct Param { | ||
1192 | pub(crate) syntax: SyntaxNode, | ||
1193 | } | ||
1194 | impl ast::AttrsOwner for Param {} | ||
1195 | impl ast::TypeAscriptionOwner for Param {} | ||
1196 | impl Param { | ||
1197 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } | ||
1198 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } | ||
1199 | pub fn dotdotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![...]) } | ||
1200 | } | ||
1201 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1202 | pub struct PathSegment { | 1205 | pub struct PathSegment { |
1203 | pub(crate) syntax: SyntaxNode, | 1206 | pub(crate) syntax: SyntaxNode, |
1204 | } | 1207 | } |
@@ -1274,14 +1277,14 @@ pub enum Item { | |||
1274 | EnumDef(EnumDef), | 1277 | EnumDef(EnumDef), |
1275 | ExternBlock(ExternBlock), | 1278 | ExternBlock(ExternBlock), |
1276 | ExternCrate(ExternCrate), | 1279 | ExternCrate(ExternCrate), |
1277 | FnDef(FnDef), | 1280 | Fn(Fn), |
1278 | ImplDef(ImplDef), | 1281 | ImplDef(ImplDef), |
1279 | MacroCall(MacroCall), | 1282 | MacroCall(MacroCall), |
1280 | Module(Module), | 1283 | Module(Module), |
1281 | StaticDef(StaticDef), | 1284 | StaticDef(StaticDef), |
1282 | StructDef(StructDef), | 1285 | StructDef(StructDef), |
1283 | TraitDef(TraitDef), | 1286 | TraitDef(TraitDef), |
1284 | TypeAliasDef(TypeAliasDef), | 1287 | TypeAlias(TypeAlias), |
1285 | UnionDef(UnionDef), | 1288 | UnionDef(UnionDef), |
1286 | Use(Use), | 1289 | Use(Use), |
1287 | } | 1290 | } |
@@ -1303,6 +1306,24 @@ pub enum TypeRef { | |||
1303 | DynTraitType(DynTraitType), | 1306 | DynTraitType(DynTraitType), |
1304 | } | 1307 | } |
1305 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1308 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1309 | pub enum Pat { | ||
1310 | OrPat(OrPat), | ||
1311 | ParenPat(ParenPat), | ||
1312 | RefPat(RefPat), | ||
1313 | BoxPat(BoxPat), | ||
1314 | BindPat(BindPat), | ||
1315 | PlaceholderPat(PlaceholderPat), | ||
1316 | DotDotPat(DotDotPat), | ||
1317 | PathPat(PathPat), | ||
1318 | RecordPat(RecordPat), | ||
1319 | TupleStructPat(TupleStructPat), | ||
1320 | TuplePat(TuplePat), | ||
1321 | SlicePat(SlicePat), | ||
1322 | RangePat(RangePat), | ||
1323 | LiteralPat(LiteralPat), | ||
1324 | MacroPat(MacroPat), | ||
1325 | } | ||
1326 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1306 | pub enum FieldDefList { | 1327 | pub enum FieldDefList { |
1307 | RecordFieldDefList(RecordFieldDefList), | 1328 | RecordFieldDefList(RecordFieldDefList), |
1308 | TupleFieldDefList(TupleFieldDefList), | 1329 | TupleFieldDefList(TupleFieldDefList), |
@@ -1343,32 +1364,14 @@ pub enum Expr { | |||
1343 | } | 1364 | } |
1344 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1365 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1345 | pub enum AssocItem { | 1366 | pub enum AssocItem { |
1346 | FnDef(FnDef), | 1367 | Fn(Fn), |
1347 | TypeAliasDef(TypeAliasDef), | 1368 | TypeAlias(TypeAlias), |
1348 | ConstDef(ConstDef), | 1369 | ConstDef(ConstDef), |
1349 | MacroCall(MacroCall), | 1370 | MacroCall(MacroCall), |
1350 | } | 1371 | } |
1351 | impl ast::AttrsOwner for AssocItem {} | 1372 | impl ast::AttrsOwner for AssocItem {} |
1352 | impl ast::NameOwner for AssocItem {} | 1373 | impl ast::NameOwner for AssocItem {} |
1353 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1374 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1354 | pub enum Pat { | ||
1355 | OrPat(OrPat), | ||
1356 | ParenPat(ParenPat), | ||
1357 | RefPat(RefPat), | ||
1358 | BoxPat(BoxPat), | ||
1359 | BindPat(BindPat), | ||
1360 | PlaceholderPat(PlaceholderPat), | ||
1361 | DotDotPat(DotDotPat), | ||
1362 | PathPat(PathPat), | ||
1363 | RecordPat(RecordPat), | ||
1364 | TupleStructPat(TupleStructPat), | ||
1365 | TuplePat(TuplePat), | ||
1366 | SlicePat(SlicePat), | ||
1367 | RangePat(RangePat), | ||
1368 | LiteralPat(LiteralPat), | ||
1369 | MacroPat(MacroPat), | ||
1370 | } | ||
1371 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1372 | pub enum Stmt { | 1375 | pub enum Stmt { |
1373 | LetStmt(LetStmt), | 1376 | LetStmt(LetStmt), |
1374 | ExprStmt(ExprStmt), | 1377 | ExprStmt(ExprStmt), |
@@ -1381,7 +1384,7 @@ pub enum AttrInput { | |||
1381 | } | 1384 | } |
1382 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1385 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1383 | pub enum ExternItem { | 1386 | pub enum ExternItem { |
1384 | FnDef(FnDef), | 1387 | Fn(Fn), |
1385 | StaticDef(StaticDef), | 1388 | StaticDef(StaticDef), |
1386 | } | 1389 | } |
1387 | impl ast::AttrsOwner for ExternItem {} | 1390 | impl ast::AttrsOwner for ExternItem {} |
@@ -1463,8 +1466,8 @@ impl AstNode for ExternCrate { | |||
1463 | } | 1466 | } |
1464 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1467 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1465 | } | 1468 | } |
1466 | impl AstNode for FnDef { | 1469 | impl AstNode for Fn { |
1467 | fn can_cast(kind: SyntaxKind) -> bool { kind == FN_DEF } | 1470 | fn can_cast(kind: SyntaxKind) -> bool { kind == FN } |
1468 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1471 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1469 | if Self::can_cast(syntax.kind()) { | 1472 | if Self::can_cast(syntax.kind()) { |
1470 | Some(Self { syntax }) | 1473 | Some(Self { syntax }) |
@@ -1540,8 +1543,8 @@ impl AstNode for TraitDef { | |||
1540 | } | 1543 | } |
1541 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1544 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1542 | } | 1545 | } |
1543 | impl AstNode for TypeAliasDef { | 1546 | impl AstNode for TypeAlias { |
1544 | fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_ALIAS_DEF } | 1547 | fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_ALIAS } |
1545 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1548 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1546 | if Self::can_cast(syntax.kind()) { | 1549 | if Self::can_cast(syntax.kind()) { |
1547 | Some(Self { syntax }) | 1550 | Some(Self { syntax }) |
@@ -1727,6 +1730,39 @@ impl AstNode for BlockExpr { | |||
1727 | } | 1730 | } |
1728 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1731 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1729 | } | 1732 | } |
1733 | impl AstNode for Param { | ||
1734 | fn can_cast(kind: SyntaxKind) -> bool { kind == PARAM } | ||
1735 | fn cast(syntax: SyntaxNode) -> Option<Self> { | ||
1736 | if Self::can_cast(syntax.kind()) { | ||
1737 | Some(Self { syntax }) | ||
1738 | } else { | ||
1739 | None | ||
1740 | } | ||
1741 | } | ||
1742 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | ||
1743 | } | ||
1744 | impl AstNode for SelfParam { | ||
1745 | fn can_cast(kind: SyntaxKind) -> bool { kind == SELF_PARAM } | ||
1746 | fn cast(syntax: SyntaxNode) -> Option<Self> { | ||
1747 | if Self::can_cast(syntax.kind()) { | ||
1748 | Some(Self { syntax }) | ||
1749 | } else { | ||
1750 | None | ||
1751 | } | ||
1752 | } | ||
1753 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | ||
1754 | } | ||
1755 | impl AstNode for TypeBoundList { | ||
1756 | fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_BOUND_LIST } | ||
1757 | fn cast(syntax: SyntaxNode) -> Option<Self> { | ||
1758 | if Self::can_cast(syntax.kind()) { | ||
1759 | Some(Self { syntax }) | ||
1760 | } else { | ||
1761 | None | ||
1762 | } | ||
1763 | } | ||
1764 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | ||
1765 | } | ||
1730 | impl AstNode for RecordFieldDefList { | 1766 | impl AstNode for RecordFieldDefList { |
1731 | fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_FIELD_DEF_LIST } | 1767 | fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_FIELD_DEF_LIST } |
1732 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1768 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
@@ -1793,17 +1829,6 @@ impl AstNode for EnumVariant { | |||
1793 | } | 1829 | } |
1794 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1830 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1795 | } | 1831 | } |
1796 | impl AstNode for TypeBoundList { | ||
1797 | fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_BOUND_LIST } | ||
1798 | fn cast(syntax: SyntaxNode) -> Option<Self> { | ||
1799 | if Self::can_cast(syntax.kind()) { | ||
1800 | Some(Self { syntax }) | ||
1801 | } else { | ||
1802 | None | ||
1803 | } | ||
1804 | } | ||
1805 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | ||
1806 | } | ||
1807 | impl AstNode for AssocItemList { | 1832 | impl AstNode for AssocItemList { |
1808 | fn can_cast(kind: SyntaxKind) -> bool { kind == ASSOC_ITEM_LIST } | 1833 | fn can_cast(kind: SyntaxKind) -> bool { kind == ASSOC_ITEM_LIST } |
1809 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1834 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
@@ -2673,28 +2698,6 @@ impl AstNode for LetStmt { | |||
2673 | } | 2698 | } |
2674 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2699 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2675 | } | 2700 | } |
2676 | impl AstNode for SelfParam { | ||
2677 | fn can_cast(kind: SyntaxKind) -> bool { kind == SELF_PARAM } | ||
2678 | fn cast(syntax: SyntaxNode) -> Option<Self> { | ||
2679 | if Self::can_cast(syntax.kind()) { | ||
2680 | Some(Self { syntax }) | ||
2681 | } else { | ||
2682 | None | ||
2683 | } | ||
2684 | } | ||
2685 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | ||
2686 | } | ||
2687 | impl AstNode for Param { | ||
2688 | fn can_cast(kind: SyntaxKind) -> bool { kind == PARAM } | ||
2689 | fn cast(syntax: SyntaxNode) -> Option<Self> { | ||
2690 | if Self::can_cast(syntax.kind()) { | ||
2691 | Some(Self { syntax }) | ||
2692 | } else { | ||
2693 | None | ||
2694 | } | ||
2695 | } | ||
2696 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | ||
2697 | } | ||
2698 | impl AstNode for PathSegment { | 2701 | impl AstNode for PathSegment { |
2699 | fn can_cast(kind: SyntaxKind) -> bool { kind == PATH_SEGMENT } | 2702 | fn can_cast(kind: SyntaxKind) -> bool { kind == PATH_SEGMENT } |
2700 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 2703 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
@@ -2784,8 +2787,8 @@ impl From<ExternBlock> for Item { | |||
2784 | impl From<ExternCrate> for Item { | 2787 | impl From<ExternCrate> for Item { |
2785 | fn from(node: ExternCrate) -> Item { Item::ExternCrate(node) } | 2788 | fn from(node: ExternCrate) -> Item { Item::ExternCrate(node) } |
2786 | } | 2789 | } |
2787 | impl From<FnDef> for Item { | 2790 | impl From<Fn> for Item { |
2788 | fn from(node: FnDef) -> Item { Item::FnDef(node) } | 2791 | fn from(node: Fn) -> Item { Item::Fn(node) } |
2789 | } | 2792 | } |
2790 | impl From<ImplDef> for Item { | 2793 | impl From<ImplDef> for Item { |
2791 | fn from(node: ImplDef) -> Item { Item::ImplDef(node) } | 2794 | fn from(node: ImplDef) -> Item { Item::ImplDef(node) } |
@@ -2805,8 +2808,8 @@ impl From<StructDef> for Item { | |||
2805 | impl From<TraitDef> for Item { | 2808 | impl From<TraitDef> for Item { |
2806 | fn from(node: TraitDef) -> Item { Item::TraitDef(node) } | 2809 | fn from(node: TraitDef) -> Item { Item::TraitDef(node) } |
2807 | } | 2810 | } |
2808 | impl From<TypeAliasDef> for Item { | 2811 | impl From<TypeAlias> for Item { |
2809 | fn from(node: TypeAliasDef) -> Item { Item::TypeAliasDef(node) } | 2812 | fn from(node: TypeAlias) -> Item { Item::TypeAlias(node) } |
2810 | } | 2813 | } |
2811 | impl From<UnionDef> for Item { | 2814 | impl From<UnionDef> for Item { |
2812 | fn from(node: UnionDef) -> Item { Item::UnionDef(node) } | 2815 | fn from(node: UnionDef) -> Item { Item::UnionDef(node) } |
@@ -2817,10 +2820,8 @@ impl From<Use> for Item { | |||
2817 | impl AstNode for Item { | 2820 | impl AstNode for Item { |
2818 | fn can_cast(kind: SyntaxKind) -> bool { | 2821 | fn can_cast(kind: SyntaxKind) -> bool { |
2819 | match kind { | 2822 | match kind { |
2820 | CONST_DEF | ENUM_DEF | EXTERN_BLOCK | EXTERN_CRATE | FN_DEF | IMPL_DEF | MACRO_CALL | 2823 | CONST_DEF | ENUM_DEF | EXTERN_BLOCK | EXTERN_CRATE | FN | IMPL_DEF | MACRO_CALL |
2821 | | MODULE | STATIC_DEF | STRUCT_DEF | TRAIT_DEF | TYPE_ALIAS_DEF | UNION_DEF | USE => { | 2824 | | MODULE | STATIC_DEF | STRUCT_DEF | TRAIT_DEF | TYPE_ALIAS | UNION_DEF | USE => true, |
2822 | true | ||
2823 | } | ||
2824 | _ => false, | 2825 | _ => false, |
2825 | } | 2826 | } |
2826 | } | 2827 | } |
@@ -2830,14 +2831,14 @@ impl AstNode for Item { | |||
2830 | ENUM_DEF => Item::EnumDef(EnumDef { syntax }), | 2831 | ENUM_DEF => Item::EnumDef(EnumDef { syntax }), |
2831 | EXTERN_BLOCK => Item::ExternBlock(ExternBlock { syntax }), | 2832 | EXTERN_BLOCK => Item::ExternBlock(ExternBlock { syntax }), |
2832 | EXTERN_CRATE => Item::ExternCrate(ExternCrate { syntax }), | 2833 | EXTERN_CRATE => Item::ExternCrate(ExternCrate { syntax }), |
2833 | FN_DEF => Item::FnDef(FnDef { syntax }), | 2834 | FN => Item::Fn(Fn { syntax }), |
2834 | IMPL_DEF => Item::ImplDef(ImplDef { syntax }), | 2835 | IMPL_DEF => Item::ImplDef(ImplDef { syntax }), |
2835 | MACRO_CALL => Item::MacroCall(MacroCall { syntax }), | 2836 | MACRO_CALL => Item::MacroCall(MacroCall { syntax }), |
2836 | MODULE => Item::Module(Module { syntax }), | 2837 | MODULE => Item::Module(Module { syntax }), |
2837 | STATIC_DEF => Item::StaticDef(StaticDef { syntax }), | 2838 | STATIC_DEF => Item::StaticDef(StaticDef { syntax }), |
2838 | STRUCT_DEF => Item::StructDef(StructDef { syntax }), | 2839 | STRUCT_DEF => Item::StructDef(StructDef { syntax }), |
2839 | TRAIT_DEF => Item::TraitDef(TraitDef { syntax }), | 2840 | TRAIT_DEF => Item::TraitDef(TraitDef { syntax }), |
2840 | TYPE_ALIAS_DEF => Item::TypeAliasDef(TypeAliasDef { syntax }), | 2841 | TYPE_ALIAS => Item::TypeAlias(TypeAlias { syntax }), |
2841 | UNION_DEF => Item::UnionDef(UnionDef { syntax }), | 2842 | UNION_DEF => Item::UnionDef(UnionDef { syntax }), |
2842 | USE => Item::Use(Use { syntax }), | 2843 | USE => Item::Use(Use { syntax }), |
2843 | _ => return None, | 2844 | _ => return None, |
@@ -2850,14 +2851,14 @@ impl AstNode for Item { | |||
2850 | Item::EnumDef(it) => &it.syntax, | 2851 | Item::EnumDef(it) => &it.syntax, |
2851 | Item::ExternBlock(it) => &it.syntax, | 2852 | Item::ExternBlock(it) => &it.syntax, |
2852 | Item::ExternCrate(it) => &it.syntax, | 2853 | Item::ExternCrate(it) => &it.syntax, |
2853 | Item::FnDef(it) => &it.syntax, | 2854 | Item::Fn(it) => &it.syntax, |
2854 | Item::ImplDef(it) => &it.syntax, | 2855 | Item::ImplDef(it) => &it.syntax, |
2855 | Item::MacroCall(it) => &it.syntax, | 2856 | Item::MacroCall(it) => &it.syntax, |
2856 | Item::Module(it) => &it.syntax, | 2857 | Item::Module(it) => &it.syntax, |
2857 | Item::StaticDef(it) => &it.syntax, | 2858 | Item::StaticDef(it) => &it.syntax, |
2858 | Item::StructDef(it) => &it.syntax, | 2859 | Item::StructDef(it) => &it.syntax, |
2859 | Item::TraitDef(it) => &it.syntax, | 2860 | Item::TraitDef(it) => &it.syntax, |
2860 | Item::TypeAliasDef(it) => &it.syntax, | 2861 | Item::TypeAlias(it) => &it.syntax, |
2861 | Item::UnionDef(it) => &it.syntax, | 2862 | Item::UnionDef(it) => &it.syntax, |
2862 | Item::Use(it) => &it.syntax, | 2863 | Item::Use(it) => &it.syntax, |
2863 | } | 2864 | } |
@@ -2948,6 +2949,101 @@ impl AstNode for TypeRef { | |||
2948 | } | 2949 | } |
2949 | } | 2950 | } |
2950 | } | 2951 | } |
2952 | impl From<OrPat> for Pat { | ||
2953 | fn from(node: OrPat) -> Pat { Pat::OrPat(node) } | ||
2954 | } | ||
2955 | impl From<ParenPat> for Pat { | ||
2956 | fn from(node: ParenPat) -> Pat { Pat::ParenPat(node) } | ||
2957 | } | ||
2958 | impl From<RefPat> for Pat { | ||
2959 | fn from(node: RefPat) -> Pat { Pat::RefPat(node) } | ||
2960 | } | ||
2961 | impl From<BoxPat> for Pat { | ||
2962 | fn from(node: BoxPat) -> Pat { Pat::BoxPat(node) } | ||
2963 | } | ||
2964 | impl From<BindPat> for Pat { | ||
2965 | fn from(node: BindPat) -> Pat { Pat::BindPat(node) } | ||
2966 | } | ||
2967 | impl From<PlaceholderPat> for Pat { | ||
2968 | fn from(node: PlaceholderPat) -> Pat { Pat::PlaceholderPat(node) } | ||
2969 | } | ||
2970 | impl From<DotDotPat> for Pat { | ||
2971 | fn from(node: DotDotPat) -> Pat { Pat::DotDotPat(node) } | ||
2972 | } | ||
2973 | impl From<PathPat> for Pat { | ||
2974 | fn from(node: PathPat) -> Pat { Pat::PathPat(node) } | ||
2975 | } | ||
2976 | impl From<RecordPat> for Pat { | ||
2977 | fn from(node: RecordPat) -> Pat { Pat::RecordPat(node) } | ||
2978 | } | ||
2979 | impl From<TupleStructPat> for Pat { | ||
2980 | fn from(node: TupleStructPat) -> Pat { Pat::TupleStructPat(node) } | ||
2981 | } | ||
2982 | impl From<TuplePat> for Pat { | ||
2983 | fn from(node: TuplePat) -> Pat { Pat::TuplePat(node) } | ||
2984 | } | ||
2985 | impl From<SlicePat> for Pat { | ||
2986 | fn from(node: SlicePat) -> Pat { Pat::SlicePat(node) } | ||
2987 | } | ||
2988 | impl From<RangePat> for Pat { | ||
2989 | fn from(node: RangePat) -> Pat { Pat::RangePat(node) } | ||
2990 | } | ||
2991 | impl From<LiteralPat> for Pat { | ||
2992 | fn from(node: LiteralPat) -> Pat { Pat::LiteralPat(node) } | ||
2993 | } | ||
2994 | impl From<MacroPat> for Pat { | ||
2995 | fn from(node: MacroPat) -> Pat { Pat::MacroPat(node) } | ||
2996 | } | ||
2997 | impl AstNode for Pat { | ||
2998 | fn can_cast(kind: SyntaxKind) -> bool { | ||
2999 | match kind { | ||
3000 | OR_PAT | PAREN_PAT | REF_PAT | BOX_PAT | BIND_PAT | PLACEHOLDER_PAT | DOT_DOT_PAT | ||
3001 | | PATH_PAT | RECORD_PAT | TUPLE_STRUCT_PAT | TUPLE_PAT | SLICE_PAT | RANGE_PAT | ||
3002 | | LITERAL_PAT | MACRO_PAT => true, | ||
3003 | _ => false, | ||
3004 | } | ||
3005 | } | ||
3006 | fn cast(syntax: SyntaxNode) -> Option<Self> { | ||
3007 | let res = match syntax.kind() { | ||
3008 | OR_PAT => Pat::OrPat(OrPat { syntax }), | ||
3009 | PAREN_PAT => Pat::ParenPat(ParenPat { syntax }), | ||
3010 | REF_PAT => Pat::RefPat(RefPat { syntax }), | ||
3011 | BOX_PAT => Pat::BoxPat(BoxPat { syntax }), | ||
3012 | BIND_PAT => Pat::BindPat(BindPat { syntax }), | ||
3013 | PLACEHOLDER_PAT => Pat::PlaceholderPat(PlaceholderPat { syntax }), | ||
3014 | DOT_DOT_PAT => Pat::DotDotPat(DotDotPat { syntax }), | ||
3015 | PATH_PAT => Pat::PathPat(PathPat { syntax }), | ||
3016 | RECORD_PAT => Pat::RecordPat(RecordPat { syntax }), | ||
3017 | TUPLE_STRUCT_PAT => Pat::TupleStructPat(TupleStructPat { syntax }), | ||
3018 | TUPLE_PAT => Pat::TuplePat(TuplePat { syntax }), | ||
3019 | SLICE_PAT => Pat::SlicePat(SlicePat { syntax }), | ||
3020 | RANGE_PAT => Pat::RangePat(RangePat { syntax }), | ||
3021 | LITERAL_PAT => Pat::LiteralPat(LiteralPat { syntax }), | ||
3022 | MACRO_PAT => Pat::MacroPat(MacroPat { syntax }), | ||
3023 | _ => return None, | ||
3024 | }; | ||
3025 | Some(res) | ||
3026 | } | ||
3027 | fn syntax(&self) -> &SyntaxNode { | ||
3028 | match self { | ||
3029 | Pat::OrPat(it) => &it.syntax, | ||
3030 | Pat::ParenPat(it) => &it.syntax, | ||
3031 | Pat::RefPat(it) => &it.syntax, | ||
3032 | Pat::BoxPat(it) => &it.syntax, | ||
3033 | Pat::BindPat(it) => &it.syntax, | ||
3034 | Pat::PlaceholderPat(it) => &it.syntax, | ||
3035 | Pat::DotDotPat(it) => &it.syntax, | ||
3036 | Pat::PathPat(it) => &it.syntax, | ||
3037 | Pat::RecordPat(it) => &it.syntax, | ||
3038 | Pat::TupleStructPat(it) => &it.syntax, | ||
3039 | Pat::TuplePat(it) => &it.syntax, | ||
3040 | Pat::SlicePat(it) => &it.syntax, | ||
3041 | Pat::RangePat(it) => &it.syntax, | ||
3042 | Pat::LiteralPat(it) => &it.syntax, | ||
3043 | Pat::MacroPat(it) => &it.syntax, | ||
3044 | } | ||
3045 | } | ||
3046 | } | ||
2951 | impl From<RecordFieldDefList> for FieldDefList { | 3047 | impl From<RecordFieldDefList> for FieldDefList { |
2952 | fn from(node: RecordFieldDefList) -> FieldDefList { FieldDefList::RecordFieldDefList(node) } | 3048 | fn from(node: RecordFieldDefList) -> FieldDefList { FieldDefList::RecordFieldDefList(node) } |
2953 | } | 3049 | } |
@@ -3157,11 +3253,11 @@ impl AstNode for Expr { | |||
3157 | } | 3253 | } |
3158 | } | 3254 | } |
3159 | } | 3255 | } |
3160 | impl From<FnDef> for AssocItem { | 3256 | impl From<Fn> for AssocItem { |
3161 | fn from(node: FnDef) -> AssocItem { AssocItem::FnDef(node) } | 3257 | fn from(node: Fn) -> AssocItem { AssocItem::Fn(node) } |
3162 | } | 3258 | } |
3163 | impl From<TypeAliasDef> for AssocItem { | 3259 | impl From<TypeAlias> for AssocItem { |
3164 | fn from(node: TypeAliasDef) -> AssocItem { AssocItem::TypeAliasDef(node) } | 3260 | fn from(node: TypeAlias) -> AssocItem { AssocItem::TypeAlias(node) } |
3165 | } | 3261 | } |
3166 | impl From<ConstDef> for AssocItem { | 3262 | impl From<ConstDef> for AssocItem { |
3167 | fn from(node: ConstDef) -> AssocItem { AssocItem::ConstDef(node) } | 3263 | fn from(node: ConstDef) -> AssocItem { AssocItem::ConstDef(node) } |
@@ -3172,14 +3268,14 @@ impl From<MacroCall> for AssocItem { | |||
3172 | impl AstNode for AssocItem { | 3268 | impl AstNode for AssocItem { |
3173 | fn can_cast(kind: SyntaxKind) -> bool { | 3269 | fn can_cast(kind: SyntaxKind) -> bool { |
3174 | match kind { | 3270 | match kind { |
3175 | FN_DEF | TYPE_ALIAS_DEF | CONST_DEF | MACRO_CALL => true, | 3271 | FN | TYPE_ALIAS | CONST_DEF | MACRO_CALL => true, |
3176 | _ => false, | 3272 | _ => false, |
3177 | } | 3273 | } |
3178 | } | 3274 | } |
3179 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 3275 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
3180 | let res = match syntax.kind() { | 3276 | let res = match syntax.kind() { |
3181 | FN_DEF => AssocItem::FnDef(FnDef { syntax }), | 3277 | FN => AssocItem::Fn(Fn { syntax }), |
3182 | TYPE_ALIAS_DEF => AssocItem::TypeAliasDef(TypeAliasDef { syntax }), | 3278 | TYPE_ALIAS => AssocItem::TypeAlias(TypeAlias { syntax }), |
3183 | CONST_DEF => AssocItem::ConstDef(ConstDef { syntax }), | 3279 | CONST_DEF => AssocItem::ConstDef(ConstDef { syntax }), |
3184 | MACRO_CALL => AssocItem::MacroCall(MacroCall { syntax }), | 3280 | MACRO_CALL => AssocItem::MacroCall(MacroCall { syntax }), |
3185 | _ => return None, | 3281 | _ => return None, |
@@ -3188,108 +3284,13 @@ impl AstNode for AssocItem { | |||
3188 | } | 3284 | } |
3189 | fn syntax(&self) -> &SyntaxNode { | 3285 | fn syntax(&self) -> &SyntaxNode { |
3190 | match self { | 3286 | match self { |
3191 | AssocItem::FnDef(it) => &it.syntax, | 3287 | AssocItem::Fn(it) => &it.syntax, |
3192 | AssocItem::TypeAliasDef(it) => &it.syntax, | 3288 | AssocItem::TypeAlias(it) => &it.syntax, |
3193 | AssocItem::ConstDef(it) => &it.syntax, | 3289 | AssocItem::ConstDef(it) => &it.syntax, |
3194 | AssocItem::MacroCall(it) => &it.syntax, | 3290 | AssocItem::MacroCall(it) => &it.syntax, |
3195 | } | 3291 | } |
3196 | } | 3292 | } |
3197 | } | 3293 | } |
3198 | impl From<OrPat> for Pat { | ||
3199 | fn from(node: OrPat) -> Pat { Pat::OrPat(node) } | ||
3200 | } | ||
3201 | impl From<ParenPat> for Pat { | ||
3202 | fn from(node: ParenPat) -> Pat { Pat::ParenPat(node) } | ||
3203 | } | ||
3204 | impl From<RefPat> for Pat { | ||
3205 | fn from(node: RefPat) -> Pat { Pat::RefPat(node) } | ||
3206 | } | ||
3207 | impl From<BoxPat> for Pat { | ||
3208 | fn from(node: BoxPat) -> Pat { Pat::BoxPat(node) } | ||
3209 | } | ||
3210 | impl From<BindPat> for Pat { | ||
3211 | fn from(node: BindPat) -> Pat { Pat::BindPat(node) } | ||
3212 | } | ||
3213 | impl From<PlaceholderPat> for Pat { | ||
3214 | fn from(node: PlaceholderPat) -> Pat { Pat::PlaceholderPat(node) } | ||
3215 | } | ||
3216 | impl From<DotDotPat> for Pat { | ||
3217 | fn from(node: DotDotPat) -> Pat { Pat::DotDotPat(node) } | ||
3218 | } | ||
3219 | impl From<PathPat> for Pat { | ||
3220 | fn from(node: PathPat) -> Pat { Pat::PathPat(node) } | ||
3221 | } | ||
3222 | impl From<RecordPat> for Pat { | ||
3223 | fn from(node: RecordPat) -> Pat { Pat::RecordPat(node) } | ||
3224 | } | ||
3225 | impl From<TupleStructPat> for Pat { | ||
3226 | fn from(node: TupleStructPat) -> Pat { Pat::TupleStructPat(node) } | ||
3227 | } | ||
3228 | impl From<TuplePat> for Pat { | ||
3229 | fn from(node: TuplePat) -> Pat { Pat::TuplePat(node) } | ||
3230 | } | ||
3231 | impl From<SlicePat> for Pat { | ||
3232 | fn from(node: SlicePat) -> Pat { Pat::SlicePat(node) } | ||
3233 | } | ||
3234 | impl From<RangePat> for Pat { | ||
3235 | fn from(node: RangePat) -> Pat { Pat::RangePat(node) } | ||
3236 | } | ||
3237 | impl From<LiteralPat> for Pat { | ||
3238 | fn from(node: LiteralPat) -> Pat { Pat::LiteralPat(node) } | ||
3239 | } | ||
3240 | impl From<MacroPat> for Pat { | ||
3241 | fn from(node: MacroPat) -> Pat { Pat::MacroPat(node) } | ||
3242 | } | ||
3243 | impl AstNode for Pat { | ||
3244 | fn can_cast(kind: SyntaxKind) -> bool { | ||
3245 | match kind { | ||
3246 | OR_PAT | PAREN_PAT | REF_PAT | BOX_PAT | BIND_PAT | PLACEHOLDER_PAT | DOT_DOT_PAT | ||
3247 | | PATH_PAT | RECORD_PAT | TUPLE_STRUCT_PAT | TUPLE_PAT | SLICE_PAT | RANGE_PAT | ||
3248 | | LITERAL_PAT | MACRO_PAT => true, | ||
3249 | _ => false, | ||
3250 | } | ||
3251 | } | ||
3252 | fn cast(syntax: SyntaxNode) -> Option<Self> { | ||
3253 | let res = match syntax.kind() { | ||
3254 | OR_PAT => Pat::OrPat(OrPat { syntax }), | ||
3255 | PAREN_PAT => Pat::ParenPat(ParenPat { syntax }), | ||
3256 | REF_PAT => Pat::RefPat(RefPat { syntax }), | ||
3257 | BOX_PAT => Pat::BoxPat(BoxPat { syntax }), | ||
3258 | BIND_PAT => Pat::BindPat(BindPat { syntax }), | ||
3259 | PLACEHOLDER_PAT => Pat::PlaceholderPat(PlaceholderPat { syntax }), | ||
3260 | DOT_DOT_PAT => Pat::DotDotPat(DotDotPat { syntax }), | ||
3261 | PATH_PAT => Pat::PathPat(PathPat { syntax }), | ||
3262 | RECORD_PAT => Pat::RecordPat(RecordPat { syntax }), | ||
3263 | TUPLE_STRUCT_PAT => Pat::TupleStructPat(TupleStructPat { syntax }), | ||
3264 | TUPLE_PAT => Pat::TuplePat(TuplePat { syntax }), | ||
3265 | SLICE_PAT => Pat::SlicePat(SlicePat { syntax }), | ||
3266 | RANGE_PAT => Pat::RangePat(RangePat { syntax }), | ||
3267 | LITERAL_PAT => Pat::LiteralPat(LiteralPat { syntax }), | ||
3268 | MACRO_PAT => Pat::MacroPat(MacroPat { syntax }), | ||
3269 | _ => return None, | ||
3270 | }; | ||
3271 | Some(res) | ||
3272 | } | ||
3273 | fn syntax(&self) -> &SyntaxNode { | ||
3274 | match self { | ||
3275 | Pat::OrPat(it) => &it.syntax, | ||
3276 | Pat::ParenPat(it) => &it.syntax, | ||
3277 | Pat::RefPat(it) => &it.syntax, | ||
3278 | Pat::BoxPat(it) => &it.syntax, | ||
3279 | Pat::BindPat(it) => &it.syntax, | ||
3280 | Pat::PlaceholderPat(it) => &it.syntax, | ||
3281 | Pat::DotDotPat(it) => &it.syntax, | ||
3282 | Pat::PathPat(it) => &it.syntax, | ||
3283 | Pat::RecordPat(it) => &it.syntax, | ||
3284 | Pat::TupleStructPat(it) => &it.syntax, | ||
3285 | Pat::TuplePat(it) => &it.syntax, | ||
3286 | Pat::SlicePat(it) => &it.syntax, | ||
3287 | Pat::RangePat(it) => &it.syntax, | ||
3288 | Pat::LiteralPat(it) => &it.syntax, | ||
3289 | Pat::MacroPat(it) => &it.syntax, | ||
3290 | } | ||
3291 | } | ||
3292 | } | ||
3293 | impl From<LetStmt> for Stmt { | 3294 | impl From<LetStmt> for Stmt { |
3294 | fn from(node: LetStmt) -> Stmt { Stmt::LetStmt(node) } | 3295 | fn from(node: LetStmt) -> Stmt { Stmt::LetStmt(node) } |
3295 | } | 3296 | } |
@@ -3346,8 +3347,8 @@ impl AstNode for AttrInput { | |||
3346 | } | 3347 | } |
3347 | } | 3348 | } |
3348 | } | 3349 | } |
3349 | impl From<FnDef> for ExternItem { | 3350 | impl From<Fn> for ExternItem { |
3350 | fn from(node: FnDef) -> ExternItem { ExternItem::FnDef(node) } | 3351 | fn from(node: Fn) -> ExternItem { ExternItem::Fn(node) } |
3351 | } | 3352 | } |
3352 | impl From<StaticDef> for ExternItem { | 3353 | impl From<StaticDef> for ExternItem { |
3353 | fn from(node: StaticDef) -> ExternItem { ExternItem::StaticDef(node) } | 3354 | fn from(node: StaticDef) -> ExternItem { ExternItem::StaticDef(node) } |
@@ -3355,13 +3356,13 @@ impl From<StaticDef> for ExternItem { | |||
3355 | impl AstNode for ExternItem { | 3356 | impl AstNode for ExternItem { |
3356 | fn can_cast(kind: SyntaxKind) -> bool { | 3357 | fn can_cast(kind: SyntaxKind) -> bool { |
3357 | match kind { | 3358 | match kind { |
3358 | FN_DEF | STATIC_DEF => true, | 3359 | FN | STATIC_DEF => true, |
3359 | _ => false, | 3360 | _ => false, |
3360 | } | 3361 | } |
3361 | } | 3362 | } |
3362 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 3363 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
3363 | let res = match syntax.kind() { | 3364 | let res = match syntax.kind() { |
3364 | FN_DEF => ExternItem::FnDef(FnDef { syntax }), | 3365 | FN => ExternItem::Fn(Fn { syntax }), |
3365 | STATIC_DEF => ExternItem::StaticDef(StaticDef { syntax }), | 3366 | STATIC_DEF => ExternItem::StaticDef(StaticDef { syntax }), |
3366 | _ => return None, | 3367 | _ => return None, |
3367 | }; | 3368 | }; |
@@ -3369,7 +3370,7 @@ impl AstNode for ExternItem { | |||
3369 | } | 3370 | } |
3370 | fn syntax(&self) -> &SyntaxNode { | 3371 | fn syntax(&self) -> &SyntaxNode { |
3371 | match self { | 3372 | match self { |
3372 | ExternItem::FnDef(it) => &it.syntax, | 3373 | ExternItem::Fn(it) => &it.syntax, |
3373 | ExternItem::StaticDef(it) => &it.syntax, | 3374 | ExternItem::StaticDef(it) => &it.syntax, |
3374 | } | 3375 | } |
3375 | } | 3376 | } |
@@ -3417,22 +3418,22 @@ impl std::fmt::Display for TypeRef { | |||
3417 | std::fmt::Display::fmt(self.syntax(), f) | 3418 | std::fmt::Display::fmt(self.syntax(), f) |
3418 | } | 3419 | } |
3419 | } | 3420 | } |
3420 | impl std::fmt::Display for FieldDefList { | 3421 | impl std::fmt::Display for Pat { |
3421 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3422 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3422 | std::fmt::Display::fmt(self.syntax(), f) | 3423 | std::fmt::Display::fmt(self.syntax(), f) |
3423 | } | 3424 | } |
3424 | } | 3425 | } |
3425 | impl std::fmt::Display for Expr { | 3426 | impl std::fmt::Display for FieldDefList { |
3426 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3427 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3427 | std::fmt::Display::fmt(self.syntax(), f) | 3428 | std::fmt::Display::fmt(self.syntax(), f) |
3428 | } | 3429 | } |
3429 | } | 3430 | } |
3430 | impl std::fmt::Display for AssocItem { | 3431 | impl std::fmt::Display for Expr { |
3431 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3432 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3432 | std::fmt::Display::fmt(self.syntax(), f) | 3433 | std::fmt::Display::fmt(self.syntax(), f) |
3433 | } | 3434 | } |
3434 | } | 3435 | } |
3435 | impl std::fmt::Display for Pat { | 3436 | impl std::fmt::Display for AssocItem { |
3436 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3437 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3437 | std::fmt::Display::fmt(self.syntax(), f) | 3438 | std::fmt::Display::fmt(self.syntax(), f) |
3438 | } | 3439 | } |
@@ -3487,7 +3488,7 @@ impl std::fmt::Display for ExternCrate { | |||
3487 | std::fmt::Display::fmt(self.syntax(), f) | 3488 | std::fmt::Display::fmt(self.syntax(), f) |
3488 | } | 3489 | } |
3489 | } | 3490 | } |
3490 | impl std::fmt::Display for FnDef { | 3491 | impl std::fmt::Display for Fn { |
3491 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3492 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3492 | std::fmt::Display::fmt(self.syntax(), f) | 3493 | std::fmt::Display::fmt(self.syntax(), f) |
3493 | } | 3494 | } |
@@ -3522,7 +3523,7 @@ impl std::fmt::Display for TraitDef { | |||
3522 | std::fmt::Display::fmt(self.syntax(), f) | 3523 | std::fmt::Display::fmt(self.syntax(), f) |
3523 | } | 3524 | } |
3524 | } | 3525 | } |
3525 | impl std::fmt::Display for TypeAliasDef { | 3526 | impl std::fmt::Display for TypeAlias { |
3526 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3527 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3527 | std::fmt::Display::fmt(self.syntax(), f) | 3528 | std::fmt::Display::fmt(self.syntax(), f) |
3528 | } | 3529 | } |
@@ -3607,6 +3608,21 @@ impl std::fmt::Display for BlockExpr { | |||
3607 | std::fmt::Display::fmt(self.syntax(), f) | 3608 | std::fmt::Display::fmt(self.syntax(), f) |
3608 | } | 3609 | } |
3609 | } | 3610 | } |
3611 | impl std::fmt::Display for Param { | ||
3612 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
3613 | std::fmt::Display::fmt(self.syntax(), f) | ||
3614 | } | ||
3615 | } | ||
3616 | impl std::fmt::Display for SelfParam { | ||
3617 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
3618 | std::fmt::Display::fmt(self.syntax(), f) | ||
3619 | } | ||
3620 | } | ||
3621 | impl std::fmt::Display for TypeBoundList { | ||
3622 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
3623 | std::fmt::Display::fmt(self.syntax(), f) | ||
3624 | } | ||
3625 | } | ||
3610 | impl std::fmt::Display for RecordFieldDefList { | 3626 | impl std::fmt::Display for RecordFieldDefList { |
3611 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3627 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3612 | std::fmt::Display::fmt(self.syntax(), f) | 3628 | std::fmt::Display::fmt(self.syntax(), f) |
@@ -3637,11 +3653,6 @@ impl std::fmt::Display for EnumVariant { | |||
3637 | std::fmt::Display::fmt(self.syntax(), f) | 3653 | std::fmt::Display::fmt(self.syntax(), f) |
3638 | } | 3654 | } |
3639 | } | 3655 | } |
3640 | impl std::fmt::Display for TypeBoundList { | ||
3641 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
3642 | std::fmt::Display::fmt(self.syntax(), f) | ||
3643 | } | ||
3644 | } | ||
3645 | impl std::fmt::Display for AssocItemList { | 3656 | impl std::fmt::Display for AssocItemList { |
3646 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3657 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3647 | std::fmt::Display::fmt(self.syntax(), f) | 3658 | std::fmt::Display::fmt(self.syntax(), f) |
@@ -4037,16 +4048,6 @@ impl std::fmt::Display for LetStmt { | |||
4037 | std::fmt::Display::fmt(self.syntax(), f) | 4048 | std::fmt::Display::fmt(self.syntax(), f) |
4038 | } | 4049 | } |
4039 | } | 4050 | } |
4040 | impl std::fmt::Display for SelfParam { | ||
4041 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
4042 | std::fmt::Display::fmt(self.syntax(), f) | ||
4043 | } | ||
4044 | } | ||
4045 | impl std::fmt::Display for Param { | ||
4046 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
4047 | std::fmt::Display::fmt(self.syntax(), f) | ||
4048 | } | ||
4049 | } | ||
4050 | impl std::fmt::Display for PathSegment { | 4051 | impl std::fmt::Display for PathSegment { |
4051 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 4052 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4052 | std::fmt::Display::fmt(self.syntax(), f) | 4053 | 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 0ff69bc2d..ef235680f 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( | |||
294 | type_params: Option<ast::TypeParamList>, | 294 | type_params: Option<ast::TypeParamList>, |
295 | params: ast::ParamList, | 295 | params: ast::ParamList, |
296 | body: ast::BlockExpr, | 296 | body: ast::BlockExpr, |
297 | ) -> ast::FnDef { | 297 | ) -> ast::Fn { |
298 | let type_params = | 298 | let type_params = |
299 | if let Some(type_params) = type_params { format!("<{}>", type_params) } else { "".into() }; | 299 | if let Some(type_params) = type_params { format!("<{}>", type_params) } else { "".into() }; |
300 | let visibility = match visibility { | 300 | 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 242900643..a7a301d6b 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 { | |||
474 | } | 474 | } |
475 | 475 | ||
476 | impl ast::DocCommentsOwner for ast::SourceFile {} | 476 | impl ast::DocCommentsOwner for ast::SourceFile {} |
477 | impl ast::DocCommentsOwner for ast::FnDef {} | 477 | impl ast::DocCommentsOwner for ast::Fn {} |
478 | impl ast::DocCommentsOwner for ast::StructDef {} | 478 | impl ast::DocCommentsOwner for ast::StructDef {} |
479 | impl ast::DocCommentsOwner for ast::UnionDef {} | 479 | impl ast::DocCommentsOwner for ast::UnionDef {} |
480 | impl ast::DocCommentsOwner for ast::RecordFieldDef {} | 480 | impl ast::DocCommentsOwner for ast::RecordFieldDef {} |
@@ -485,6 +485,6 @@ impl ast::DocCommentsOwner for ast::TraitDef {} | |||
485 | impl ast::DocCommentsOwner for ast::Module {} | 485 | impl ast::DocCommentsOwner for ast::Module {} |
486 | impl ast::DocCommentsOwner for ast::StaticDef {} | 486 | impl ast::DocCommentsOwner for ast::StaticDef {} |
487 | impl ast::DocCommentsOwner for ast::ConstDef {} | 487 | impl ast::DocCommentsOwner for ast::ConstDef {} |
488 | impl ast::DocCommentsOwner for ast::TypeAliasDef {} | 488 | impl ast::DocCommentsOwner for ast::TypeAlias {} |
489 | impl ast::DocCommentsOwner for ast::ImplDef {} | 489 | impl ast::DocCommentsOwner for ast::ImplDef {} |
490 | impl ast::DocCommentsOwner for ast::MacroCall {} | 490 | impl ast::DocCommentsOwner for ast::MacroCall {} |
diff --git a/crates/ra_syntax/src/lib.rs b/crates/ra_syntax/src/lib.rs index 219dd0b07..6203b6206 100644 --- a/crates/ra_syntax/src/lib.rs +++ b/crates/ra_syntax/src/lib.rs | |||
@@ -255,11 +255,11 @@ fn api_walkthrough() { | |||
255 | let mut func = None; | 255 | let mut func = None; |
256 | for item in file.items() { | 256 | for item in file.items() { |
257 | match item { | 257 | match item { |
258 | ast::Item::FnDef(f) => func = Some(f), | 258 | ast::Item::Fn(f) => func = Some(f), |
259 | _ => unreachable!(), | 259 | _ => unreachable!(), |
260 | } | 260 | } |
261 | } | 261 | } |
262 | let func: ast::FnDef = func.unwrap(); | 262 | let func: ast::Fn = func.unwrap(); |
263 | 263 | ||
264 | // Each AST node has a bunch of getters for children. All getters return | 264 | // Each AST node has a bunch of getters for children. All getters return |
265 | // `Option`s though, to account for incomplete code. Some getters are common | 265 | // `Option`s though, to account for incomplete code. Some getters are common |
@@ -316,7 +316,7 @@ fn api_walkthrough() { | |||
316 | ); | 316 | ); |
317 | 317 | ||
318 | // As well as some iterator helpers: | 318 | // As well as some iterator helpers: |
319 | let f = expr_syntax.ancestors().find_map(ast::FnDef::cast); | 319 | let f = expr_syntax.ancestors().find_map(ast::Fn::cast); |
320 | assert_eq!(f, Some(func)); | 320 | assert_eq!(f, Some(func)); |
321 | assert!(expr_syntax.siblings_with_tokens(Direction::Next).any(|it| it.kind() == T!['}'])); | 321 | assert!(expr_syntax.siblings_with_tokens(Direction::Next).any(|it| it.kind() == T!['}'])); |
322 | assert_eq!( | 322 | 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 c6b30a02a..87a7acd09 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>( | |||
146 | trivias: impl Iterator<Item = (SyntaxKind, &'a str)>, | 146 | trivias: impl Iterator<Item = (SyntaxKind, &'a str)>, |
147 | ) -> usize { | 147 | ) -> usize { |
148 | match kind { | 148 | match kind { |
149 | MACRO_CALL | CONST_DEF | TYPE_ALIAS_DEF | STRUCT_DEF | ENUM_DEF | ENUM_VARIANT | FN_DEF | 149 | MACRO_CALL | CONST_DEF | TYPE_ALIAS | STRUCT_DEF | ENUM_DEF | ENUM_VARIANT | FN |
150 | | TRAIT_DEF | MODULE | RECORD_FIELD_DEF | STATIC_DEF => { | 150 | | TRAIT_DEF | MODULE | RECORD_FIELD_DEF | STATIC_DEF => { |
151 | let mut res = 0; | 151 | let mut res = 0; |
152 | let mut trivias = trivias.enumerate().peekable(); | 152 | let mut trivias = trivias.enumerate().peekable(); |
diff --git a/crates/ra_syntax/src/validation.rs b/crates/ra_syntax/src/validation.rs index fdec48fb0..6a2749381 100644 --- a/crates/ra_syntax/src/validation.rs +++ b/crates/ra_syntax/src/validation.rs | |||
@@ -4,7 +4,7 @@ mod block; | |||
4 | 4 | ||
5 | use crate::{ | 5 | use crate::{ |
6 | ast, match_ast, AstNode, SyntaxError, | 6 | ast, match_ast, AstNode, SyntaxError, |
7 | SyntaxKind::{BYTE, BYTE_STRING, CHAR, CONST_DEF, FN_DEF, INT_NUMBER, STRING, TYPE_ALIAS_DEF}, | 7 | SyntaxKind::{BYTE, BYTE_STRING, CHAR, CONST_DEF, FN, INT_NUMBER, STRING, TYPE_ALIAS}, |
8 | SyntaxNode, SyntaxToken, TextSize, T, | 8 | SyntaxNode, SyntaxToken, TextSize, T, |
9 | }; | 9 | }; |
10 | use rustc_lexer::unescape::{ | 10 | use rustc_lexer::unescape::{ |
@@ -200,7 +200,7 @@ fn validate_visibility(vis: ast::Visibility, errors: &mut Vec<SyntaxError>) { | |||
200 | None => return, | 200 | None => return, |
201 | }; | 201 | }; |
202 | match parent.kind() { | 202 | match parent.kind() { |
203 | FN_DEF | CONST_DEF | TYPE_ALIAS_DEF => (), | 203 | FN | CONST_DEF | TYPE_ALIAS => (), |
204 | _ => return, | 204 | _ => return, |
205 | } | 205 | } |
206 | 206 | ||
diff --git a/crates/ra_syntax/src/validation/block.rs b/crates/ra_syntax/src/validation/block.rs index 2c08f7e6e..ad9901468 100644 --- a/crates/ra_syntax/src/validation/block.rs +++ b/crates/ra_syntax/src/validation/block.rs | |||
@@ -9,7 +9,7 @@ use crate::{ | |||
9 | pub(crate) fn validate_block_expr(block: ast::BlockExpr, errors: &mut Vec<SyntaxError>) { | 9 | pub(crate) fn validate_block_expr(block: ast::BlockExpr, errors: &mut Vec<SyntaxError>) { |
10 | if let Some(parent) = block.syntax().parent() { | 10 | if let Some(parent) = block.syntax().parent() { |
11 | match parent.kind() { | 11 | match parent.kind() { |
12 | FN_DEF | EXPR_STMT | BLOCK_EXPR => return, | 12 | FN | EXPR_STMT | BLOCK_EXPR => return, |
13 | _ => {} | 13 | _ => {} |
14 | } | 14 | } |
15 | } | 15 | } |
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 375ed45e0..4845a6563 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 @@ | |||
1 | SOURCE_FILE@0..54 | 1 | SOURCE_FILE@0..54 |
2 | FN_DEF@0..31 | 2 | FN@0..31 |
3 | ATTR@0..18 | 3 | ATTR@0..18 |
4 | POUND@0..1 "#" | 4 | POUND@0..1 "#" |
5 | L_BRACK@1..2 "[" | 5 | 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 b72c92c33..2ae5bacea 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 | |||
12 | ERROR@14..15 | 12 | ERROR@14..15 |
13 | R_CURLY@14..15 "}" | 13 | R_CURLY@14..15 "}" |
14 | WHITESPACE@15..17 "\n\n" | 14 | WHITESPACE@15..17 "\n\n" |
15 | FN_DEF@17..27 | 15 | FN@17..27 |
16 | FN_KW@17..19 "fn" | 16 | FN_KW@17..19 "fn" |
17 | WHITESPACE@19..20 " " | 17 | WHITESPACE@19..20 " " |
18 | NAME@20..23 | 18 | 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 33953d8d7..1e9637c26 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 @@ | |||
1 | SOURCE_FILE@0..95 | 1 | SOURCE_FILE@0..95 |
2 | FN_DEF@0..12 | 2 | FN@0..12 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | NAME@3..6 |
@@ -58,7 +58,7 @@ SOURCE_FILE@0..95 | |||
58 | WHITESPACE@78..79 "\n" | 58 | WHITESPACE@78..79 "\n" |
59 | R_CURLY@79..80 "}" | 59 | R_CURLY@79..80 "}" |
60 | WHITESPACE@80..82 "\n\n" | 60 | WHITESPACE@80..82 "\n\n" |
61 | FN_DEF@82..94 | 61 | FN@82..94 |
62 | FN_KW@82..84 "fn" | 62 | FN_KW@82..84 "fn" |
63 | WHITESPACE@84..85 " " | 63 | WHITESPACE@84..85 " " |
64 | NAME@85..88 | 64 | 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 3bf57eacc..1c3e0f65b 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 @@ | |||
1 | SOURCE_FILE@0..42 | 1 | SOURCE_FILE@0..42 |
2 | FN_DEF@0..41 | 2 | FN@0..41 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | 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 e1e782f5f..c8bf96550 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 @@ | |||
1 | SOURCE_FILE@0..389 | 1 | SOURCE_FILE@0..389 |
2 | FN_DEF@0..389 | 2 | FN@0..389 |
3 | VISIBILITY@0..10 | 3 | VISIBILITY@0..10 |
4 | PUB_KW@0..3 | 4 | PUB_KW@0..3 |
5 | L_PAREN@3..4 | 5 | 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 9323b7890..1ab045a44 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 @@ | |||
1 | SOURCE_FILE@0..23 | 1 | SOURCE_FILE@0..23 |
2 | FN_DEF@0..22 | 2 | FN@0..22 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 b18378cff..a3c25b450 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 @@ | |||
1 | SOURCE_FILE@0..14 | 1 | SOURCE_FILE@0..14 |
2 | FN_DEF@0..7 | 2 | FN@0..7 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 93434f34f..66157c3dc 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 @@ | |||
1 | SOURCE_FILE@0..56 | 1 | SOURCE_FILE@0..56 |
2 | FN_DEF@0..55 | 2 | FN@0..55 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 628315c78..bb4a28f4e 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 @@ | |||
1 | SOURCE_FILE@0..47 | 1 | SOURCE_FILE@0..47 |
2 | FN_DEF@0..46 | 2 | FN@0..46 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 a87e5061a..ce43ddf45 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 | |||
11 | ASSOC_ITEM_LIST@14..182 | 11 | ASSOC_ITEM_LIST@14..182 |
12 | L_CURLY@14..15 "{" | 12 | L_CURLY@14..15 "{" |
13 | WHITESPACE@15..20 "\n " | 13 | WHITESPACE@15..20 "\n " |
14 | FN_DEF@20..161 | 14 | FN@20..161 |
15 | FN_KW@20..22 "fn" | 15 | FN_KW@20..22 "fn" |
16 | WHITESPACE@22..23 " " | 16 | WHITESPACE@22..23 " " |
17 | NAME@23..32 | 17 | NAME@23..32 |
@@ -116,7 +116,7 @@ SOURCE_FILE@0..183 | |||
116 | WHITESPACE@155..160 "\n " | 116 | WHITESPACE@155..160 "\n " |
117 | R_CURLY@160..161 "}" | 117 | R_CURLY@160..161 "}" |
118 | WHITESPACE@161..167 "\n\n " | 118 | WHITESPACE@161..167 "\n\n " |
119 | FN_DEF@167..180 | 119 | FN@167..180 |
120 | FN_KW@167..169 "fn" | 120 | FN_KW@167..169 "fn" |
121 | WHITESPACE@169..170 " " | 121 | WHITESPACE@169..170 " " |
122 | NAME@170..180 | 122 | 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 4ff27f5c8..f6fa964b7 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 @@ | |||
1 | SOURCE_FILE@0..139 | 1 | SOURCE_FILE@0..139 |
2 | FN_DEF@0..138 | 2 | FN@0..138 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 5f3a31473..6f6feba5a 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 @@ | |||
1 | SOURCE_FILE@0..16 | 1 | SOURCE_FILE@0..16 |
2 | FN_DEF@0..2 | 2 | FN@0..2 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..4 "\n\n" | 4 | WHITESPACE@2..4 "\n\n" |
5 | FN_DEF@4..15 | 5 | FN@4..15 |
6 | FN_KW@4..6 "fn" | 6 | FN_KW@4..6 "fn" |
7 | WHITESPACE@6..7 " " | 7 | WHITESPACE@6..7 " " |
8 | NAME@7..10 | 8 | 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 1746bd3c1..ba4ce4795 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 @@ | |||
1 | SOURCE_FILE@0..22 | 1 | SOURCE_FILE@0..22 |
2 | FN_DEF@0..21 | 2 | FN@0..21 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 28146f44e..866f61113 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 @@ | |||
1 | SOURCE_FILE@0..112 | 1 | SOURCE_FILE@0..112 |
2 | FN_DEF@0..33 | 2 | FN@0..33 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..4 | 5 | NAME@3..4 |
@@ -40,7 +40,7 @@ SOURCE_FILE@0..112 | |||
40 | WHITESPACE@31..32 " " | 40 | WHITESPACE@31..32 " " |
41 | R_CURLY@32..33 "}" | 41 | R_CURLY@32..33 "}" |
42 | WHITESPACE@33..34 "\n" | 42 | WHITESPACE@33..34 "\n" |
43 | FN_DEF@34..68 | 43 | FN@34..68 |
44 | FN_KW@34..36 "fn" | 44 | FN_KW@34..36 "fn" |
45 | WHITESPACE@36..37 " " | 45 | WHITESPACE@36..37 " " |
46 | NAME@37..38 | 46 | NAME@37..38 |
@@ -88,7 +88,7 @@ SOURCE_FILE@0..112 | |||
88 | WHITESPACE@66..67 " " | 88 | WHITESPACE@66..67 " " |
89 | R_CURLY@67..68 "}" | 89 | R_CURLY@67..68 "}" |
90 | WHITESPACE@68..69 "\n" | 90 | WHITESPACE@68..69 "\n" |
91 | FN_DEF@69..111 | 91 | FN@69..111 |
92 | FN_KW@69..71 "fn" | 92 | FN_KW@69..71 "fn" |
93 | WHITESPACE@71..72 " " | 93 | WHITESPACE@71..72 " " |
94 | NAME@72..73 | 94 | 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 9ea9d715e..5ffefd742 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 @@ | |||
1 | SOURCE_FILE@0..94 | 1 | SOURCE_FILE@0..94 |
2 | FN_DEF@0..55 | 2 | FN@0..55 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | 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 48610a5eb..1e94e72bc 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 @@ | |||
1 | SOURCE_FILE@0..240 | 1 | SOURCE_FILE@0..240 |
2 | FN_DEF@0..53 | 2 | FN@0..53 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..4 | 5 | NAME@3..4 |
@@ -65,7 +65,7 @@ SOURCE_FILE@0..240 | |||
65 | L_CURLY@51..52 "{" | 65 | L_CURLY@51..52 "{" |
66 | R_CURLY@52..53 "}" | 66 | R_CURLY@52..53 "}" |
67 | WHITESPACE@53..55 "\n\n" | 67 | WHITESPACE@53..55 "\n\n" |
68 | FN_DEF@55..239 | 68 | FN@55..239 |
69 | FN_KW@55..57 "fn" | 69 | FN_KW@55..57 "fn" |
70 | WHITESPACE@57..58 " " | 70 | WHITESPACE@57..58 " " |
71 | NAME@58..62 | 71 | 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 88b086daf..4b9bd679e 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 @@ | |||
1 | SOURCE_FILE@0..575 | 1 | SOURCE_FILE@0..575 |
2 | FN_DEF@0..574 | 2 | FN@0..574 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | 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 4d6461d1e..53704f640 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 @@ | |||
1 | SOURCE_FILE@0..30 | 1 | SOURCE_FILE@0..30 |
2 | FN_DEF@0..29 | 2 | FN@0..29 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 0da8f59f0..bfcd0149e 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 @@ | |||
1 | SOURCE_FILE@0..24 | 1 | SOURCE_FILE@0..24 |
2 | FN_DEF@0..23 | 2 | FN@0..23 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 515819e42..55ff3943f 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 @@ | |||
1 | SOURCE_FILE@0..350 | 1 | SOURCE_FILE@0..350 |
2 | FN_DEF@0..349 | 2 | FN@0..349 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..8 | 5 | 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 c6859eca8..ec9f556aa 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 @@ | |||
1 | SOURCE_FILE@0..293 | 1 | SOURCE_FILE@0..293 |
2 | FN_DEF@0..292 | 2 | FN@0..292 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 53e445459..063532e02 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 @@ | |||
1 | SOURCE_FILE@0..89 | 1 | SOURCE_FILE@0..89 |
2 | FN_DEF@0..88 | 2 | FN@0..88 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 1b2ac5011..303a49576 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 @@ | |||
1 | SOURCE_FILE@0..91 | 1 | SOURCE_FILE@0..91 |
2 | FN_DEF@0..89 | 2 | FN@0..89 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | 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 0415085b0..2f03709eb 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 | |||
34 | USE@34..37 | 34 | USE@34..37 |
35 | USE_KW@34..37 "use" | 35 | USE_KW@34..37 "use" |
36 | WHITESPACE@37..38 "\n" | 36 | WHITESPACE@37..38 "\n" |
37 | FN_DEF@38..47 | 37 | FN@38..47 |
38 | FN_KW@38..40 "fn" | 38 | FN_KW@38..40 "fn" |
39 | WHITESPACE@40..41 " " | 39 | WHITESPACE@40..41 " " |
40 | NAME@41..42 | 40 | 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 bc446e3df..c0ba4fba9 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 | |||
17 | ASSOC_ITEM_LIST@14..117 | 17 | ASSOC_ITEM_LIST@14..117 |
18 | L_CURLY@14..15 "{" | 18 | L_CURLY@14..15 "{" |
19 | WHITESPACE@15..20 "\n " | 19 | WHITESPACE@15..20 "\n " |
20 | FN_DEF@20..31 | 20 | FN@20..31 |
21 | FN_KW@20..22 "fn" | 21 | FN_KW@20..22 "fn" |
22 | WHITESPACE@22..23 " " | 22 | WHITESPACE@22..23 " " |
23 | NAME@23..26 | 23 | NAME@23..26 |
@@ -30,7 +30,7 @@ SOURCE_FILE@0..118 | |||
30 | L_CURLY@29..30 "{" | 30 | L_CURLY@29..30 "{" |
31 | R_CURLY@30..31 "}" | 31 | R_CURLY@30..31 "}" |
32 | WHITESPACE@31..36 "\n " | 32 | WHITESPACE@31..36 "\n " |
33 | FN_DEF@36..51 | 33 | FN@36..51 |
34 | VISIBILITY@36..39 | 34 | VISIBILITY@36..39 |
35 | PUB_KW@36..39 "pub" | 35 | PUB_KW@36..39 "pub" |
36 | WHITESPACE@39..40 " " | 36 | WHITESPACE@39..40 " " |
@@ -46,7 +46,7 @@ SOURCE_FILE@0..118 | |||
46 | L_CURLY@49..50 "{" | 46 | L_CURLY@49..50 "{" |
47 | R_CURLY@50..51 "}" | 47 | R_CURLY@50..51 "}" |
48 | WHITESPACE@51..56 "\n " | 48 | WHITESPACE@51..56 "\n " |
49 | TYPE_ALIAS_DEF@56..81 | 49 | TYPE_ALIAS@56..81 |
50 | VISIBILITY@56..66 | 50 | VISIBILITY@56..66 |
51 | PUB_KW@56..59 "pub" | 51 | PUB_KW@56..59 "pub" |
52 | L_PAREN@59..60 "(" | 52 | L_PAREN@59..60 "(" |
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 21db9ee85..bed7ad6c3 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 @@ | |||
1 | SOURCE_FILE@0..33 | 1 | SOURCE_FILE@0..33 |
2 | FN_DEF@0..32 | 2 | FN@0..32 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | 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 ec950381b..a98c31b0c 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 @@ | |||
1 | SOURCE_FILE@0..83 | 1 | SOURCE_FILE@0..83 |
2 | FN_DEF@0..82 | 2 | FN@0..82 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 cb90f28bc..19b3540e9 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 | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..239 | 1 | SOURCE_FILE@0..239 |
2 | TYPE_ALIAS_DEF@0..30 | 2 | TYPE_ALIAS@0..30 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..11 | 5 | NAME@5..11 |
@@ -26,7 +26,7 @@ SOURCE_FILE@0..239 | |||
26 | IDENT@26..29 "u32" | 26 | IDENT@26..29 "u32" |
27 | SEMICOLON@29..30 ";" | 27 | SEMICOLON@29..30 ";" |
28 | WHITESPACE@30..31 "\n" | 28 | WHITESPACE@30..31 "\n" |
29 | TYPE_ALIAS_DEF@31..64 | 29 | TYPE_ALIAS@31..64 |
30 | TYPE_KW@31..35 "type" | 30 | TYPE_KW@31..35 "type" |
31 | WHITESPACE@35..36 " " | 31 | WHITESPACE@35..36 " " |
32 | NAME@36..42 | 32 | NAME@36..42 |
@@ -57,7 +57,7 @@ SOURCE_FILE@0..239 | |||
57 | R_PAREN@62..63 ")" | 57 | R_PAREN@62..63 ")" |
58 | SEMICOLON@63..64 ";" | 58 | SEMICOLON@63..64 ";" |
59 | WHITESPACE@64..65 "\n" | 59 | WHITESPACE@64..65 "\n" |
60 | TYPE_ALIAS_DEF@65..95 | 60 | TYPE_ALIAS@65..95 |
61 | TYPE_KW@65..69 "type" | 61 | TYPE_KW@65..69 "type" |
62 | WHITESPACE@69..70 " " | 62 | WHITESPACE@69..70 " " |
63 | NAME@70..78 | 63 | NAME@70..78 |
@@ -83,7 +83,7 @@ SOURCE_FILE@0..239 | |||
83 | R_BRACK@93..94 "]" | 83 | R_BRACK@93..94 "]" |
84 | SEMICOLON@94..95 ";" | 84 | SEMICOLON@94..95 ";" |
85 | WHITESPACE@95..96 "\n" | 85 | WHITESPACE@95..96 "\n" |
86 | TYPE_ALIAS_DEF@96..149 | 86 | TYPE_ALIAS@96..149 |
87 | TYPE_KW@96..100 "type" | 87 | TYPE_KW@96..100 "type" |
88 | WHITESPACE@100..101 " " | 88 | WHITESPACE@100..101 " " |
89 | NAME@101..109 | 89 | NAME@101..109 |
@@ -136,7 +136,7 @@ SOURCE_FILE@0..239 | |||
136 | R_PAREN@147..148 ")" | 136 | R_PAREN@147..148 ")" |
137 | SEMICOLON@148..149 ";" | 137 | SEMICOLON@148..149 ";" |
138 | WHITESPACE@149..150 "\n" | 138 | WHITESPACE@149..150 "\n" |
139 | FN_DEF@150..238 | 139 | FN@150..238 |
140 | FN_KW@150..152 "fn" | 140 | FN_KW@150..152 "fn" |
141 | WHITESPACE@152..153 " " | 141 | WHITESPACE@152..153 " " |
142 | NAME@153..164 | 142 | 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 e46456384..df29017e7 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 @@ | |||
1 | SOURCE_FILE@0..83 | 1 | SOURCE_FILE@0..83 |
2 | FN_DEF@0..82 | 2 | FN@0..82 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | 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 f1e78f388..93c429e12 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 @@ | |||
1 | FN_DEF@0..11 | 1 | FN@0..11 |
2 | FN_KW@0..2 "fn" | 2 | FN_KW@0..2 "fn" |
3 | WHITESPACE@2..3 " " | 3 | WHITESPACE@2..3 " " |
4 | NAME@3..6 | 4 | NAME@3..6 |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.rast b/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.rast index bf70ebca4..0b9bbec07 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..18 | 1 | SOURCE_FILE@0..18 |
2 | TYPE_ALIAS_DEF@0..12 | 2 | TYPE_ALIAS@0..12 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..6 | 5 | NAME@5..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 75668c818..8b0a888fd 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 @@ | |||
1 | SOURCE_FILE@0..30 | 1 | SOURCE_FILE@0..30 |
2 | FN_DEF@0..29 | 2 | FN@0..29 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | NAME@3..7 |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.rast b/crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.rast index 95bcc3c0a..2409eefe7 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..14 | 1 | SOURCE_FILE@0..14 |
2 | TYPE_ALIAS_DEF@0..13 | 2 | TYPE_ALIAS@0..13 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..6 | 5 | NAME@5..6 |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.rast b/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.rast index 90202d764..776022fd9 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..20 | 1 | SOURCE_FILE@0..20 |
2 | TYPE_ALIAS_DEF@0..15 | 2 | TYPE_ALIAS@0..15 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..6 | 5 | NAME@5..6 |
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 c789e8d82..cc0f8bcaf 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 @@ | |||
1 | SOURCE_FILE@0..33 | 1 | SOURCE_FILE@0..33 |
2 | FN_DEF@0..10 | 2 | FN@0..10 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | NAME@3..6 |
@@ -19,7 +19,7 @@ SOURCE_FILE@0..33 | |||
19 | WHITESPACE@19..20 " " | 19 | WHITESPACE@19..20 " " |
20 | R_CURLY@20..21 "}" | 20 | R_CURLY@20..21 "}" |
21 | WHITESPACE@21..22 " " | 21 | WHITESPACE@21..22 " " |
22 | FN_DEF@22..32 | 22 | FN@22..32 |
23 | FN_KW@22..24 "fn" | 23 | FN_KW@22..24 "fn" |
24 | WHITESPACE@24..25 " " | 24 | WHITESPACE@24..25 " " |
25 | NAME@25..28 | 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 cd24313d4..3f3a7f1b9 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 @@ | |||
1 | SOURCE_FILE@0..30 | 1 | SOURCE_FILE@0..30 |
2 | FN_DEF@0..29 | 2 | FN@0..29 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 c5fa7a404..63a10127d 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 @@ | |||
1 | SOURCE_FILE@0..21 | 1 | SOURCE_FILE@0..21 |
2 | FN_DEF@0..20 | 2 | FN@0..20 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 4e3fa704e..8fd8d5e59 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 @@ | |||
1 | SOURCE_FILE@0..48 | 1 | SOURCE_FILE@0..48 |
2 | FN_DEF@0..47 | 2 | FN@0..47 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 e1abc5633..fa14e1e6d 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 @@ | |||
1 | SOURCE_FILE@0..47 | 1 | SOURCE_FILE@0..47 |
2 | FN_DEF@0..46 | 2 | FN@0..46 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 53f7ebaf9..d2a18330f 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 | |||
2 | ERROR@0..6 | 2 | ERROR@0..6 |
3 | UNSAFE_KW@0..6 "unsafe" | 3 | UNSAFE_KW@0..6 "unsafe" |
4 | WHITESPACE@6..7 " " | 4 | WHITESPACE@6..7 " " |
5 | FN_DEF@7..24 | 5 | FN@7..24 |
6 | ASYNC_KW@7..12 "async" | 6 | ASYNC_KW@7..12 "async" |
7 | WHITESPACE@12..13 " " | 7 | WHITESPACE@12..13 " " |
8 | FN_KW@13..15 "fn" | 8 | 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 5501dc5a6..22c7c5f0d 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 | |||
@@ -14,7 +14,7 @@ SOURCE_FILE@0..62 | |||
14 | NAME_REF@14..21 | 14 | NAME_REF@14..21 |
15 | IDENT@14..21 "default" | 15 | IDENT@14..21 "default" |
16 | WHITESPACE@21..22 " " | 16 | WHITESPACE@21..22 " " |
17 | TYPE_ALIAS_DEF@22..35 | 17 | TYPE_ALIAS@22..35 |
18 | TYPE_KW@22..26 "type" | 18 | TYPE_KW@22..26 "type" |
19 | WHITESPACE@26..27 " " | 19 | WHITESPACE@26..27 " " |
20 | NAME@27..28 | 20 | NAME@27..28 |
@@ -35,7 +35,7 @@ SOURCE_FILE@0..62 | |||
35 | NAME_REF@40..47 | 35 | NAME_REF@40..47 |
36 | IDENT@40..47 "default" | 36 | IDENT@40..47 "default" |
37 | WHITESPACE@47..48 " " | 37 | WHITESPACE@47..48 " " |
38 | FN_DEF@48..59 | 38 | FN@48..59 |
39 | FN_KW@48..50 "fn" | 39 | FN_KW@48..50 "fn" |
40 | WHITESPACE@50..51 " " | 40 | WHITESPACE@50..51 " " |
41 | NAME@51..54 | 41 | 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 a9de44b57..6753c3fe7 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 @@ | |||
1 | SOURCE_FILE@0..45 | 1 | SOURCE_FILE@0..45 |
2 | FN_DEF@0..44 | 2 | FN@0..44 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | 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 f422acdda..a62ce23e6 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 | |||
@@ -11,7 +11,7 @@ SOURCE_FILE@0..83 | |||
11 | ASSOC_ITEM_LIST@7..82 | 11 | ASSOC_ITEM_LIST@7..82 |
12 | L_CURLY@7..8 "{" | 12 | L_CURLY@7..8 "{" |
13 | WHITESPACE@8..13 "\n " | 13 | WHITESPACE@8..13 "\n " |
14 | TYPE_ALIAS_DEF@13..27 | 14 | TYPE_ALIAS@13..27 |
15 | TYPE_KW@13..17 "type" | 15 | TYPE_KW@13..17 "type" |
16 | WHITESPACE@17..18 " " | 16 | WHITESPACE@17..18 " " |
17 | NAME@18..19 | 17 | NAME@18..19 |
@@ -41,7 +41,7 @@ SOURCE_FILE@0..83 | |||
41 | IDENT@41..44 "i32" | 41 | IDENT@41..44 "i32" |
42 | SEMICOLON@44..45 ";" | 42 | SEMICOLON@44..45 ";" |
43 | WHITESPACE@45..50 "\n " | 43 | WHITESPACE@45..50 "\n " |
44 | FN_DEF@50..61 | 44 | FN@50..61 |
45 | FN_KW@50..52 "fn" | 45 | FN_KW@50..52 "fn" |
46 | WHITESPACE@52..53 " " | 46 | WHITESPACE@52..53 " " |
47 | NAME@53..56 | 47 | NAME@53..56 |
@@ -54,7 +54,7 @@ SOURCE_FILE@0..83 | |||
54 | L_CURLY@59..60 "{" | 54 | L_CURLY@59..60 "{" |
55 | R_CURLY@60..61 "}" | 55 | R_CURLY@60..61 "}" |
56 | WHITESPACE@61..66 "\n " | 56 | WHITESPACE@61..66 "\n " |
57 | FN_DEF@66..80 | 57 | FN@66..80 |
58 | FN_KW@66..68 "fn" | 58 | FN_KW@66..68 "fn" |
59 | WHITESPACE@68..69 " " | 59 | WHITESPACE@68..69 " " |
60 | NAME@69..72 | 60 | 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 cd0892451..9cae1e8cc 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 @@ | |||
1 | SOURCE_FILE@0..54 | 1 | SOURCE_FILE@0..54 |
2 | FN_DEF@0..53 | 2 | FN@0..53 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..12 | 5 | NAME@3..12 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rast b/crates/ra_syntax/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rast index 20eba09f5..ace8ad050 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..39 | 1 | SOURCE_FILE@0..39 |
2 | TYPE_ALIAS_DEF@0..38 | 2 | TYPE_ALIAS@0..38 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..6 | 5 | NAME@5..6 |
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 6c8c1e24b..1b56e20d5 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 @@ | |||
1 | SOURCE_FILE@0..28 | 1 | SOURCE_FILE@0..28 |
2 | FN_DEF@0..27 | 2 | FN@0..27 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 0cd1dffc9..87c170707 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 | |||
11 | ASSOC_ITEM_LIST@7..127 | 11 | ASSOC_ITEM_LIST@7..127 |
12 | L_CURLY@7..8 "{" | 12 | L_CURLY@7..8 "{" |
13 | WHITESPACE@8..13 "\n " | 13 | WHITESPACE@8..13 "\n " |
14 | FN_DEF@13..26 | 14 | FN@13..26 |
15 | FN_KW@13..15 "fn" | 15 | FN_KW@13..15 "fn" |
16 | WHITESPACE@15..16 " " | 16 | WHITESPACE@15..16 " " |
17 | NAME@16..17 | 17 | NAME@16..17 |
@@ -26,7 +26,7 @@ SOURCE_FILE@0..128 | |||
26 | L_CURLY@24..25 "{" | 26 | L_CURLY@24..25 "{" |
27 | R_CURLY@25..26 "}" | 27 | R_CURLY@25..26 "}" |
28 | WHITESPACE@26..31 "\n " | 28 | WHITESPACE@26..31 "\n " |
29 | FN_DEF@31..46 | 29 | FN@31..46 |
30 | FN_KW@31..33 "fn" | 30 | FN_KW@31..33 "fn" |
31 | WHITESPACE@33..34 " " | 31 | WHITESPACE@33..34 " " |
32 | NAME@34..35 | 32 | NAME@34..35 |
@@ -43,7 +43,7 @@ SOURCE_FILE@0..128 | |||
43 | L_CURLY@44..45 "{" | 43 | L_CURLY@44..45 "{" |
44 | R_CURLY@45..46 "}" | 44 | R_CURLY@45..46 "}" |
45 | WHITESPACE@46..51 "\n " | 45 | WHITESPACE@46..51 "\n " |
46 | FN_DEF@51..69 | 46 | FN@51..69 |
47 | FN_KW@51..53 "fn" | 47 | FN_KW@51..53 "fn" |
48 | WHITESPACE@53..54 " " | 48 | WHITESPACE@53..54 " " |
49 | NAME@54..55 | 49 | NAME@54..55 |
@@ -62,7 +62,7 @@ SOURCE_FILE@0..128 | |||
62 | L_CURLY@67..68 "{" | 62 | L_CURLY@67..68 "{" |
63 | R_CURLY@68..69 "}" | 63 | R_CURLY@68..69 "}" |
64 | WHITESPACE@69..74 "\n " | 64 | WHITESPACE@69..74 "\n " |
65 | FN_DEF@74..103 | 65 | FN@74..103 |
66 | FN_KW@74..76 "fn" | 66 | FN_KW@74..76 "fn" |
67 | WHITESPACE@76..77 " " | 67 | WHITESPACE@76..77 " " |
68 | NAME@77..78 | 68 | NAME@77..78 |
@@ -95,7 +95,7 @@ SOURCE_FILE@0..128 | |||
95 | L_CURLY@101..102 "{" | 95 | L_CURLY@101..102 "{" |
96 | R_CURLY@102..103 "}" | 96 | R_CURLY@102..103 "}" |
97 | WHITESPACE@103..108 "\n " | 97 | WHITESPACE@103..108 "\n " |
98 | FN_DEF@108..125 | 98 | FN@108..125 |
99 | FN_KW@108..110 "fn" | 99 | FN_KW@108..110 "fn" |
100 | WHITESPACE@110..111 " " | 100 | WHITESPACE@110..111 " " |
101 | NAME@111..112 | 101 | 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 10eb31d68..3ce2acfae 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 @@ | |||
1 | SOURCE_FILE@0..103 | 1 | SOURCE_FILE@0..103 |
2 | FN_DEF@0..102 | 2 | FN@0..102 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 425e5196c..f62826fd5 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 @@ | |||
1 | SOURCE_FILE@0..26 | 1 | SOURCE_FILE@0..26 |
2 | FN_DEF@0..25 | 2 | FN@0..25 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 d823c08fc..66a609346 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 @@ | |||
1 | SOURCE_FILE@0..48 | 1 | SOURCE_FILE@0..48 |
2 | FN_DEF@0..47 | 2 | FN@0..47 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | NAME@3..6 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0012_type_item_where_clause.rast b/crates/ra_syntax/test_data/parser/inline/ok/0012_type_item_where_clause.rast index 283442a8b..28c94bfd6 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0012_type_item_where_clause.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0012_type_item_where_clause.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..31 | 1 | SOURCE_FILE@0..31 |
2 | TYPE_ALIAS_DEF@0..30 | 2 | TYPE_ALIAS@0..30 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..8 | 5 | NAME@5..8 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0013_pointer_type_mut.rast b/crates/ra_syntax/test_data/parser/inline/ok/0013_pointer_type_mut.rast index e2e871dda..845b32e6d 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0013_pointer_type_mut.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0013_pointer_type_mut.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..36 | 1 | SOURCE_FILE@0..36 |
2 | TYPE_ALIAS_DEF@0..17 | 2 | TYPE_ALIAS@0..17 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..6 | 5 | NAME@5..6 |
@@ -16,7 +16,7 @@ SOURCE_FILE@0..36 | |||
16 | R_PAREN@15..16 ")" | 16 | R_PAREN@15..16 ")" |
17 | SEMICOLON@16..17 ";" | 17 | SEMICOLON@16..17 ";" |
18 | WHITESPACE@17..18 "\n" | 18 | WHITESPACE@17..18 "\n" |
19 | TYPE_ALIAS_DEF@18..35 | 19 | TYPE_ALIAS@18..35 |
20 | TYPE_KW@18..22 "type" | 20 | TYPE_KW@18..22 "type" |
21 | WHITESPACE@22..23 " " | 21 | WHITESPACE@22..23 " " |
22 | NAME@23..24 | 22 | NAME@23..24 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0014_never_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0014_never_type.rast index a60940fcf..b1d5106ce 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0014_never_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0014_never_type.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..16 | 1 | SOURCE_FILE@0..16 |
2 | TYPE_ALIAS_DEF@0..15 | 2 | TYPE_ALIAS@0..15 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..10 | 5 | NAME@5..10 |
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 422912e3c..104e153ce 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 @@ | |||
1 | SOURCE_FILE@0..69 | 1 | SOURCE_FILE@0..69 |
2 | FN_DEF@0..68 | 2 | FN@0..68 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | NAME@3..6 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0017_array_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0017_array_type.rast index 61a0b22f4..c131df1c9 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0017_array_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0017_array_type.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..19 | 1 | SOURCE_FILE@0..19 |
2 | TYPE_ALIAS_DEF@0..18 | 2 | TYPE_ALIAS@0..18 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..6 | 5 | NAME@5..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 79148e953..e75180900 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 | |||
11 | ASSOC_ITEM_LIST@7..68 | 11 | ASSOC_ITEM_LIST@7..68 |
12 | L_CURLY@7..8 "{" | 12 | L_CURLY@7..8 "{" |
13 | WHITESPACE@8..13 "\n " | 13 | WHITESPACE@8..13 "\n " |
14 | FN_DEF@13..33 | 14 | FN@13..33 |
15 | FN_KW@13..15 "fn" | 15 | FN_KW@13..15 "fn" |
16 | WHITESPACE@15..16 " " | 16 | WHITESPACE@15..16 " " |
17 | NAME@16..17 | 17 | NAME@16..17 |
@@ -35,7 +35,7 @@ SOURCE_FILE@0..69 | |||
35 | L_CURLY@31..32 "{" | 35 | L_CURLY@31..32 "{" |
36 | R_CURLY@32..33 "}" | 36 | R_CURLY@32..33 "}" |
37 | WHITESPACE@33..38 "\n " | 37 | WHITESPACE@33..38 "\n " |
38 | FN_DEF@38..66 | 38 | FN@38..66 |
39 | FN_KW@38..40 "fn" | 39 | FN_KW@38..40 "fn" |
40 | WHITESPACE@40..41 " " | 40 | WHITESPACE@40..41 " " |
41 | NAME@41..42 | 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 10d6b2fde..7db38ea4d 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 @@ | |||
1 | SOURCE_FILE@0..44 | 1 | SOURCE_FILE@0..44 |
2 | FN_DEF@0..43 | 2 | FN@0..43 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 31b5b6616..3ae870e17 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 | |||
@@ -11,7 +11,7 @@ SOURCE_FILE@0..89 | |||
11 | ASSOC_ITEM_LIST@7..88 | 11 | ASSOC_ITEM_LIST@7..88 |
12 | L_CURLY@7..8 "{" | 12 | L_CURLY@7..8 "{" |
13 | WHITESPACE@8..13 "\n " | 13 | WHITESPACE@8..13 "\n " |
14 | TYPE_ALIAS_DEF@13..26 | 14 | TYPE_ALIAS@13..26 |
15 | TYPE_KW@13..17 "type" | 15 | TYPE_KW@13..17 "type" |
16 | WHITESPACE@17..18 " " | 16 | WHITESPACE@17..18 " " |
17 | NAME@18..19 | 17 | NAME@18..19 |
@@ -45,7 +45,7 @@ SOURCE_FILE@0..89 | |||
45 | INT_NUMBER@46..48 "92" | 45 | INT_NUMBER@46..48 "92" |
46 | SEMICOLON@48..49 ";" | 46 | SEMICOLON@48..49 ";" |
47 | WHITESPACE@49..54 "\n " | 47 | WHITESPACE@49..54 "\n " |
48 | FN_DEF@54..65 | 48 | FN@54..65 |
49 | FN_KW@54..56 "fn" | 49 | FN_KW@54..56 "fn" |
50 | WHITESPACE@56..57 " " | 50 | WHITESPACE@56..57 " " |
51 | NAME@57..60 | 51 | NAME@57..60 |
@@ -58,7 +58,7 @@ SOURCE_FILE@0..89 | |||
58 | L_CURLY@63..64 "{" | 58 | L_CURLY@63..64 "{" |
59 | R_CURLY@64..65 "}" | 59 | R_CURLY@64..65 "}" |
60 | WHITESPACE@65..70 "\n " | 60 | WHITESPACE@65..70 "\n " |
61 | FN_DEF@70..86 | 61 | FN@70..86 |
62 | FN_KW@70..72 "fn" | 62 | FN_KW@70..72 "fn" |
63 | WHITESPACE@72..73 " " | 63 | WHITESPACE@72..73 " " |
64 | NAME@73..76 | 64 | NAME@73..76 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0023_placeholder_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0023_placeholder_type.rast index 17687617b..57008e5fe 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0023_placeholder_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0023_placeholder_type.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..22 | 1 | SOURCE_FILE@0..22 |
2 | TYPE_ALIAS_DEF@0..21 | 2 | TYPE_ALIAS@0..21 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..16 | 5 | NAME@5..16 |
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 7eb27d5e1..dea0c73f7 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 @@ | |||
1 | SOURCE_FILE@0..39 | 1 | SOURCE_FILE@0..39 |
2 | FN_DEF@0..38 | 2 | FN@0..38 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | NAME@3..7 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0025_slice_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0025_slice_type.rast index 0a6d77f45..fd819ea37 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0025_slice_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0025_slice_type.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..15 | 1 | SOURCE_FILE@0..15 |
2 | TYPE_ALIAS_DEF@0..14 | 2 | TYPE_ALIAS@0..14 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..6 | 5 | NAME@5..6 |
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 b4598768e..e5f550347 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 @@ | |||
1 | SOURCE_FILE@0..97 | 1 | SOURCE_FILE@0..97 |
2 | FN_DEF@0..96 | 2 | FN@0..96 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 b824c10a8..9e76d881e 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 @@ | |||
1 | SOURCE_FILE@0..52 | 1 | SOURCE_FILE@0..52 |
2 | FN_DEF@0..51 | 2 | FN@0..51 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | NAME@3..7 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0028_impl_trait_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0028_impl_trait_type.rast index 93f5c738c..f45f3cab8 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0028_impl_trait_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0028_impl_trait_type.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..43 | 1 | SOURCE_FILE@0..43 |
2 | TYPE_ALIAS_DEF@0..42 | 2 | TYPE_ALIAS@0..42 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..6 | 5 | NAME@5..6 |
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 fabb09937..e096b3a1f 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 @@ | |||
1 | SOURCE_FILE@0..89 | 1 | SOURCE_FILE@0..89 |
2 | FN_DEF@0..88 | 2 | FN@0..88 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 3aed26732..381284dc5 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 @@ | |||
1 | SOURCE_FILE@0..197 | 1 | SOURCE_FILE@0..197 |
2 | FN_DEF@0..37 | 2 | FN@0..37 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | NAME@3..6 |
@@ -41,7 +41,7 @@ SOURCE_FILE@0..197 | |||
41 | WHITESPACE@35..36 " " | 41 | WHITESPACE@35..36 " " |
42 | R_CURLY@36..37 "}" | 42 | R_CURLY@36..37 "}" |
43 | WHITESPACE@37..38 "\n" | 43 | WHITESPACE@37..38 "\n" |
44 | FN_DEF@38..196 | 44 | FN@38..196 |
45 | FN_KW@38..40 "fn" | 45 | FN_KW@38..40 "fn" |
46 | WHITESPACE@40..41 " " | 46 | WHITESPACE@40..41 " " |
47 | NAME@41..44 | 47 | 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 899b63aac..ffe1a3a01 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 @@ | |||
1 | SOURCE_FILE@0..93 | 1 | SOURCE_FILE@0..93 |
2 | FN_DEF@0..92 | 2 | FN@0..92 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | NAME@3..6 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0032_fn_pointer_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0032_fn_pointer_type.rast index 72705e148..79a5ee339 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0032_fn_pointer_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0032_fn_pointer_type.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..113 | 1 | SOURCE_FILE@0..113 |
2 | TYPE_ALIAS_DEF@0..14 | 2 | TYPE_ALIAS@0..14 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..6 | 5 | NAME@5..6 |
@@ -14,7 +14,7 @@ SOURCE_FILE@0..113 | |||
14 | R_PAREN@12..13 ")" | 14 | R_PAREN@12..13 ")" |
15 | SEMICOLON@13..14 ";" | 15 | SEMICOLON@13..14 ";" |
16 | WHITESPACE@14..15 "\n" | 16 | WHITESPACE@14..15 "\n" |
17 | TYPE_ALIAS_DEF@15..36 | 17 | TYPE_ALIAS@15..36 |
18 | TYPE_KW@15..19 "type" | 18 | TYPE_KW@15..19 "type" |
19 | WHITESPACE@19..20 " " | 19 | WHITESPACE@19..20 " " |
20 | NAME@20..21 | 20 | NAME@20..21 |
@@ -31,7 +31,7 @@ SOURCE_FILE@0..113 | |||
31 | R_PAREN@34..35 ")" | 31 | R_PAREN@34..35 ")" |
32 | SEMICOLON@35..36 ";" | 32 | SEMICOLON@35..36 ";" |
33 | WHITESPACE@36..37 "\n" | 33 | WHITESPACE@36..37 "\n" |
34 | TYPE_ALIAS_DEF@37..69 | 34 | TYPE_ALIAS@37..69 |
35 | TYPE_KW@37..41 "type" | 35 | TYPE_KW@37..41 "type" |
36 | WHITESPACE@41..42 " " | 36 | WHITESPACE@41..42 " " |
37 | NAME@42..43 | 37 | NAME@42..43 |
@@ -53,7 +53,7 @@ SOURCE_FILE@0..113 | |||
53 | R_PAREN@67..68 ")" | 53 | R_PAREN@67..68 ")" |
54 | SEMICOLON@68..69 ";" | 54 | SEMICOLON@68..69 ";" |
55 | WHITESPACE@69..70 "\n" | 55 | WHITESPACE@69..70 "\n" |
56 | TYPE_ALIAS_DEF@70..112 | 56 | TYPE_ALIAS@70..112 |
57 | TYPE_KW@70..74 "type" | 57 | TYPE_KW@70..74 "type" |
58 | WHITESPACE@74..75 " " | 58 | WHITESPACE@74..75 " " |
59 | NAME@75..76 | 59 | NAME@75..76 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0033_reference_type;.rast b/crates/ra_syntax/test_data/parser/inline/ok/0033_reference_type;.rast index 784fbb592..c522f76cf 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0033_reference_type;.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0033_reference_type;.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..54 | 1 | SOURCE_FILE@0..54 |
2 | TYPE_ALIAS_DEF@0..13 | 2 | TYPE_ALIAS@0..13 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..6 | 5 | NAME@5..6 |
@@ -14,7 +14,7 @@ SOURCE_FILE@0..54 | |||
14 | R_PAREN@11..12 ")" | 14 | R_PAREN@11..12 ")" |
15 | SEMICOLON@12..13 ";" | 15 | SEMICOLON@12..13 ";" |
16 | WHITESPACE@13..14 "\n" | 16 | WHITESPACE@13..14 "\n" |
17 | TYPE_ALIAS_DEF@14..35 | 17 | TYPE_ALIAS@14..35 |
18 | TYPE_KW@14..18 "type" | 18 | TYPE_KW@14..18 "type" |
19 | WHITESPACE@18..19 " " | 19 | WHITESPACE@18..19 " " |
20 | NAME@19..20 | 20 | NAME@19..20 |
@@ -31,7 +31,7 @@ SOURCE_FILE@0..54 | |||
31 | R_PAREN@33..34 ")" | 31 | R_PAREN@33..34 ")" |
32 | SEMICOLON@34..35 ";" | 32 | SEMICOLON@34..35 ";" |
33 | WHITESPACE@35..36 "\n" | 33 | WHITESPACE@35..36 "\n" |
34 | TYPE_ALIAS_DEF@36..53 | 34 | TYPE_ALIAS@36..53 |
35 | TYPE_KW@36..40 "type" | 35 | TYPE_KW@36..40 "type" |
36 | WHITESPACE@40..41 " " | 36 | WHITESPACE@40..41 " " |
37 | NAME@41..42 | 37 | NAME@41..42 |
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 e064aafaf..f905def6f 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 @@ | |||
1 | SOURCE_FILE@0..102 | 1 | SOURCE_FILE@0..102 |
2 | FN_DEF@0..101 | 2 | FN@0..101 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 cf5825593..293b1d64c 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 @@ | |||
1 | SOURCE_FILE@0..30 | 1 | SOURCE_FILE@0..30 |
2 | FN_DEF@0..29 | 2 | FN@0..29 |
3 | UNSAFE_KW@0..6 "unsafe" | 3 | UNSAFE_KW@0..6 "unsafe" |
4 | WHITESPACE@6..7 " " | 4 | WHITESPACE@6..7 " " |
5 | ABI@7..17 | 5 | 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 fbd90bc0f..b6379e62f 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 | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..71 | 1 | SOURCE_FILE@0..71 |
2 | TYPE_ALIAS_DEF@0..26 | 2 | TYPE_ALIAS@0..26 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..6 | 5 | NAME@5..6 |
@@ -32,7 +32,7 @@ SOURCE_FILE@0..71 | |||
32 | IDENT@19..25 "Output" | 32 | IDENT@19..25 "Output" |
33 | SEMICOLON@25..26 ";" | 33 | SEMICOLON@25..26 ";" |
34 | WHITESPACE@26..27 "\n" | 34 | WHITESPACE@26..27 "\n" |
35 | FN_DEF@27..70 | 35 | FN@27..70 |
36 | FN_KW@27..29 "fn" | 36 | FN_KW@27..29 "fn" |
37 | WHITESPACE@29..30 " " | 37 | WHITESPACE@29..30 " " |
38 | NAME@30..33 | 38 | 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 a767f145d..64e705fb3 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 @@ | |||
1 | SOURCE_FILE@0..21 | 1 | SOURCE_FILE@0..21 |
2 | FN_DEF@0..20 | 2 | FN@0..20 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | NAME@3..6 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.rast b/crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.rast index e92ea2bf2..2185d3c91 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..46 | 1 | SOURCE_FILE@0..46 |
2 | TYPE_ALIAS_DEF@0..45 | 2 | TYPE_ALIAS@0..45 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..6 | 5 | NAME@5..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 aa582516a..47cbe7c1f 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 @@ | |||
1 | SOURCE_FILE@0..71 | 1 | SOURCE_FILE@0..71 |
2 | FN_DEF@0..19 | 2 | FN@0..19 |
3 | VISIBILITY@0..5 | 3 | VISIBILITY@0..5 |
4 | CRATE_KW@0..5 "crate" | 4 | CRATE_KW@0..5 "crate" |
5 | WHITESPACE@5..6 " " | 5 | 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 0c1c6e877..40875ae1e 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 @@ | |||
1 | SOURCE_FILE@0..118 | 1 | SOURCE_FILE@0..118 |
2 | FN_DEF@0..117 | 2 | FN@0..117 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 c23b3b67c..1fd3cd0e7 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 @@ | |||
1 | SOURCE_FILE@0..21 | 1 | SOURCE_FILE@0..21 |
2 | FN_DEF@0..20 | 2 | FN@0..20 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..4 | 5 | NAME@3..4 |
@@ -11,7 +11,7 @@ SOURCE_FILE@0..21 | |||
11 | BLOCK_EXPR@7..20 | 11 | BLOCK_EXPR@7..20 |
12 | L_CURLY@7..8 "{" | 12 | L_CURLY@7..8 "{" |
13 | WHITESPACE@8..9 " " | 13 | WHITESPACE@8..9 " " |
14 | FN_DEF@9..18 | 14 | FN@9..18 |
15 | FN_KW@9..11 "fn" | 15 | FN_KW@9..11 "fn" |
16 | WHITESPACE@11..12 " " | 16 | WHITESPACE@11..12 " " |
17 | NAME@12..13 | 17 | 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 9ca2165ba..fbf2e7c67 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 @@ | |||
1 | SOURCE_FILE@0..35 | 1 | SOURCE_FILE@0..35 |
2 | FN_DEF@0..34 | 2 | FN@0..34 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | NAME@3..6 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0046_singleton_tuple_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0046_singleton_tuple_type.rast index c28dc9d61..e89284c14 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0046_singleton_tuple_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0046_singleton_tuple_type.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..17 | 1 | SOURCE_FILE@0..17 |
2 | TYPE_ALIAS_DEF@0..16 | 2 | TYPE_ALIAS@0..16 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..6 | 5 | NAME@5..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 b209f67f8..37757ccd4 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 @@ | |||
1 | SOURCE_FILE@0..58 | 1 | SOURCE_FILE@0..58 |
2 | FN_DEF@0..26 | 2 | FN@0..26 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | NAME@3..6 |
@@ -38,7 +38,7 @@ SOURCE_FILE@0..58 | |||
38 | L_CURLY@24..25 "{" | 38 | L_CURLY@24..25 "{" |
39 | R_CURLY@25..26 "}" | 39 | R_CURLY@25..26 "}" |
40 | WHITESPACE@26..27 "\n" | 40 | WHITESPACE@26..27 "\n" |
41 | FN_DEF@27..57 | 41 | FN@27..57 |
42 | FN_KW@27..29 "fn" | 42 | FN_KW@27..29 "fn" |
43 | WHITESPACE@29..30 " " | 43 | WHITESPACE@29..30 " " |
44 | NAME@30..33 | 44 | 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 5f1429102..02c57079f 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 | |||
8 | ASSOC_ITEM_LIST@8..21 | 8 | ASSOC_ITEM_LIST@8..21 |
9 | L_CURLY@8..9 "{" | 9 | L_CURLY@8..9 "{" |
10 | WHITESPACE@9..10 " " | 10 | WHITESPACE@9..10 " " |
11 | FN_DEF@10..19 | 11 | FN@10..19 |
12 | FN_KW@10..12 "fn" | 12 | FN_KW@10..12 "fn" |
13 | WHITESPACE@12..13 " " | 13 | WHITESPACE@12..13 " " |
14 | NAME@13..16 | 14 | NAME@13..16 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0051_unit_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0051_unit_type.rast index 798ef2a48..6330dbf9e 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0051_unit_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0051_unit_type.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..13 | 1 | SOURCE_FILE@0..13 |
2 | TYPE_ALIAS_DEF@0..12 | 2 | TYPE_ALIAS@0..12 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..6 | 5 | NAME@5..6 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0052_path_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0052_path_type.rast index 0d2f5ff56..9bc36bea7 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0052_path_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0052_path_type.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..71 | 1 | SOURCE_FILE@0..71 |
2 | TYPE_ALIAS_DEF@0..13 | 2 | TYPE_ALIAS@0..13 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..6 | 5 | NAME@5..6 |
@@ -14,7 +14,7 @@ SOURCE_FILE@0..71 | |||
14 | IDENT@9..12 "Foo" | 14 | IDENT@9..12 "Foo" |
15 | SEMICOLON@12..13 ";" | 15 | SEMICOLON@12..13 ";" |
16 | WHITESPACE@13..14 "\n" | 16 | WHITESPACE@13..14 "\n" |
17 | TYPE_ALIAS_DEF@14..29 | 17 | TYPE_ALIAS@14..29 |
18 | TYPE_KW@14..18 "type" | 18 | TYPE_KW@14..18 "type" |
19 | WHITESPACE@18..19 " " | 19 | WHITESPACE@18..19 " " |
20 | NAME@19..20 | 20 | NAME@19..20 |
@@ -30,7 +30,7 @@ SOURCE_FILE@0..71 | |||
30 | IDENT@25..28 "Foo" | 30 | IDENT@25..28 "Foo" |
31 | SEMICOLON@28..29 ";" | 31 | SEMICOLON@28..29 ";" |
32 | WHITESPACE@29..30 "\n" | 32 | WHITESPACE@29..30 "\n" |
33 | TYPE_ALIAS_DEF@30..49 | 33 | TYPE_ALIAS@30..49 |
34 | TYPE_KW@30..34 "type" | 34 | TYPE_KW@30..34 "type" |
35 | WHITESPACE@34..35 " " | 35 | WHITESPACE@34..35 " " |
36 | NAME@35..36 | 36 | NAME@35..36 |
@@ -49,7 +49,7 @@ SOURCE_FILE@0..71 | |||
49 | IDENT@45..48 "Foo" | 49 | IDENT@45..48 "Foo" |
50 | SEMICOLON@48..49 ";" | 50 | SEMICOLON@48..49 ";" |
51 | WHITESPACE@49..50 "\n" | 51 | WHITESPACE@49..50 "\n" |
52 | TYPE_ALIAS_DEF@50..70 | 52 | TYPE_ALIAS@50..70 |
53 | TYPE_KW@50..54 "type" | 53 | TYPE_KW@50..54 "type" |
54 | WHITESPACE@54..55 " " | 54 | WHITESPACE@54..55 " " |
55 | NAME@55..56 | 55 | NAME@55..56 |
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 70232a3b2..2bfb52453 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 @@ | |||
1 | SOURCE_FILE@0..91 | 1 | SOURCE_FILE@0..91 |
2 | FN_DEF@0..90 | 2 | FN@0..90 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 03c52525e..68bb43852 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 @@ | |||
1 | SOURCE_FILE@0..113 | 1 | SOURCE_FILE@0..113 |
2 | FN_DEF@0..112 | 2 | FN@0..112 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | 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 24f89b83f..28129c50c 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 @@ | |||
1 | SOURCE_FILE@0..116 | 1 | SOURCE_FILE@0..116 |
2 | FN_DEF@0..115 | 2 | FN@0..115 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 bb43d1eaf..97548a5ee 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 @@ | |||
1 | SOURCE_FILE@0..18 | 1 | SOURCE_FILE@0..18 |
2 | FN_DEF@0..17 | 2 | FN@0..17 |
3 | CONST_KW@0..5 "const" | 3 | CONST_KW@0..5 "const" |
4 | WHITESPACE@5..6 " " | 4 | WHITESPACE@5..6 " " |
5 | FN_KW@6..8 "fn" | 5 | 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 8bd94a868..3e72f9671 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 @@ | |||
1 | SOURCE_FILE@0..112 | 1 | SOURCE_FILE@0..112 |
2 | FN_DEF@0..111 | 2 | FN@0..111 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | 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 9210f155c..fa659c19b 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 @@ | |||
1 | SOURCE_FILE@0..83 | 1 | SOURCE_FILE@0..83 |
2 | FN_DEF@0..82 | 2 | FN@0..82 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 850465d82..b0aa73b7d 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 @@ | |||
1 | SOURCE_FILE@0..112 | 1 | SOURCE_FILE@0..112 |
2 | FN_DEF@0..111 | 2 | FN@0..111 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 02656df31..f6417ab13 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 @@ | |||
1 | SOURCE_FILE@0..70 | 1 | SOURCE_FILE@0..70 |
2 | FN_DEF@0..11 | 2 | FN@0..11 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 445d8d309..587160003 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 @@ | |||
1 | SOURCE_FILE@0..137 | 1 | SOURCE_FILE@0..137 |
2 | FN_DEF@0..136 | 2 | FN@0..136 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | NAME@3..6 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0065_dyn_trait_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0065_dyn_trait_type.rast index 8e10f3673..629fea99d 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0065_dyn_trait_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0065_dyn_trait_type.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..42 | 1 | SOURCE_FILE@0..42 |
2 | TYPE_ALIAS_DEF@0..41 | 2 | TYPE_ALIAS@0..41 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..6 | 5 | NAME@5..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 177bb5514..d2279877b 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 @@ | |||
1 | SOURCE_FILE@0..167 | 1 | SOURCE_FILE@0..167 |
2 | FN_DEF@0..166 | 2 | FN@0..166 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 f8ff7079b..4c1165dc8 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 @@ | |||
1 | SOURCE_FILE@0..46 | 1 | SOURCE_FILE@0..46 |
2 | FN_DEF@0..45 | 2 | FN@0..45 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 07b3d1435..d6926425c 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 @@ | |||
1 | SOURCE_FILE@0..97 | 1 | SOURCE_FILE@0..97 |
2 | FN_DEF@0..96 | 2 | FN@0..96 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 665f716a8..437d7ac04 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 @@ | |||
1 | SOURCE_FILE@0..40 | 1 | SOURCE_FILE@0..40 |
2 | FN_DEF@0..39 | 2 | FN@0..39 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | NAME@3..6 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0073_type_item_type_params.rast b/crates/ra_syntax/test_data/parser/inline/ok/0073_type_item_type_params.rast index cc871ac0c..0123cb108 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0073_type_item_type_params.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0073_type_item_type_params.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..21 | 1 | SOURCE_FILE@0..21 |
2 | TYPE_ALIAS_DEF@0..20 | 2 | TYPE_ALIAS@0..20 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..11 | 5 | NAME@5..11 |
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 3fd3a4391..3ca70f021 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 @@ | |||
1 | SOURCE_FILE@0..84 | 1 | SOURCE_FILE@0..84 |
2 | FN_DEF@0..83 | 2 | FN@0..83 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 97c6e6a9d..5cefc5076 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 @@ | |||
1 | SOURCE_FILE@0..65 | 1 | SOURCE_FILE@0..65 |
2 | FN_DEF@0..9 | 2 | FN@0..9 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..4 | 5 | NAME@3..4 |
@@ -12,7 +12,7 @@ SOURCE_FILE@0..65 | |||
12 | L_CURLY@7..8 "{" | 12 | L_CURLY@7..8 "{" |
13 | R_CURLY@8..9 "}" | 13 | R_CURLY@8..9 "}" |
14 | WHITESPACE@9..10 "\n" | 14 | WHITESPACE@9..10 "\n" |
15 | FN_DEF@10..31 | 15 | FN@10..31 |
16 | FN_KW@10..12 "fn" | 16 | FN_KW@10..12 "fn" |
17 | WHITESPACE@12..13 " " | 17 | WHITESPACE@12..13 " " |
18 | NAME@13..14 | 18 | NAME@13..14 |
@@ -38,7 +38,7 @@ SOURCE_FILE@0..65 | |||
38 | WHITESPACE@29..30 " " | 38 | WHITESPACE@29..30 " " |
39 | R_CURLY@30..31 "}" | 39 | R_CURLY@30..31 "}" |
40 | WHITESPACE@31..32 "\n" | 40 | WHITESPACE@31..32 "\n" |
41 | FN_DEF@32..48 | 41 | FN@32..48 |
42 | FN_KW@32..34 "fn" | 42 | FN_KW@32..34 "fn" |
43 | WHITESPACE@34..35 " " | 43 | WHITESPACE@34..35 " " |
44 | NAME@35..36 | 44 | NAME@35..36 |
@@ -62,7 +62,7 @@ SOURCE_FILE@0..65 | |||
62 | WHITESPACE@46..47 " " | 62 | WHITESPACE@46..47 " " |
63 | R_CURLY@47..48 "}" | 63 | R_CURLY@47..48 "}" |
64 | WHITESPACE@48..49 "\n" | 64 | WHITESPACE@48..49 "\n" |
65 | FN_DEF@49..64 | 65 | FN@49..64 |
66 | FN_KW@49..51 "fn" | 66 | FN_KW@49..51 "fn" |
67 | WHITESPACE@51..52 " " | 67 | WHITESPACE@51..52 " " |
68 | NAME@52..53 | 68 | 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 e2c1a507d..cfa4c05f5 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 @@ | |||
1 | SOURCE_FILE@0..29 | 1 | SOURCE_FILE@0..29 |
2 | FN_DEF@0..28 | 2 | FN@0..28 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 4f3a8ed24..33e6fb93f 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 @@ | |||
1 | SOURCE_FILE@0..21 | 1 | SOURCE_FILE@0..21 |
2 | FN_DEF@0..20 | 2 | FN@0..20 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | NAME@3..6 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0078_type_item.rast b/crates/ra_syntax/test_data/parser/inline/ok/0078_type_item.rast index a08e16fab..2befc8388 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0078_type_item.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0078_type_item.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..16 | 1 | SOURCE_FILE@0..16 |
2 | TYPE_ALIAS_DEF@0..15 | 2 | TYPE_ALIAS@0..15 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..8 | 5 | NAME@5..8 |
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 462d1a8bb..3c80846db 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 @@ | |||
1 | SOURCE_FILE@0..89 | 1 | SOURCE_FILE@0..89 |
2 | FN_DEF@0..88 | 2 | FN@0..88 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | NAME@3..6 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0081_for_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0081_for_type.rast index b26ac2d36..175ec9844 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0081_for_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0081_for_type.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..121 | 1 | SOURCE_FILE@0..121 |
2 | TYPE_ALIAS_DEF@0..28 | 2 | TYPE_ALIAS@0..28 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..6 | 5 | NAME@5..6 |
@@ -29,7 +29,7 @@ SOURCE_FILE@0..121 | |||
29 | R_PAREN@26..27 ")" | 29 | R_PAREN@26..27 ")" |
30 | SEMICOLON@27..28 ";" | 30 | SEMICOLON@27..28 ";" |
31 | WHITESPACE@28..29 "\n" | 31 | WHITESPACE@28..29 "\n" |
32 | TYPE_ALIAS_DEF@29..81 | 32 | TYPE_ALIAS@29..81 |
33 | TYPE_KW@29..33 "type" | 33 | TYPE_KW@29..33 "type" |
34 | WHITESPACE@33..34 " " | 34 | WHITESPACE@33..34 " " |
35 | NAME@34..35 | 35 | NAME@34..35 |
@@ -74,7 +74,7 @@ SOURCE_FILE@0..121 | |||
74 | R_PAREN@79..80 ")" | 74 | R_PAREN@79..80 ")" |
75 | SEMICOLON@80..81 ";" | 75 | SEMICOLON@80..81 ";" |
76 | WHITESPACE@81..82 "\n" | 76 | WHITESPACE@81..82 "\n" |
77 | TYPE_ALIAS_DEF@82..120 | 77 | TYPE_ALIAS@82..120 |
78 | TYPE_KW@82..86 "type" | 78 | TYPE_KW@82..86 "type" |
79 | WHITESPACE@86..87 " " | 79 | WHITESPACE@86..87 " " |
80 | NAME@87..90 | 80 | NAME@87..90 |
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 58bdf7e34..1563b1988 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 @@ | |||
1 | SOURCE_FILE@0..200 | 1 | SOURCE_FILE@0..200 |
2 | FN_DEF@0..199 | 2 | FN@0..199 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | NAME@3..6 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0084_paren_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0084_paren_type.rast index 9cd8910d4..ee8894966 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0084_paren_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0084_paren_type.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..16 | 1 | SOURCE_FILE@0..16 |
2 | TYPE_ALIAS_DEF@0..15 | 2 | TYPE_ALIAS@0..15 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..6 | 5 | NAME@5..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 9fcb7899e..ded36949a 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 @@ | |||
1 | SOURCE_FILE@0..189 | 1 | SOURCE_FILE@0..189 |
2 | FN_DEF@0..188 | 2 | FN@0..188 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 a42abc189..70e05a859 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 @@ | |||
1 | SOURCE_FILE@0..30 | 1 | SOURCE_FILE@0..30 |
2 | FN_DEF@0..11 | 2 | FN@0..11 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | NAME@3..6 |
@@ -12,7 +12,7 @@ SOURCE_FILE@0..30 | |||
12 | L_CURLY@9..10 "{" | 12 | L_CURLY@9..10 "{" |
13 | R_CURLY@10..11 "}" | 13 | R_CURLY@10..11 "}" |
14 | WHITESPACE@11..12 "\n" | 14 | WHITESPACE@11..12 "\n" |
15 | FN_DEF@12..29 | 15 | FN@12..29 |
16 | FN_KW@12..14 "fn" | 16 | FN_KW@12..14 "fn" |
17 | WHITESPACE@14..15 " " | 17 | WHITESPACE@14..15 " " |
18 | NAME@15..18 | 18 | 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 7e71d7373..34f520994 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 @@ | |||
1 | SOURCE_FILE@0..88 | 1 | SOURCE_FILE@0..88 |
2 | FN_DEF@0..87 | 2 | FN@0..87 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 48aaf1004..405b6a259 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 @@ | |||
1 | SOURCE_FILE@0..19 | 1 | SOURCE_FILE@0..19 |
2 | FN_DEF@0..18 | 2 | FN@0..18 |
3 | ABI@0..6 | 3 | ABI@0..6 |
4 | EXTERN_KW@0..6 "extern" | 4 | EXTERN_KW@0..6 "extern" |
5 | WHITESPACE@6..7 " " | 5 | WHITESPACE@6..7 " " |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0092_fn_pointer_type_with_ret.rast b/crates/ra_syntax/test_data/parser/inline/ok/0092_fn_pointer_type_with_ret.rast index 1e2d7db7c..95686977f 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0092_fn_pointer_type_with_ret.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0092_fn_pointer_type_with_ret.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..21 | 1 | SOURCE_FILE@0..21 |
2 | TYPE_ALIAS_DEF@0..20 | 2 | TYPE_ALIAS@0..20 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..6 | 5 | NAME@5..6 |
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 aed81f9b0..82f03f9c1 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 @@ | |||
1 | SOURCE_FILE@0..26 | 1 | SOURCE_FILE@0..26 |
2 | FN_DEF@0..25 | 2 | FN@0..25 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 67d9595d3..25706d2a4 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 @@ | |||
1 | SOURCE_FILE@0..26 | 1 | SOURCE_FILE@0..26 |
2 | FN_DEF@0..25 | 2 | FN@0..25 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | 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 031e74652..cb5316a0d 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 @@ | |||
1 | SOURCE_FILE@0..167 | 1 | SOURCE_FILE@0..167 |
2 | FN_DEF@0..166 | 2 | FN@0..166 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 816e49310..32a77ba49 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 @@ | |||
1 | SOURCE_FILE@0..25 | 1 | SOURCE_FILE@0..25 |
2 | FN_DEF@0..24 | 2 | FN@0..24 |
3 | CONST_KW@0..5 "const" | 3 | CONST_KW@0..5 "const" |
4 | WHITESPACE@5..6 " " | 4 | WHITESPACE@5..6 " " |
5 | UNSAFE_KW@6..12 "unsafe" | 5 | 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 d48ef865c..1627556c8 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 @@ | |||
1 | SOURCE_FILE@0..67 | 1 | SOURCE_FILE@0..67 |
2 | FN_DEF@0..9 | 2 | FN@0..9 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..4 | 5 | NAME@3..4 |
@@ -12,7 +12,7 @@ SOURCE_FILE@0..67 | |||
12 | L_CURLY@7..8 "{" | 12 | L_CURLY@7..8 "{" |
13 | R_CURLY@8..9 "}" | 13 | R_CURLY@8..9 "}" |
14 | WHITESPACE@9..10 "\n" | 14 | WHITESPACE@9..10 "\n" |
15 | FN_DEF@10..25 | 15 | FN@10..25 |
16 | FN_KW@10..12 "fn" | 16 | FN_KW@10..12 "fn" |
17 | WHITESPACE@12..13 " " | 17 | WHITESPACE@12..13 " " |
18 | NAME@13..14 | 18 | NAME@13..14 |
@@ -36,7 +36,7 @@ SOURCE_FILE@0..67 | |||
36 | L_CURLY@23..24 "{" | 36 | L_CURLY@23..24 "{" |
37 | R_CURLY@24..25 "}" | 37 | R_CURLY@24..25 "}" |
38 | WHITESPACE@25..26 "\n" | 38 | WHITESPACE@25..26 "\n" |
39 | FN_DEF@26..43 | 39 | FN@26..43 |
40 | FN_KW@26..28 "fn" | 40 | FN_KW@26..28 "fn" |
41 | WHITESPACE@28..29 " " | 41 | WHITESPACE@28..29 " " |
42 | NAME@29..30 | 42 | NAME@29..30 |
@@ -62,7 +62,7 @@ SOURCE_FILE@0..67 | |||
62 | L_CURLY@41..42 "{" | 62 | L_CURLY@41..42 "{" |
63 | R_CURLY@42..43 "}" | 63 | R_CURLY@42..43 "}" |
64 | WHITESPACE@43..44 "\n" | 64 | WHITESPACE@43..44 "\n" |
65 | FN_DEF@44..66 | 65 | FN@44..66 |
66 | FN_KW@44..46 "fn" | 66 | FN_KW@44..46 "fn" |
67 | WHITESPACE@46..47 " " | 67 | WHITESPACE@46..47 " " |
68 | NAME@47..48 | 68 | 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 e4455cd3e..766de4efe 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 @@ | |||
1 | SOURCE_FILE@0..33 | 1 | SOURCE_FILE@0..33 |
2 | FN_DEF@0..32 | 2 | FN@0..32 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 8a8743060..73c94e5d4 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 @@ | |||
1 | SOURCE_FILE@0..19 | 1 | SOURCE_FILE@0..19 |
2 | FN_DEF@0..18 | 2 | FN@0..18 |
3 | UNSAFE_KW@0..6 "unsafe" | 3 | UNSAFE_KW@0..6 "unsafe" |
4 | WHITESPACE@6..7 " " | 4 | WHITESPACE@6..7 " " |
5 | FN_KW@7..9 "fn" | 5 | 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 9f966ff8a..fe1c290c3 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 @@ | |||
1 | SOURCE_FILE@0..119 | 1 | SOURCE_FILE@0..119 |
2 | FN_DEF@0..118 | 2 | FN@0..118 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 9b3bef04e..c4c0a0568 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 @@ | |||
1 | SOURCE_FILE@0..55 | 1 | SOURCE_FILE@0..55 |
2 | FN_DEF@0..54 | 2 | FN@0..54 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | NAME@3..6 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0104_path_fn_trait_args.rast b/crates/ra_syntax/test_data/parser/inline/ok/0104_path_fn_trait_args.rast index e3c4cfeb3..3f53d60c0 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0104_path_fn_trait_args.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0104_path_fn_trait_args.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..29 | 1 | SOURCE_FILE@0..29 |
2 | TYPE_ALIAS_DEF@0..28 | 2 | TYPE_ALIAS@0..28 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..6 | 5 | NAME@5..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 e64717152..51a6c5170 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 @@ | |||
1 | SOURCE_FILE@0..134 | 1 | SOURCE_FILE@0..134 |
2 | FN_DEF@0..133 | 2 | FN@0..133 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 98963dc62..b2961b0ff 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 @@ | |||
1 | SOURCE_FILE@0..49 | 1 | SOURCE_FILE@0..49 |
2 | FN_DEF@0..48 | 2 | FN@0..48 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 ea603e2c9..ca7e4a5c3 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 @@ | |||
1 | SOURCE_FILE@0..40 | 1 | SOURCE_FILE@0..40 |
2 | FN_DEF@0..39 | 2 | FN@0..39 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 30ff96a7c..a6a169f1b 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 @@ | |||
1 | SOURCE_FILE@0..74 | 1 | SOURCE_FILE@0..74 |
2 | FN_DEF@0..73 | 2 | FN@0..73 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 b58f40ac1..432318da0 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 @@ | |||
1 | SOURCE_FILE@0..94 | 1 | SOURCE_FILE@0..94 |
2 | FN_DEF@0..93 | 2 | FN@0..93 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | 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 b67714c17..3cd554d45 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 @@ | |||
1 | SOURCE_FILE@0..146 | 1 | SOURCE_FILE@0..146 |
2 | FN_DEF@0..145 | 2 | FN@0..145 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | 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 5de480da9..d761c1c68 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 @@ | |||
1 | SOURCE_FILE@0..50 | 1 | SOURCE_FILE@0..50 |
2 | FN_DEF@0..49 | 2 | FN@0..49 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | NAME@3..6 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0117_macro_call_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0117_macro_call_type.rast index ddfcf974e..f3d4ad72c 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0117_macro_call_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0117_macro_call_type.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..41 | 1 | SOURCE_FILE@0..41 |
2 | TYPE_ALIAS_DEF@0..16 | 2 | TYPE_ALIAS@0..16 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..6 | 5 | NAME@5..6 |
@@ -18,7 +18,7 @@ SOURCE_FILE@0..41 | |||
18 | R_PAREN@14..15 ")" | 18 | R_PAREN@14..15 ")" |
19 | SEMICOLON@15..16 ";" | 19 | SEMICOLON@15..16 ";" |
20 | WHITESPACE@16..17 "\n" | 20 | WHITESPACE@16..17 "\n" |
21 | TYPE_ALIAS_DEF@17..40 | 21 | TYPE_ALIAS@17..40 |
22 | TYPE_KW@17..21 "type" | 22 | TYPE_KW@17..21 "type" |
23 | WHITESPACE@21..22 " " | 23 | WHITESPACE@21..22 " " |
24 | NAME@22..23 | 24 | NAME@22..23 |
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 e152c6b6c..aaaf803b7 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 @@ | |||
1 | SOURCE_FILE@0..58 | 1 | SOURCE_FILE@0..58 |
2 | FN_DEF@0..57 | 2 | FN@0..57 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 b283ab804..4b5f9cdc9 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 @@ | |||
1 | SOURCE_FILE@0..139 | 1 | SOURCE_FILE@0..139 |
2 | FN_DEF@0..138 | 2 | FN@0..138 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 9d5470914..54cc3be3a 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 @@ | |||
1 | SOURCE_FILE@0..259 | 1 | SOURCE_FILE@0..259 |
2 | FN_DEF@0..258 | 2 | FN@0..258 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 ada2fc54e..f4008cfdc 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 @@ | |||
1 | SOURCE_FILE@0..64 | 1 | SOURCE_FILE@0..64 |
2 | FN_DEF@0..63 | 2 | FN@0..63 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 b3a33c14d..f155743cf 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 | |||
8 | EXTERN_ITEM_LIST@11..56 | 8 | EXTERN_ITEM_LIST@11..56 |
9 | L_CURLY@11..12 "{" | 9 | L_CURLY@11..12 "{" |
10 | WHITESPACE@12..13 " " | 10 | WHITESPACE@12..13 " " |
11 | FN_DEF@13..54 | 11 | FN@13..54 |
12 | FN_KW@13..15 "fn" | 12 | FN_KW@13..15 "fn" |
13 | WHITESPACE@15..16 " " | 13 | WHITESPACE@15..16 " " |
14 | NAME@16..22 | 14 | 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 6178dfe59..a7df188bd 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 @@ | |||
1 | SOURCE_FILE@0..18 | 1 | SOURCE_FILE@0..18 |
2 | FN_DEF@0..17 | 2 | FN@0..17 |
3 | ASYNC_KW@0..5 "async" | 3 | ASYNC_KW@0..5 "async" |
4 | WHITESPACE@5..6 " " | 4 | WHITESPACE@5..6 " " |
5 | FN_KW@6..8 "fn" | 5 | 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 ced59b7c1..aa4d7a784 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 @@ | |||
1 | SOURCE_FILE@0..27 | 1 | SOURCE_FILE@0..27 |
2 | FN_DEF@0..26 | 2 | FN@0..26 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 97611f7f3..20979cef3 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 @@ | |||
1 | SOURCE_FILE@0..46 | 1 | SOURCE_FILE@0..46 |
2 | FN_DEF@0..45 | 2 | FN@0..45 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | 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 09221fc54..0342e64f3 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 @@ | |||
1 | SOURCE_FILE@0..82 | 1 | SOURCE_FILE@0..82 |
2 | FN_DEF@0..81 | 2 | FN@0..81 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 93cc41533..3b46e5b47 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 @@ | |||
1 | SOURCE_FILE@0..47 | 1 | SOURCE_FILE@0..47 |
2 | FN_DEF@0..46 | 2 | FN@0..46 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 0901f2348..98a20f36d 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 @@ | |||
1 | SOURCE_FILE@0..50 | 1 | SOURCE_FILE@0..50 |
2 | FN_DEF@0..24 | 2 | FN@0..24 |
3 | ASYNC_KW@0..5 "async" | 3 | ASYNC_KW@0..5 "async" |
4 | WHITESPACE@5..6 " " | 4 | WHITESPACE@5..6 " " |
5 | UNSAFE_KW@6..12 "unsafe" | 5 | UNSAFE_KW@6..12 "unsafe" |
@@ -16,7 +16,7 @@ SOURCE_FILE@0..50 | |||
16 | L_CURLY@22..23 "{" | 16 | L_CURLY@22..23 "{" |
17 | R_CURLY@23..24 "}" | 17 | R_CURLY@23..24 "}" |
18 | WHITESPACE@24..25 "\n" | 18 | WHITESPACE@24..25 "\n" |
19 | FN_DEF@25..49 | 19 | FN@25..49 |
20 | CONST_KW@25..30 "const" | 20 | CONST_KW@25..30 "const" |
21 | WHITESPACE@30..31 " " | 21 | WHITESPACE@30..31 " " |
22 | UNSAFE_KW@31..37 "unsafe" | 22 | 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 28291afc2..e283966ca 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 @@ | |||
1 | SOURCE_FILE@0..33 | 1 | SOURCE_FILE@0..33 |
2 | FN_DEF@0..32 | 2 | FN@0..32 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | 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 bb94a05c6..931e81f27 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 @@ | |||
1 | SOURCE_FILE@0..135 | 1 | SOURCE_FILE@0..135 |
2 | FN_DEF@0..134 | 2 | FN@0..134 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 8f2f144c7..0fe3bf582 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 @@ | |||
1 | SOURCE_FILE@0..33 | 1 | SOURCE_FILE@0..33 |
2 | FN_DEF@0..32 | 2 | FN@0..32 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | NAME@3..6 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0131_existential_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0131_existential_type.rast index 4a1c2b3a4..d47071a91 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0131_existential_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0131_existential_type.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..37 | 1 | SOURCE_FILE@0..37 |
2 | TYPE_ALIAS_DEF@0..36 | 2 | TYPE_ALIAS@0..36 |
3 | EXISTENTIAL_KW@0..11 "existential" | 3 | EXISTENTIAL_KW@0..11 "existential" |
4 | WHITESPACE@11..12 " " | 4 | WHITESPACE@11..12 " " |
5 | TYPE_KW@12..16 "type" | 5 | TYPE_KW@12..16 "type" |
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 87ac42748..48f483813 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 @@ | |||
1 | SOURCE_FILE@0..106 | 1 | SOURCE_FILE@0..106 |
2 | FN_DEF@0..105 | 2 | FN@0..105 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 3772cb64b..de02238df 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 | |||
@@ -19,7 +19,7 @@ SOURCE_FILE@0..69 | |||
19 | ASSOC_ITEM_LIST@15..68 | 19 | ASSOC_ITEM_LIST@15..68 |
20 | L_CURLY@15..16 "{" | 20 | L_CURLY@15..16 "{" |
21 | WHITESPACE@16..21 "\n " | 21 | WHITESPACE@16..21 "\n " |
22 | TYPE_ALIAS_DEF@21..42 | 22 | TYPE_ALIAS@21..42 |
23 | DEFAULT_KW@21..28 "default" | 23 | DEFAULT_KW@21..28 "default" |
24 | WHITESPACE@28..29 " " | 24 | WHITESPACE@28..29 " " |
25 | TYPE_KW@29..33 "type" | 25 | TYPE_KW@29..33 "type" |
@@ -36,7 +36,7 @@ SOURCE_FILE@0..69 | |||
36 | IDENT@38..41 "Bar" | 36 | IDENT@38..41 "Bar" |
37 | SEMICOLON@41..42 ";" | 37 | SEMICOLON@41..42 ";" |
38 | WHITESPACE@42..47 "\n " | 38 | WHITESPACE@42..47 "\n " |
39 | FN_DEF@47..66 | 39 | FN@47..66 |
40 | DEFAULT_KW@47..54 "default" | 40 | DEFAULT_KW@47..54 "default" |
41 | WHITESPACE@54..55 " " | 41 | WHITESPACE@54..55 " " |
42 | FN_KW@55..57 "fn" | 42 | 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 b330a0932..ceae8a4ec 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 @@ | |||
1 | SOURCE_FILE@0..111 | 1 | SOURCE_FILE@0..111 |
2 | FN_DEF@0..110 | 2 | FN@0..110 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..18 | 5 | NAME@3..18 |
@@ -33,7 +33,7 @@ SOURCE_FILE@0..111 | |||
33 | R_CURLY@74..75 "}" | 33 | R_CURLY@74..75 "}" |
34 | SEMICOLON@75..76 ";" | 34 | SEMICOLON@75..76 ";" |
35 | WHITESPACE@76..81 "\n " | 35 | WHITESPACE@76..81 "\n " |
36 | FN_DEF@81..90 | 36 | FN@81..90 |
37 | FN_KW@81..83 "fn" | 37 | FN_KW@81..83 "fn" |
38 | WHITESPACE@83..84 " " | 38 | WHITESPACE@83..84 " " |
39 | NAME@84..85 | 39 | 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 8e8d9e992..923effe38 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 @@ | |||
1 | SOURCE_FILE@0..67 | 1 | SOURCE_FILE@0..67 |
2 | FN_DEF@0..66 | 2 | FN@0..66 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 c457851c9..1ad03e005 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 @@ | |||
1 | SOURCE_FILE@0..59 | 1 | SOURCE_FILE@0..59 |
2 | FN_DEF@0..58 | 2 | FN@0..58 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..12 | 5 | 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 ea325831e..a03139ab5 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 @@ | |||
1 | SOURCE_FILE@0..52 | 1 | SOURCE_FILE@0..52 |
2 | FN_DEF@0..51 | 2 | FN@0..51 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 9135de9df..6403ff8d5 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 @@ | |||
1 | SOURCE_FILE@0..26 | 1 | SOURCE_FILE@0..26 |
2 | FN_DEF@0..25 | 2 | FN@0..25 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..4 | 5 | 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 14610a0a2..36fd2997b 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 @@ | |||
1 | SOURCE_FILE@0..28 | 1 | SOURCE_FILE@0..28 |
2 | FN_DEF@0..27 | 2 | FN@0..27 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..4 | 5 | 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 e6be8b7e4..d11019076 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 @@ | |||
1 | SOURCE_FILE@0..51 | 1 | SOURCE_FILE@0..51 |
2 | FN_DEF@0..50 | 2 | FN@0..50 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 57fba5fd5..09fd9e9b8 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 @@ | |||
1 | SOURCE_FILE@0..118 | 1 | SOURCE_FILE@0..118 |
2 | FN_DEF@0..117 | 2 | FN@0..117 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | 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 8d8b9597b..8d0f1ead5 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 @@ | |||
1 | SOURCE_FILE@0..555 | 1 | SOURCE_FILE@0..555 |
2 | FN_DEF@0..554 | 2 | FN@0..554 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | 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 7c092d518..b41ef4098 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 @@ | |||
1 | SOURCE_FILE@0..63 | 1 | SOURCE_FILE@0..63 |
2 | FN_DEF@0..62 | 2 | FN@0..62 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 8382a4f96..2d0c83458 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 @@ | |||
1 | SOURCE_FILE@0..43 | 1 | SOURCE_FILE@0..43 |
2 | FN_DEF@0..42 | 2 | FN@0..42 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 f43dfbe63..2905c5f1a 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 @@ | |||
1 | SOURCE_FILE@0..34 | 1 | SOURCE_FILE@0..34 |
2 | FN_DEF@0..33 | 2 | FN@0..33 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | NAME@3..7 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0154_fn_pointer_param_ident_path.rast b/crates/ra_syntax/test_data/parser/inline/ok/0154_fn_pointer_param_ident_path.rast index 861065362..69b4d73d7 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0154_fn_pointer_param_ident_path.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0154_fn_pointer_param_ident_path.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..55 | 1 | SOURCE_FILE@0..55 |
2 | TYPE_ALIAS_DEF@0..24 | 2 | TYPE_ALIAS@0..24 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..8 | 5 | NAME@5..8 |
@@ -25,7 +25,7 @@ SOURCE_FILE@0..55 | |||
25 | R_PAREN@22..23 ")" | 25 | R_PAREN@22..23 ")" |
26 | SEMICOLON@23..24 ";" | 26 | SEMICOLON@23..24 ";" |
27 | WHITESPACE@24..25 "\n" | 27 | WHITESPACE@24..25 "\n" |
28 | TYPE_ALIAS_DEF@25..54 | 28 | TYPE_ALIAS@25..54 |
29 | TYPE_KW@25..29 "type" | 29 | TYPE_KW@25..29 "type" |
30 | WHITESPACE@29..30 " " | 30 | WHITESPACE@29..30 " " |
31 | NAME@30..33 | 31 | NAME@30..33 |
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 ecac05950..c63a55a56 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 @@ | |||
1 | SOURCE_FILE@0..63 | 1 | SOURCE_FILE@0..63 |
2 | FN_DEF@0..62 | 2 | FN@0..62 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | 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 092833417..3b8dfefc6 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 @@ | |||
1 | SOURCE_FILE@0..30 | 1 | SOURCE_FILE@0..30 |
2 | FN_DEF@0..29 | 2 | FN@0..29 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 88d512f1a..4d4c41f1a 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 @@ | |||
1 | SOURCE_FILE@0..130 | 1 | SOURCE_FILE@0..130 |
2 | FN_DEF@0..129 | 2 | FN@0..129 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | NAME@3..7 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0157_fn_pointer_unnamed_arg.rast b/crates/ra_syntax/test_data/parser/inline/ok/0157_fn_pointer_unnamed_arg.rast index fad9df007..ccca045b6 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0157_fn_pointer_unnamed_arg.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0157_fn_pointer_unnamed_arg.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..23 | 1 | SOURCE_FILE@0..23 |
2 | TYPE_ALIAS_DEF@0..22 | 2 | TYPE_ALIAS@0..22 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..8 | 5 | NAME@5..8 |
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 bd9e8d40f..8ae24b9c1 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 @@ | |||
1 | SOURCE_FILE@0..28 | 1 | SOURCE_FILE@0..28 |
2 | FN_DEF@0..27 | 2 | FN@0..27 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 08333a325..9c071ec2e 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 @@ | |||
1 | SOURCE_FILE@0..34 | 1 | SOURCE_FILE@0..34 |
2 | FN_DEF@0..33 | 2 | FN@0..33 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | 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 5f09e4f4a..fb46d4ce4 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 @@ | |||
1 | SOURCE_FILE@0..27 | 1 | SOURCE_FILE@0..27 |
2 | FN_DEF@0..26 | 2 | FN@0..26 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 9efebd8b8..9e9a5f9c5 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 @@ | |||
1 | SOURCE_FILE@0..23 | 1 | SOURCE_FILE@0..23 |
2 | FN_DEF@0..22 | 2 | FN@0..22 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..4 | 5 | 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 4991f2c36..ca9a1183d 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 @@ | |||
1 | SOURCE_FILE@0..22 | 1 | SOURCE_FILE@0..22 |
2 | FN_DEF@0..21 | 2 | FN@0..21 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..4 | 5 | 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 c0b8c0300..680f35445 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 | |||
19 | ASSOC_ITEM_LIST@15..49 | 19 | ASSOC_ITEM_LIST@15..49 |
20 | L_CURLY@15..16 "{" | 20 | L_CURLY@15..16 "{" |
21 | WHITESPACE@16..21 "\n " | 21 | WHITESPACE@16..21 "\n " |
22 | FN_DEF@21..47 | 22 | FN@21..47 |
23 | DEFAULT_KW@21..28 "default" | 23 | DEFAULT_KW@21..28 "default" |
24 | WHITESPACE@28..29 " " | 24 | WHITESPACE@28..29 " " |
25 | UNSAFE_KW@29..35 "unsafe" | 25 | 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 868899275..f5e20b93d 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 @@ | |||
1 | SOURCE_FILE@0..33 | 1 | SOURCE_FILE@0..33 |
2 | FN_DEF@0..32 | 2 | FN@0..32 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | 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 0ec237f8e..a7a2b11a7 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 @@ | |||
1 | SOURCE_FILE@0..13 | 1 | SOURCE_FILE@0..13 |
2 | FN_DEF@0..12 | 2 | FN@0..12 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 37b452ec4..ea26f1440 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 | |||
26 | ITEM_LIST@25..65 | 26 | ITEM_LIST@25..65 |
27 | L_CURLY@25..26 "{" | 27 | L_CURLY@25..26 "{" |
28 | WHITESPACE@26..31 "\n " | 28 | WHITESPACE@26..31 "\n " |
29 | FN_DEF@31..47 | 29 | FN@31..47 |
30 | FN_KW@31..33 "fn" | 30 | FN_KW@31..33 "fn" |
31 | WHITESPACE@33..34 " " | 31 | WHITESPACE@33..34 " " |
32 | NAME@34..37 | 32 | 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 0b9bc58e8..478fdba75 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 @@ | |||
1 | SOURCE_FILE@0..60 | 1 | SOURCE_FILE@0..60 |
2 | FN_DEF@0..34 | 2 | FN@0..34 |
3 | ATTR@0..12 | 3 | ATTR@0..12 |
4 | POUND@0..1 "#" | 4 | POUND@0..1 "#" |
5 | L_BRACK@1..2 "[" | 5 | 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 980b34049..83a93b5a9 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 @@ | |||
1 | SOURCE_FILE@0..98 | 1 | SOURCE_FILE@0..98 |
2 | FN_DEF@0..9 | 2 | FN@0..9 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..4 | 5 | NAME@3..4 |
@@ -12,7 +12,7 @@ SOURCE_FILE@0..98 | |||
12 | L_CURLY@7..8 "{" | 12 | L_CURLY@7..8 "{" |
13 | R_CURLY@8..9 "}" | 13 | R_CURLY@8..9 "}" |
14 | WHITESPACE@9..10 "\n" | 14 | WHITESPACE@9..10 "\n" |
15 | FN_DEF@10..23 | 15 | FN@10..23 |
16 | VISIBILITY@10..13 | 16 | VISIBILITY@10..13 |
17 | PUB_KW@10..13 "pub" | 17 | PUB_KW@10..13 "pub" |
18 | WHITESPACE@13..14 " " | 18 | WHITESPACE@13..14 " " |
@@ -28,7 +28,7 @@ SOURCE_FILE@0..98 | |||
28 | L_CURLY@21..22 "{" | 28 | L_CURLY@21..22 "{" |
29 | R_CURLY@22..23 "}" | 29 | R_CURLY@22..23 "}" |
30 | WHITESPACE@23..24 "\n" | 30 | WHITESPACE@23..24 "\n" |
31 | FN_DEF@24..44 | 31 | FN@24..44 |
32 | VISIBILITY@24..34 | 32 | VISIBILITY@24..34 |
33 | PUB_KW@24..27 "pub" | 33 | PUB_KW@24..27 "pub" |
34 | L_PAREN@27..28 "(" | 34 | L_PAREN@27..28 "(" |
@@ -47,7 +47,7 @@ SOURCE_FILE@0..98 | |||
47 | L_CURLY@42..43 "{" | 47 | L_CURLY@42..43 "{" |
48 | R_CURLY@43..44 "}" | 48 | R_CURLY@43..44 "}" |
49 | WHITESPACE@44..45 "\n" | 49 | WHITESPACE@44..45 "\n" |
50 | FN_DEF@45..65 | 50 | FN@45..65 |
51 | VISIBILITY@45..55 | 51 | VISIBILITY@45..55 |
52 | PUB_KW@45..48 "pub" | 52 | PUB_KW@45..48 "pub" |
53 | L_PAREN@48..49 "(" | 53 | L_PAREN@48..49 "(" |
@@ -66,7 +66,7 @@ SOURCE_FILE@0..98 | |||
66 | L_CURLY@63..64 "{" | 66 | L_CURLY@63..64 "{" |
67 | R_CURLY@64..65 "}" | 67 | R_CURLY@64..65 "}" |
68 | WHITESPACE@65..66 "\n" | 68 | WHITESPACE@65..66 "\n" |
69 | FN_DEF@66..97 | 69 | FN@66..97 |
70 | VISIBILITY@66..87 | 70 | VISIBILITY@66..87 |
71 | PUB_KW@66..69 "pub" | 71 | PUB_KW@66..69 "pub" |
72 | L_PAREN@69..70 "(" | 72 | 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 964cbf5dd..a3e091ad3 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 @@ | |||
1 | SOURCE_FILE@0..23 | 1 | SOURCE_FILE@0..23 |
2 | FN_DEF@0..22 | 2 | FN@0..22 |
3 | ATTR@0..10 | 3 | ATTR@0..10 |
4 | POUND@0..1 "#" | 4 | POUND@0..1 "#" |
5 | L_BRACK@1..2 "[" | 5 | 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 873791f50..5524efaaf 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 @@ | |||
1 | SOURCE_FILE@0..71 | 1 | SOURCE_FILE@0..71 |
2 | FN_DEF@0..19 | 2 | FN@0..19 |
3 | ABI@0..6 | 3 | ABI@0..6 |
4 | EXTERN_KW@0..6 "extern" | 4 | EXTERN_KW@0..6 "extern" |
5 | WHITESPACE@6..7 " " | 5 | WHITESPACE@6..7 " " |
@@ -16,7 +16,7 @@ SOURCE_FILE@0..71 | |||
16 | WHITESPACE@17..18 "\n" | 16 | WHITESPACE@17..18 "\n" |
17 | R_CURLY@18..19 "}" | 17 | R_CURLY@18..19 "}" |
18 | WHITESPACE@19..21 "\n\n" | 18 | WHITESPACE@19..21 "\n\n" |
19 | FN_DEF@21..44 | 19 | FN@21..44 |
20 | ABI@21..31 | 20 | ABI@21..31 |
21 | EXTERN_KW@21..27 "extern" | 21 | EXTERN_KW@21..27 "extern" |
22 | WHITESPACE@27..28 " " | 22 | WHITESPACE@27..28 " " |
@@ -35,7 +35,7 @@ SOURCE_FILE@0..71 | |||
35 | WHITESPACE@42..43 "\n" | 35 | WHITESPACE@42..43 "\n" |
36 | R_CURLY@43..44 "}" | 36 | R_CURLY@43..44 "}" |
37 | WHITESPACE@44..46 "\n\n" | 37 | WHITESPACE@44..46 "\n\n" |
38 | FN_DEF@46..70 | 38 | FN@46..70 |
39 | ABI@46..57 | 39 | ABI@46..57 |
40 | EXTERN_KW@46..52 "extern" | 40 | EXTERN_KW@46..52 "extern" |
41 | WHITESPACE@52..53 " " | 41 | 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 5701f566e..bb6527b48 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 @@ | |||
1 | SOURCE_FILE@0..35 | 1 | SOURCE_FILE@0..35 |
2 | FN_DEF@0..34 | 2 | FN@0..34 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | NAME@3..7 |
@@ -11,7 +11,7 @@ SOURCE_FILE@0..35 | |||
11 | BLOCK_EXPR@10..34 | 11 | BLOCK_EXPR@10..34 |
12 | L_CURLY@10..11 "{" | 12 | L_CURLY@10..11 "{" |
13 | WHITESPACE@11..16 "\n " | 13 | WHITESPACE@11..16 "\n " |
14 | FN_DEF@16..32 | 14 | FN@16..32 |
15 | ABI@16..22 | 15 | ABI@16..22 |
16 | EXTERN_KW@16..22 "extern" | 16 | EXTERN_KW@16..22 "extern" |
17 | WHITESPACE@22..23 " " | 17 | 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 b029d8692..5bcf54deb 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 @@ | |||
1 | SOURCE_FILE@0..34 | 1 | SOURCE_FILE@0..34 |
2 | FN_DEF@0..33 | 2 | FN@0..33 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | NAME@3..7 |
@@ -11,7 +11,7 @@ SOURCE_FILE@0..34 | |||
11 | BLOCK_EXPR@10..33 | 11 | BLOCK_EXPR@10..33 |
12 | L_CURLY@10..11 "{" | 12 | L_CURLY@10..11 "{" |
13 | WHITESPACE@11..16 "\n " | 13 | WHITESPACE@11..16 "\n " |
14 | FN_DEF@16..31 | 14 | FN@16..31 |
15 | CONST_KW@16..21 "const" | 15 | CONST_KW@16..21 "const" |
16 | WHITESPACE@21..22 " " | 16 | WHITESPACE@21..22 " " |
17 | FN_KW@22..24 "fn" | 17 | 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 299bbd136..a7cc12295 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 @@ | |||
1 | SOURCE_FILE@0..53 | 1 | SOURCE_FILE@0..53 |
2 | FN_DEF@0..52 | 2 | FN@0..52 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | NAME@3..7 |
@@ -11,7 +11,7 @@ SOURCE_FILE@0..53 | |||
11 | BLOCK_EXPR@10..52 | 11 | BLOCK_EXPR@10..52 |
12 | L_CURLY@10..11 "{" | 12 | L_CURLY@10..11 "{" |
13 | WHITESPACE@11..16 "\n " | 13 | WHITESPACE@11..16 "\n " |
14 | FN_DEF@16..32 | 14 | FN@16..32 |
15 | UNSAFE_KW@16..22 "unsafe" | 15 | UNSAFE_KW@16..22 "unsafe" |
16 | WHITESPACE@22..23 " " | 16 | WHITESPACE@22..23 " " |
17 | FN_KW@23..25 "fn" | 17 | 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 de3c4b786..efe018484 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 @@ | |||
1 | SOURCE_FILE@0..248 | 1 | SOURCE_FILE@0..248 |
2 | FN_DEF@0..247 | 2 | FN@0..247 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..16 | 5 | 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 dc47d68a6..47e46f009 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 @@ | |||
1 | SOURCE_FILE@0..153 | 1 | SOURCE_FILE@0..153 |
2 | FN_DEF@0..152 | 2 | FN@0..152 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 86c3b46c4..93f766149 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 @@ | |||
1 | SOURCE_FILE@0..112 | 1 | SOURCE_FILE@0..112 |
2 | FN_DEF@0..111 | 2 | FN@0..111 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | 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 63693de4f..4bcf07ffb 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 | |||
8 | ASSOC_ITEM_LIST@15..36 | 8 | ASSOC_ITEM_LIST@15..36 |
9 | L_CURLY@15..16 "{" | 9 | L_CURLY@15..16 "{" |
10 | WHITESPACE@16..21 "\n " | 10 | WHITESPACE@16..21 "\n " |
11 | FN_DEF@21..34 | 11 | FN@21..34 |
12 | FN_KW@21..23 "fn" | 12 | FN_KW@21..23 "fn" |
13 | WHITESPACE@23..24 " " | 13 | WHITESPACE@23..24 " " |
14 | NAME@24..31 | 14 | NAME@24..31 |
@@ -29,7 +29,7 @@ SOURCE_FILE@0..96 | |||
29 | ASSOC_ITEM_LIST@58..95 | 29 | ASSOC_ITEM_LIST@58..95 |
30 | L_CURLY@58..59 "{" | 30 | L_CURLY@58..59 "{" |
31 | WHITESPACE@59..64 "\n " | 31 | WHITESPACE@59..64 "\n " |
32 | FN_DEF@64..93 | 32 | FN@64..93 |
33 | FN_KW@64..66 "fn" | 33 | FN_KW@64..66 "fn" |
34 | WHITESPACE@66..67 " " | 34 | WHITESPACE@66..67 " " |
35 | NAME@67..79 | 35 | 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 ea285f52f..0509f7504 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 | |||
6 | EXTERN_ITEM_LIST@7..1597 | 6 | EXTERN_ITEM_LIST@7..1597 |
7 | L_CURLY@7..8 "{" | 7 | L_CURLY@7..8 "{" |
8 | WHITESPACE@8..13 "\n " | 8 | WHITESPACE@8..13 "\n " |
9 | FN_DEF@13..87 | 9 | FN@13..87 |
10 | VISIBILITY@13..16 | 10 | VISIBILITY@13..16 |
11 | PUB_KW@13..16 "pub" | 11 | PUB_KW@13..16 "pub" |
12 | WHITESPACE@16..17 " " | 12 | WHITESPACE@16..17 " " |
@@ -69,7 +69,7 @@ SOURCE_FILE@0..1598 | |||
69 | IDENT@81..86 "c_int" | 69 | IDENT@81..86 "c_int" |
70 | SEMICOLON@86..87 ";" | 70 | SEMICOLON@86..87 ";" |
71 | WHITESPACE@87..92 "\n " | 71 | WHITESPACE@87..92 "\n " |
72 | FN_DEF@92..167 | 72 | FN@92..167 |
73 | VISIBILITY@92..95 | 73 | VISIBILITY@92..95 |
74 | PUB_KW@92..95 "pub" | 74 | PUB_KW@92..95 "pub" |
75 | WHITESPACE@95..96 " " | 75 | WHITESPACE@95..96 " " |
@@ -134,7 +134,7 @@ SOURCE_FILE@0..1598 | |||
134 | IDENT@161..166 "c_int" | 134 | IDENT@161..166 "c_int" |
135 | SEMICOLON@166..167 ";" | 135 | SEMICOLON@166..167 ";" |
136 | WHITESPACE@167..172 "\n " | 136 | WHITESPACE@167..172 "\n " |
137 | FN_DEF@172..276 | 137 | FN@172..276 |
138 | VISIBILITY@172..175 | 138 | VISIBILITY@172..175 |
139 | PUB_KW@172..175 "pub" | 139 | PUB_KW@172..175 "pub" |
140 | WHITESPACE@175..176 " " | 140 | WHITESPACE@175..176 " " |
@@ -199,7 +199,7 @@ SOURCE_FILE@0..1598 | |||
199 | IDENT@270..275 "c_int" | 199 | IDENT@270..275 "c_int" |
200 | SEMICOLON@275..276 ";" | 200 | SEMICOLON@275..276 ";" |
201 | WHITESPACE@276..281 "\n " | 201 | WHITESPACE@276..281 "\n " |
202 | FN_DEF@281..341 | 202 | FN@281..341 |
203 | VISIBILITY@281..284 | 203 | VISIBILITY@281..284 |
204 | PUB_KW@281..284 "pub" | 204 | PUB_KW@281..284 "pub" |
205 | WHITESPACE@284..285 " " | 205 | WHITESPACE@284..285 " " |
@@ -248,7 +248,7 @@ SOURCE_FILE@0..1598 | |||
248 | IDENT@335..340 "c_int" | 248 | IDENT@335..340 "c_int" |
249 | SEMICOLON@340..341 ";" | 249 | SEMICOLON@340..341 ";" |
250 | WHITESPACE@341..346 "\n " | 250 | WHITESPACE@341..346 "\n " |
251 | FN_DEF@346..469 | 251 | FN@346..469 |
252 | VISIBILITY@346..349 | 252 | VISIBILITY@346..349 |
253 | PUB_KW@346..349 "pub" | 253 | PUB_KW@346..349 "pub" |
254 | WHITESPACE@349..350 " " | 254 | WHITESPACE@349..350 " " |
@@ -317,7 +317,7 @@ SOURCE_FILE@0..1598 | |||
317 | IDENT@463..468 "c_int" | 317 | IDENT@463..468 "c_int" |
318 | SEMICOLON@468..469 ";" | 318 | SEMICOLON@468..469 ";" |
319 | WHITESPACE@469..474 "\n " | 319 | WHITESPACE@469..474 "\n " |
320 | FN_DEF@474..691 | 320 | FN@474..691 |
321 | VISIBILITY@474..477 | 321 | VISIBILITY@474..477 |
322 | PUB_KW@474..477 "pub" | 322 | PUB_KW@474..477 "pub" |
323 | WHITESPACE@477..478 " " | 323 | WHITESPACE@477..478 " " |
@@ -416,7 +416,7 @@ SOURCE_FILE@0..1598 | |||
416 | IDENT@685..690 "c_int" | 416 | IDENT@685..690 "c_int" |
417 | SEMICOLON@690..691 ";" | 417 | SEMICOLON@690..691 ";" |
418 | WHITESPACE@691..696 "\n " | 418 | WHITESPACE@691..696 "\n " |
419 | FN_DEF@696..864 | 419 | FN@696..864 |
420 | VISIBILITY@696..699 | 420 | VISIBILITY@696..699 |
421 | PUB_KW@696..699 "pub" | 421 | PUB_KW@696..699 "pub" |
422 | WHITESPACE@699..700 " " | 422 | WHITESPACE@699..700 " " |
@@ -510,7 +510,7 @@ SOURCE_FILE@0..1598 | |||
510 | IDENT@858..863 "c_int" | 510 | IDENT@858..863 "c_int" |
511 | SEMICOLON@863..864 ";" | 511 | SEMICOLON@863..864 ";" |
512 | WHITESPACE@864..869 "\n " | 512 | WHITESPACE@864..869 "\n " |
513 | FN_DEF@869..992 | 513 | FN@869..992 |
514 | VISIBILITY@869..872 | 514 | VISIBILITY@869..872 |
515 | PUB_KW@869..872 "pub" | 515 | PUB_KW@869..872 "pub" |
516 | WHITESPACE@872..873 " " | 516 | WHITESPACE@872..873 " " |
@@ -579,7 +579,7 @@ SOURCE_FILE@0..1598 | |||
579 | IDENT@986..991 "c_int" | 579 | IDENT@986..991 "c_int" |
580 | SEMICOLON@991..992 ";" | 580 | SEMICOLON@991..992 ";" |
581 | WHITESPACE@992..997 "\n " | 581 | WHITESPACE@992..997 "\n " |
582 | FN_DEF@997..1173 | 582 | FN@997..1173 |
583 | VISIBILITY@997..1000 | 583 | VISIBILITY@997..1000 |
584 | PUB_KW@997..1000 "pub" | 584 | PUB_KW@997..1000 "pub" |
585 | WHITESPACE@1000..1001 " " | 585 | WHITESPACE@1000..1001 " " |
@@ -690,7 +690,7 @@ SOURCE_FILE@0..1598 | |||
690 | IDENT@1165..1172 "ssize_t" | 690 | IDENT@1165..1172 "ssize_t" |
691 | SEMICOLON@1172..1173 ";" | 691 | SEMICOLON@1172..1173 ";" |
692 | WHITESPACE@1173..1178 "\n " | 692 | WHITESPACE@1173..1178 "\n " |
693 | FN_DEF@1178..1289 | 693 | FN@1178..1289 |
694 | VISIBILITY@1178..1181 | 694 | VISIBILITY@1178..1181 |
695 | PUB_KW@1178..1181 "pub" | 695 | PUB_KW@1178..1181 "pub" |
696 | WHITESPACE@1181..1182 " " | 696 | WHITESPACE@1181..1182 " " |
@@ -771,7 +771,7 @@ SOURCE_FILE@0..1598 | |||
771 | IDENT@1281..1288 "ssize_t" | 771 | IDENT@1281..1288 "ssize_t" |
772 | SEMICOLON@1288..1289 ";" | 772 | SEMICOLON@1288..1289 ";" |
773 | WHITESPACE@1289..1294 "\n " | 773 | WHITESPACE@1289..1294 "\n " |
774 | FN_DEF@1294..1481 | 774 | FN@1294..1481 |
775 | VISIBILITY@1294..1297 | 775 | VISIBILITY@1294..1297 |
776 | PUB_KW@1294..1297 "pub" | 776 | PUB_KW@1294..1297 "pub" |
777 | WHITESPACE@1297..1298 " " | 777 | WHITESPACE@1297..1298 " " |
@@ -888,7 +888,7 @@ SOURCE_FILE@0..1598 | |||
888 | IDENT@1473..1480 "ssize_t" | 888 | IDENT@1473..1480 "ssize_t" |
889 | SEMICOLON@1480..1481 ";" | 889 | SEMICOLON@1480..1481 ";" |
890 | WHITESPACE@1481..1486 "\n " | 890 | WHITESPACE@1481..1486 "\n " |
891 | FN_DEF@1486..1595 | 891 | FN@1486..1595 |
892 | VISIBILITY@1486..1489 | 892 | VISIBILITY@1486..1489 |
893 | PUB_KW@1486..1489 "pub" | 893 | PUB_KW@1486..1489 "pub" |
894 | WHITESPACE@1489..1490 " " | 894 | 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 8d76c4e0b..1b2325a2d 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 @@ | |||
1 | SOURCE_FILE@0..116 | 1 | SOURCE_FILE@0..116 |
2 | FN_DEF@0..115 | 2 | FN@0..115 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..21 | 5 | 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 13b730ded..b3f29638c 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 @@ | |||
1 | SOURCE_FILE@0..506 | 1 | SOURCE_FILE@0..506 |
2 | FN_DEF@0..505 | 2 | FN@0..505 |
3 | COMMENT@0..33 "// format with label ..." | 3 | COMMENT@0..33 "// format with label ..." |
4 | WHITESPACE@33..34 "\n" | 4 | WHITESPACE@33..34 "\n" |
5 | FN_KW@34..36 "fn" | 5 | 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 21874ae3a..5ad8c570d 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 @@ | |||
1 | SOURCE_FILE@0..62 | 1 | SOURCE_FILE@0..62 |
2 | FN_DEF@0..61 | 2 | FN@0..61 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | 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 bbdf896d1..2e36b54bc 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 | |||
120 | WHITESPACE@447..449 "\n\n" | 120 | WHITESPACE@447..449 "\n\n" |
121 | COMMENT@449..518 "// Just a grab bag of ..." | 121 | COMMENT@449..518 "// Just a grab bag of ..." |
122 | WHITESPACE@518..520 "\n\n" | 122 | WHITESPACE@518..520 "\n\n" |
123 | FN_DEF@520..572 | 123 | FN@520..572 |
124 | FN_KW@520..522 "fn" | 124 | FN_KW@520..522 "fn" |
125 | WHITESPACE@522..523 " " | 125 | WHITESPACE@522..523 " " |
126 | NAME@523..530 | 126 | NAME@523..530 |
@@ -166,7 +166,7 @@ SOURCE_FILE@0..3813 | |||
166 | WHITESPACE@570..571 " " | 166 | WHITESPACE@570..571 " " |
167 | R_CURLY@571..572 "}" | 167 | R_CURLY@571..572 "}" |
168 | WHITESPACE@572..574 "\n\n" | 168 | WHITESPACE@572..574 "\n\n" |
169 | FN_DEF@574..624 | 169 | FN@574..624 |
170 | FN_KW@574..576 "fn" | 170 | FN_KW@574..576 "fn" |
171 | WHITESPACE@576..577 " " | 171 | WHITESPACE@576..577 " " |
172 | NAME@577..582 | 172 | NAME@577..582 |
@@ -178,7 +178,7 @@ SOURCE_FILE@0..3813 | |||
178 | BLOCK_EXPR@585..624 | 178 | BLOCK_EXPR@585..624 |
179 | L_CURLY@585..586 "{" | 179 | L_CURLY@585..586 "{" |
180 | WHITESPACE@586..591 "\n " | 180 | WHITESPACE@586..591 "\n " |
181 | FN_DEF@591..607 | 181 | FN@591..607 |
182 | FN_KW@591..593 "fn" | 182 | FN_KW@591..593 "fn" |
183 | WHITESPACE@593..594 " " | 183 | WHITESPACE@593..594 " " |
184 | NAME@594..595 | 184 | NAME@594..595 |
@@ -217,7 +217,7 @@ SOURCE_FILE@0..3813 | |||
217 | WHITESPACE@622..623 "\n" | 217 | WHITESPACE@622..623 "\n" |
218 | R_CURLY@623..624 "}" | 218 | R_CURLY@623..624 "}" |
219 | WHITESPACE@624..626 "\n\n" | 219 | WHITESPACE@624..626 "\n\n" |
220 | FN_DEF@626..816 | 220 | FN@626..816 |
221 | FN_KW@626..628 "fn" | 221 | FN_KW@626..628 "fn" |
222 | WHITESPACE@628..629 " " | 222 | WHITESPACE@628..629 " " |
223 | NAME@629..633 | 223 | NAME@629..633 |
@@ -229,7 +229,7 @@ SOURCE_FILE@0..3813 | |||
229 | BLOCK_EXPR@636..816 | 229 | BLOCK_EXPR@636..816 |
230 | L_CURLY@636..637 "{" | 230 | L_CURLY@636..637 "{" |
231 | WHITESPACE@637..642 "\n " | 231 | WHITESPACE@637..642 "\n " |
232 | FN_DEF@642..720 | 232 | FN@642..720 |
233 | FN_KW@642..644 "fn" | 233 | FN_KW@642..644 "fn" |
234 | WHITESPACE@644..645 " " | 234 | WHITESPACE@644..645 " " |
235 | NAME@645..648 | 235 | NAME@645..648 |
@@ -407,7 +407,7 @@ SOURCE_FILE@0..3813 | |||
407 | WHITESPACE@814..815 "\n" | 407 | WHITESPACE@814..815 "\n" |
408 | R_CURLY@815..816 "}" | 408 | R_CURLY@815..816 "}" |
409 | WHITESPACE@816..818 "\n\n" | 409 | WHITESPACE@816..818 "\n\n" |
410 | FN_DEF@818..1322 | 410 | FN@818..1322 |
411 | FN_KW@818..820 "fn" | 411 | FN_KW@818..820 "fn" |
412 | WHITESPACE@820..821 " " | 412 | WHITESPACE@820..821 " " |
413 | NAME@821..832 | 413 | NAME@821..832 |
@@ -572,7 +572,7 @@ SOURCE_FILE@0..3813 | |||
572 | WHITESPACE@1320..1321 "\n" | 572 | WHITESPACE@1320..1321 "\n" |
573 | R_CURLY@1321..1322 "}" | 573 | R_CURLY@1321..1322 "}" |
574 | WHITESPACE@1322..1324 "\n\n" | 574 | WHITESPACE@1322..1324 "\n\n" |
575 | FN_DEF@1324..1539 | 575 | FN@1324..1539 |
576 | FN_KW@1324..1326 "fn" | 576 | FN_KW@1324..1326 "fn" |
577 | WHITESPACE@1326..1327 " " | 577 | WHITESPACE@1326..1327 " " |
578 | NAME@1327..1334 | 578 | NAME@1327..1334 |
@@ -809,7 +809,7 @@ SOURCE_FILE@0..3813 | |||
809 | WHITESPACE@1537..1538 "\n" | 809 | WHITESPACE@1537..1538 "\n" |
810 | R_CURLY@1538..1539 "}" | 810 | R_CURLY@1538..1539 "}" |
811 | WHITESPACE@1539..1541 "\n\n" | 811 | WHITESPACE@1539..1541 "\n\n" |
812 | FN_DEF@1541..1741 | 812 | FN@1541..1741 |
813 | FN_KW@1541..1543 "fn" | 813 | FN_KW@1541..1543 "fn" |
814 | WHITESPACE@1543..1544 " " | 814 | WHITESPACE@1543..1544 " " |
815 | NAME@1544..1557 | 815 | NAME@1544..1557 |
@@ -830,7 +830,7 @@ SOURCE_FILE@0..3813 | |||
830 | BLOCK_EXPR@1569..1741 | 830 | BLOCK_EXPR@1569..1741 |
831 | L_CURLY@1569..1570 "{" | 831 | L_CURLY@1569..1570 "{" |
832 | WHITESPACE@1570..1575 "\n " | 832 | WHITESPACE@1570..1575 "\n " |
833 | FN_DEF@1575..1598 | 833 | FN@1575..1598 |
834 | FN_KW@1575..1577 "fn" | 834 | FN_KW@1575..1577 "fn" |
835 | WHITESPACE@1577..1578 " " | 835 | WHITESPACE@1577..1578 " " |
836 | NAME@1578..1579 | 836 | NAME@1578..1579 |
@@ -988,7 +988,7 @@ SOURCE_FILE@0..3813 | |||
988 | WHITESPACE@1739..1740 "\n" | 988 | WHITESPACE@1739..1740 "\n" |
989 | R_CURLY@1740..1741 "}" | 989 | R_CURLY@1740..1741 "}" |
990 | WHITESPACE@1741..1743 "\n\n" | 990 | WHITESPACE@1741..1743 "\n\n" |
991 | FN_DEF@1743..1904 | 991 | FN@1743..1904 |
992 | FN_KW@1743..1745 "fn" | 992 | FN_KW@1743..1745 "fn" |
993 | WHITESPACE@1745..1746 " " | 993 | WHITESPACE@1745..1746 " " |
994 | NAME@1746..1755 | 994 | NAME@1746..1755 |
@@ -1131,7 +1131,7 @@ SOURCE_FILE@0..3813 | |||
1131 | WHITESPACE@1902..1903 "\n" | 1131 | WHITESPACE@1902..1903 "\n" |
1132 | R_CURLY@1903..1904 "}" | 1132 | R_CURLY@1903..1904 "}" |
1133 | WHITESPACE@1904..1906 "\n\n" | 1133 | WHITESPACE@1904..1906 "\n\n" |
1134 | FN_DEF@1906..1960 | 1134 | FN@1906..1960 |
1135 | FN_KW@1906..1908 "fn" | 1135 | FN_KW@1906..1908 "fn" |
1136 | WHITESPACE@1908..1909 " " | 1136 | WHITESPACE@1908..1909 " " |
1137 | NAME@1909..1921 | 1137 | NAME@1909..1921 |
@@ -1166,7 +1166,7 @@ SOURCE_FILE@0..3813 | |||
1166 | WHITESPACE@1958..1959 " " | 1166 | WHITESPACE@1958..1959 " " |
1167 | R_CURLY@1959..1960 "}" | 1167 | R_CURLY@1959..1960 "}" |
1168 | WHITESPACE@1960..1962 "\n\n" | 1168 | WHITESPACE@1960..1962 "\n\n" |
1169 | FN_DEF@1962..2198 | 1169 | FN@1962..2198 |
1170 | FN_KW@1962..1964 "fn" | 1170 | FN_KW@1962..1964 "fn" |
1171 | WHITESPACE@1964..1965 " " | 1171 | WHITESPACE@1964..1965 " " |
1172 | NAME@1965..1969 | 1172 | NAME@1965..1969 |
@@ -1284,7 +1284,7 @@ SOURCE_FILE@0..3813 | |||
1284 | WHITESPACE@2196..2197 "\n" | 1284 | WHITESPACE@2196..2197 "\n" |
1285 | R_CURLY@2197..2198 "}" | 1285 | R_CURLY@2197..2198 "}" |
1286 | WHITESPACE@2198..2200 "\n\n" | 1286 | WHITESPACE@2198..2200 "\n\n" |
1287 | FN_DEF@2200..2693 | 1287 | FN@2200..2693 |
1288 | FN_KW@2200..2202 "fn" | 1288 | FN_KW@2200..2202 "fn" |
1289 | WHITESPACE@2202..2203 " " | 1289 | WHITESPACE@2202..2203 " " |
1290 | NAME@2203..2205 | 1290 | NAME@2203..2205 |
@@ -1468,7 +1468,7 @@ SOURCE_FILE@0..3813 | |||
1468 | WHITESPACE@2691..2692 "\n" | 1468 | WHITESPACE@2691..2692 "\n" |
1469 | R_CURLY@2692..2693 "}" | 1469 | R_CURLY@2692..2693 "}" |
1470 | WHITESPACE@2693..2695 "\n\n" | 1470 | WHITESPACE@2693..2695 "\n\n" |
1471 | FN_DEF@2695..2832 | 1471 | FN@2695..2832 |
1472 | FN_KW@2695..2697 "fn" | 1472 | FN_KW@2695..2697 "fn" |
1473 | WHITESPACE@2697..2698 " " | 1473 | WHITESPACE@2697..2698 " " |
1474 | NAME@2698..2703 | 1474 | NAME@2698..2703 |
@@ -1548,7 +1548,7 @@ SOURCE_FILE@0..3813 | |||
1548 | WHITESPACE@2830..2831 "\n" | 1548 | WHITESPACE@2830..2831 "\n" |
1549 | R_CURLY@2831..2832 "}" | 1549 | R_CURLY@2831..2832 "}" |
1550 | WHITESPACE@2832..2834 "\n\n" | 1550 | WHITESPACE@2832..2834 "\n\n" |
1551 | FN_DEF@2834..2906 | 1551 | FN@2834..2906 |
1552 | FN_KW@2834..2836 "fn" | 1552 | FN_KW@2834..2836 "fn" |
1553 | WHITESPACE@2836..2837 " " | 1553 | WHITESPACE@2836..2837 " " |
1554 | NAME@2837..2842 | 1554 | NAME@2837..2842 |
@@ -1599,7 +1599,7 @@ SOURCE_FILE@0..3813 | |||
1599 | WHITESPACE@2904..2905 "\n" | 1599 | WHITESPACE@2904..2905 "\n" |
1600 | R_CURLY@2905..2906 "}" | 1600 | R_CURLY@2905..2906 "}" |
1601 | WHITESPACE@2906..2908 "\n\n" | 1601 | WHITESPACE@2906..2908 "\n\n" |
1602 | FN_DEF@2908..3042 | 1602 | FN@2908..3042 |
1603 | FN_KW@2908..2910 "fn" | 1603 | FN_KW@2908..2910 "fn" |
1604 | WHITESPACE@2910..2911 " " | 1604 | WHITESPACE@2910..2911 " " |
1605 | NAME@2911..2929 | 1605 | NAME@2911..2929 |
@@ -1722,7 +1722,7 @@ SOURCE_FILE@0..3813 | |||
1722 | WHITESPACE@3040..3041 "\n" | 1722 | WHITESPACE@3040..3041 "\n" |
1723 | R_CURLY@3041..3042 "}" | 1723 | R_CURLY@3041..3042 "}" |
1724 | WHITESPACE@3042..3044 "\n\n" | 1724 | WHITESPACE@3042..3044 "\n\n" |
1725 | FN_DEF@3044..3514 | 1725 | FN@3044..3514 |
1726 | FN_KW@3044..3046 "fn" | 1726 | FN_KW@3044..3046 "fn" |
1727 | WHITESPACE@3046..3047 " " | 1727 | WHITESPACE@3046..3047 " " |
1728 | NAME@3047..3057 | 1728 | NAME@3047..3057 |
@@ -2056,7 +2056,7 @@ SOURCE_FILE@0..3813 | |||
2056 | WHITESPACE@3512..3513 "\n" | 2056 | WHITESPACE@3512..3513 "\n" |
2057 | R_CURLY@3513..3514 "}" | 2057 | R_CURLY@3513..3514 "}" |
2058 | WHITESPACE@3514..3516 "\n\n" | 2058 | WHITESPACE@3514..3516 "\n\n" |
2059 | FN_DEF@3516..3552 | 2059 | FN@3516..3552 |
2060 | FN_KW@3516..3518 "fn" | 2060 | FN_KW@3516..3518 "fn" |
2061 | WHITESPACE@3518..3519 " " | 2061 | WHITESPACE@3518..3519 " " |
2062 | NAME@3519..3525 | 2062 | NAME@3519..3525 |
@@ -2090,7 +2090,7 @@ SOURCE_FILE@0..3813 | |||
2090 | WHITESPACE@3550..3551 "\n" | 2090 | WHITESPACE@3550..3551 "\n" |
2091 | R_CURLY@3551..3552 "}" | 2091 | R_CURLY@3551..3552 "}" |
2092 | WHITESPACE@3552..3554 "\n\n" | 2092 | WHITESPACE@3552..3554 "\n\n" |
2093 | FN_DEF@3554..3812 | 2093 | FN@3554..3812 |
2094 | VISIBILITY@3554..3557 | 2094 | VISIBILITY@3554..3557 |
2095 | PUB_KW@3554..3557 "pub" | 2095 | PUB_KW@3554..3557 "pub" |
2096 | WHITESPACE@3557..3558 " " | 2096 | 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 a64a82e94..a5f09e364 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 @@ | |||
1 | SOURCE_FILE@0..157 | 1 | SOURCE_FILE@0..157 |
2 | COMMENT@0..60 "// https://github.com ..." | 2 | COMMENT@0..60 "// https://github.com ..." |
3 | WHITESPACE@60..62 "\n\n" | 3 | WHITESPACE@60..62 "\n\n" |
4 | FN_DEF@62..156 | 4 | FN@62..156 |
5 | VISIBILITY@62..65 | 5 | VISIBILITY@62..65 |
6 | PUB_KW@62..65 "pub" | 6 | PUB_KW@62..65 "pub" |
7 | WHITESPACE@65..66 " " | 7 | 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 7fd414090..22168eaf1 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 @@ | |||
1 | SOURCE_FILE@0..34 | 1 | SOURCE_FILE@0..34 |
2 | FN_DEF@0..34 | 2 | FN@0..34 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | 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 17be2c238..68a366354 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 @@ | |||
1 | SOURCE_FILE@0..15 | 1 | SOURCE_FILE@0..15 |
2 | FN_DEF@0..14 | 2 | FN@0..14 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..8 | 5 | 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 acf32a852..92ede8ccb 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 @@ | |||
1 | SOURCE_FILE@0..59 | 1 | SOURCE_FILE@0..59 |
2 | FN_DEF@0..59 | 2 | FN@0..59 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 573edc081..4f0c68822 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 | |||
20 | ASSOC_ITEM_LIST@84..141 | 20 | ASSOC_ITEM_LIST@84..141 |
21 | L_CURLY@84..85 "{" | 21 | L_CURLY@84..85 "{" |
22 | WHITESPACE@85..90 "\n " | 22 | WHITESPACE@85..90 "\n " |
23 | FN_DEF@90..139 | 23 | FN@90..139 |
24 | FN_KW@90..92 "fn" | 24 | FN_KW@90..92 "fn" |
25 | WHITESPACE@92..93 " " | 25 | WHITESPACE@92..93 " " |
26 | NAME@93..96 | 26 | NAME@93..96 |
@@ -55,7 +55,7 @@ SOURCE_FILE@0..199 | |||
55 | WHITESPACE@139..140 "\n" | 55 | WHITESPACE@139..140 "\n" |
56 | R_CURLY@140..141 "}" | 56 | R_CURLY@140..141 "}" |
57 | WHITESPACE@141..143 "\n\n" | 57 | WHITESPACE@141..143 "\n\n" |
58 | FN_DEF@143..161 | 58 | FN@143..161 |
59 | FN_KW@143..145 "fn" | 59 | FN_KW@143..145 "fn" |
60 | WHITESPACE@145..146 " " | 60 | WHITESPACE@145..146 " " |
61 | NAME@146..149 | 61 | NAME@146..149 |
@@ -78,7 +78,7 @@ SOURCE_FILE@0..199 | |||
78 | L_CURLY@159..160 "{" | 78 | L_CURLY@159..160 "{" |
79 | R_CURLY@160..161 "}" | 79 | R_CURLY@160..161 "}" |
80 | WHITESPACE@161..163 "\n\n" | 80 | WHITESPACE@161..163 "\n\n" |
81 | FN_DEF@163..198 | 81 | FN@163..198 |
82 | FN_KW@163..165 "fn" | 82 | FN_KW@163..165 "fn" |
83 | WHITESPACE@165..166 " " | 83 | WHITESPACE@165..166 " " |
84 | NAME@166..170 | 84 | 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 900eeb445..22eb22e3c 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 | |||
30 | WHITESPACE@88..89 " " | 30 | WHITESPACE@88..89 " " |
31 | R_CURLY@89..90 "}" | 31 | R_CURLY@89..90 "}" |
32 | WHITESPACE@90..92 "\n\n" | 32 | WHITESPACE@90..92 "\n\n" |
33 | FN_DEF@92..159 | 33 | FN@92..159 |
34 | FN_KW@92..94 "fn" | 34 | FN_KW@92..94 "fn" |
35 | WHITESPACE@94..95 " " | 35 | WHITESPACE@94..95 " " |
36 | NAME@95..98 | 36 | 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 6d941487b..c9e6d88eb 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 @@ | |||
1 | SOURCE_FILE@0..166 | 1 | SOURCE_FILE@0..166 |
2 | FN_DEF@0..165 | 2 | FN@0..165 |
3 | COMMENT@0..60 "// https://github.com ..." | 3 | COMMENT@0..60 "// https://github.com ..." |
4 | WHITESPACE@60..61 "\n" | 4 | WHITESPACE@60..61 "\n" |
5 | FN_KW@61..63 "fn" | 5 | 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 69aa0ba4d..5ebc53618 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 @@ | |||
1 | SOURCE_FILE@0..686 | 1 | SOURCE_FILE@0..686 |
2 | FN_DEF@0..461 | 2 | FN@0..461 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..8 | 5 | NAME@3..8 |
@@ -101,7 +101,7 @@ SOURCE_FILE@0..686 | |||
101 | ASSOC_ITEM_LIST@538..685 | 101 | ASSOC_ITEM_LIST@538..685 |
102 | L_CURLY@538..539 "{" | 102 | L_CURLY@538..539 "{" |
103 | WHITESPACE@539..544 "\n " | 103 | WHITESPACE@539..544 "\n " |
104 | FN_DEF@544..683 | 104 | FN@544..683 |
105 | FN_KW@544..546 "fn" | 105 | FN_KW@544..546 "fn" |
106 | WHITESPACE@546..547 " " | 106 | WHITESPACE@546..547 " " |
107 | NAME@547..558 | 107 | 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 38e44e48a..29a5d48e6 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 @@ | |||
1 | SOURCE_FILE@0..395 | 1 | SOURCE_FILE@0..395 |
2 | COMMENT@0..60 "// https://github.com ..." | 2 | COMMENT@0..60 "// https://github.com ..." |
3 | WHITESPACE@60..62 "\n\n" | 3 | WHITESPACE@60..62 "\n\n" |
4 | FN_DEF@62..341 | 4 | FN@62..341 |
5 | FN_KW@62..64 "fn" | 5 | FN_KW@62..64 "fn" |
6 | WHITESPACE@64..65 " " | 6 | WHITESPACE@64..65 " " |
7 | NAME@65..69 | 7 | NAME@65..69 |
@@ -288,7 +288,7 @@ SOURCE_FILE@0..395 | |||
288 | WHITESPACE@365..366 "\n" | 288 | WHITESPACE@365..366 "\n" |
289 | R_CURLY@366..367 "}" | 289 | R_CURLY@366..367 "}" |
290 | WHITESPACE@367..369 "\n\n" | 290 | WHITESPACE@367..369 "\n\n" |
291 | FN_DEF@369..394 | 291 | FN@369..394 |
292 | FN_KW@369..371 "fn" | 292 | FN_KW@369..371 "fn" |
293 | WHITESPACE@371..372 " " | 293 | WHITESPACE@371..372 " " |
294 | NAME@372..375 | 294 | 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 28233c5d0..662576e5f 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 @@ | |||
1 | SOURCE_FILE@0..257 | 1 | SOURCE_FILE@0..257 |
2 | COMMENT@0..58 "// https://github.com ..." | 2 | COMMENT@0..58 "// https://github.com ..." |
3 | WHITESPACE@58..60 "\n\n" | 3 | WHITESPACE@58..60 "\n\n" |
4 | FN_DEF@60..256 | 4 | FN@60..256 |
5 | FN_KW@60..62 "fn" | 5 | FN_KW@60..62 "fn" |
6 | WHITESPACE@62..63 " " | 6 | WHITESPACE@62..63 " " |
7 | NAME@63..82 | 7 | 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 0569488f8..57ecad3cf 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 @@ | |||
1 | SOURCE_FILE@0..47 | 1 | SOURCE_FILE@0..47 |
2 | FN_DEF@0..45 | 2 | FN@0..45 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 7847da085..798e81ca6 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 @@ | |||
1 | SOURCE_FILE@0..95 | 1 | SOURCE_FILE@0..95 |
2 | FN_DEF@0..52 | 2 | FN@0..52 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | NAME@3..6 |
@@ -52,7 +52,7 @@ SOURCE_FILE@0..95 | |||
52 | L_CURLY@50..51 "{" | 52 | L_CURLY@50..51 "{" |
53 | R_CURLY@51..52 "}" | 53 | R_CURLY@51..52 "}" |
54 | WHITESPACE@52..54 "\n\n" | 54 | WHITESPACE@52..54 "\n\n" |
55 | FN_DEF@54..94 | 55 | FN@54..94 |
56 | FN_KW@54..56 "fn" | 56 | FN_KW@54..56 "fn" |
57 | WHITESPACE@56..57 " " | 57 | WHITESPACE@56..57 " " |
58 | NAME@57..61 | 58 | 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 919c690de..9a173b002 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 @@ | |||
1 | SOURCE_FILE@0..519 | 1 | SOURCE_FILE@0..519 |
2 | FN_DEF@0..37 | 2 | FN@0..37 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..5 | 5 | NAME@3..5 |
@@ -41,7 +41,7 @@ SOURCE_FILE@0..519 | |||
41 | L_CURLY@35..36 "{" | 41 | L_CURLY@35..36 "{" |
42 | R_CURLY@36..37 "}" | 42 | R_CURLY@36..37 "}" |
43 | WHITESPACE@37..38 "\n" | 43 | WHITESPACE@37..38 "\n" |
44 | FN_DEF@38..62 | 44 | FN@38..62 |
45 | FN_KW@38..40 "fn" | 45 | FN_KW@38..40 "fn" |
46 | WHITESPACE@40..41 " " | 46 | WHITESPACE@40..41 " " |
47 | NAME@41..43 | 47 | NAME@41..43 |
@@ -83,7 +83,7 @@ SOURCE_FILE@0..519 | |||
83 | EXTERN_ITEM_LIST@75..128 | 83 | EXTERN_ITEM_LIST@75..128 |
84 | L_CURLY@75..76 "{" | 84 | L_CURLY@75..76 "{" |
85 | WHITESPACE@76..77 " " | 85 | WHITESPACE@76..77 " " |
86 | FN_DEF@77..126 | 86 | FN@77..126 |
87 | FN_KW@77..79 "fn" | 87 | FN_KW@77..79 "fn" |
88 | WHITESPACE@79..80 " " | 88 | WHITESPACE@79..80 " " |
89 | NAME@80..86 | 89 | NAME@80..86 |
@@ -132,7 +132,7 @@ SOURCE_FILE@0..519 | |||
132 | WHITESPACE@126..127 " " | 132 | WHITESPACE@126..127 " " |
133 | R_CURLY@127..128 "}" | 133 | R_CURLY@127..128 "}" |
134 | WHITESPACE@128..130 "\n\n" | 134 | WHITESPACE@128..130 "\n\n" |
135 | FN_DEF@130..172 | 135 | FN@130..172 |
136 | FN_KW@130..132 "fn" | 136 | FN_KW@130..132 "fn" |
137 | WHITESPACE@132..133 " " | 137 | WHITESPACE@132..133 " " |
138 | NAME@133..136 | 138 | NAME@133..136 |
@@ -195,7 +195,7 @@ SOURCE_FILE@0..519 | |||
195 | ASSOC_ITEM_LIST@184..236 | 195 | ASSOC_ITEM_LIST@184..236 |
196 | L_CURLY@184..185 "{" | 196 | L_CURLY@184..185 "{" |
197 | WHITESPACE@185..190 "\n " | 197 | WHITESPACE@185..190 "\n " |
198 | FN_DEF@190..234 | 198 | FN@190..234 |
199 | FN_KW@190..192 "fn" | 199 | FN_KW@190..192 "fn" |
200 | WHITESPACE@192..193 " " | 200 | WHITESPACE@192..193 " " |
201 | NAME@193..196 | 201 | NAME@193..196 |
@@ -263,7 +263,7 @@ SOURCE_FILE@0..519 | |||
263 | ASSOC_ITEM_LIST@245..519 | 263 | ASSOC_ITEM_LIST@245..519 |
264 | L_CURLY@245..246 "{" | 264 | L_CURLY@245..246 "{" |
265 | WHITESPACE@246..252 "\n " | 265 | WHITESPACE@246..252 "\n " |
266 | FN_DEF@252..277 | 266 | FN@252..277 |
267 | FN_KW@252..254 "fn" | 267 | FN_KW@252..254 "fn" |
268 | WHITESPACE@254..255 " " | 268 | WHITESPACE@254..255 " " |
269 | NAME@255..256 | 269 | NAME@255..256 |
@@ -287,7 +287,7 @@ SOURCE_FILE@0..519 | |||
287 | L_CURLY@275..276 "{" | 287 | L_CURLY@275..276 "{" |
288 | R_CURLY@276..277 "}" | 288 | R_CURLY@276..277 "}" |
289 | WHITESPACE@277..283 "\n " | 289 | WHITESPACE@277..283 "\n " |
290 | FN_DEF@283..305 | 290 | FN@283..305 |
291 | FN_KW@283..285 "fn" | 291 | FN_KW@283..285 "fn" |
292 | WHITESPACE@285..286 " " | 292 | WHITESPACE@285..286 " " |
293 | NAME@286..288 | 293 | NAME@286..288 |
@@ -311,7 +311,7 @@ SOURCE_FILE@0..519 | |||
311 | L_CURLY@303..304 "{" | 311 | L_CURLY@303..304 "{" |
312 | R_CURLY@304..305 "}" | 312 | R_CURLY@304..305 "}" |
313 | WHITESPACE@305..311 "\n " | 313 | WHITESPACE@305..311 "\n " |
314 | FN_DEF@311..334 | 314 | FN@311..334 |
315 | FN_KW@311..313 "fn" | 315 | FN_KW@311..313 "fn" |
316 | WHITESPACE@313..314 " " | 316 | WHITESPACE@313..314 " " |
317 | NAME@314..316 | 317 | NAME@314..316 |
@@ -336,7 +336,7 @@ SOURCE_FILE@0..519 | |||
336 | L_CURLY@332..333 "{" | 336 | L_CURLY@332..333 "{" |
337 | R_CURLY@333..334 "}" | 337 | R_CURLY@333..334 "}" |
338 | WHITESPACE@334..340 "\n " | 338 | WHITESPACE@334..340 "\n " |
339 | FN_DEF@340..371 | 339 | FN@340..371 |
340 | FN_KW@340..342 "fn" | 340 | FN_KW@340..342 "fn" |
341 | WHITESPACE@342..343 " " | 341 | WHITESPACE@342..343 " " |
342 | NAME@343..345 | 342 | NAME@343..345 |
@@ -368,7 +368,7 @@ SOURCE_FILE@0..519 | |||
368 | L_CURLY@369..370 "{" | 368 | L_CURLY@369..370 "{" |
369 | R_CURLY@370..371 "}" | 369 | R_CURLY@370..371 "}" |
370 | WHITESPACE@371..377 "\n " | 370 | WHITESPACE@371..377 "\n " |
371 | FN_DEF@377..407 | 371 | FN@377..407 |
372 | FN_KW@377..379 "fn" | 372 | FN_KW@377..379 "fn" |
373 | WHITESPACE@379..380 " " | 373 | WHITESPACE@379..380 " " |
374 | NAME@380..382 | 374 | NAME@380..382 |
@@ -400,7 +400,7 @@ SOURCE_FILE@0..519 | |||
400 | L_CURLY@405..406 "{" | 400 | L_CURLY@405..406 "{" |
401 | R_CURLY@406..407 "}" | 401 | R_CURLY@406..407 "}" |
402 | WHITESPACE@407..413 "\n " | 402 | WHITESPACE@407..413 "\n " |
403 | FN_DEF@413..447 | 403 | FN@413..447 |
404 | FN_KW@413..415 "fn" | 404 | FN_KW@413..415 "fn" |
405 | WHITESPACE@415..416 " " | 405 | WHITESPACE@415..416 " " |
406 | NAME@416..418 | 406 | NAME@416..418 |
@@ -434,7 +434,7 @@ SOURCE_FILE@0..519 | |||
434 | L_CURLY@445..446 "{" | 434 | L_CURLY@445..446 "{" |
435 | R_CURLY@446..447 "}" | 435 | R_CURLY@446..447 "}" |
436 | WHITESPACE@447..453 "\n " | 436 | WHITESPACE@447..453 "\n " |
437 | FN_DEF@453..480 | 437 | FN@453..480 |
438 | FN_KW@453..455 "fn" | 438 | FN_KW@453..455 "fn" |
439 | WHITESPACE@455..456 " " | 439 | WHITESPACE@455..456 " " |
440 | NAME@456..457 | 440 | NAME@456..457 |
@@ -465,7 +465,7 @@ SOURCE_FILE@0..519 | |||
465 | L_CURLY@478..479 "{" | 465 | L_CURLY@478..479 "{" |
466 | R_CURLY@479..480 "}" | 466 | R_CURLY@479..480 "}" |
467 | WHITESPACE@480..486 "\n " | 467 | WHITESPACE@480..486 "\n " |
468 | FN_DEF@486..517 | 468 | FN@486..517 |
469 | FN_KW@486..488 "fn" | 469 | FN_KW@486..488 "fn" |
470 | WHITESPACE@488..489 " " | 470 | WHITESPACE@488..489 " " |
471 | NAME@489..490 | 471 | 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 65cfa7bc5..a30000398 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 @@ | |||
1 | SOURCE_FILE@0..80 | 1 | SOURCE_FILE@0..80 |
2 | FN_DEF@0..79 | 2 | FN@0..79 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 d6aec7ab9..e3997ac5b 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 @@ | |||
1 | SOURCE_FILE@0..88 | 1 | SOURCE_FILE@0..88 |
2 | FN_DEF@0..26 | 2 | FN@0..26 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..4 | 5 | NAME@3..4 |
@@ -35,7 +35,7 @@ SOURCE_FILE@0..88 | |||
35 | L_CURLY@24..25 "{" | 35 | L_CURLY@24..25 "{" |
36 | R_CURLY@25..26 "}" | 36 | R_CURLY@25..26 "}" |
37 | WHITESPACE@26..28 "\n\n" | 37 | WHITESPACE@26..28 "\n\n" |
38 | FN_DEF@28..56 | 38 | FN@28..56 |
39 | FN_KW@28..30 "fn" | 39 | FN_KW@28..30 "fn" |
40 | WHITESPACE@30..31 " " | 40 | WHITESPACE@30..31 " " |
41 | NAME@31..32 | 41 | NAME@31..32 |
@@ -77,7 +77,7 @@ SOURCE_FILE@0..88 | |||
77 | L_CURLY@54..55 "{" | 77 | L_CURLY@54..55 "{" |
78 | R_CURLY@55..56 "}" | 78 | R_CURLY@55..56 "}" |
79 | WHITESPACE@56..58 "\n\n" | 79 | WHITESPACE@56..58 "\n\n" |
80 | FN_DEF@58..87 | 80 | FN@58..87 |
81 | FN_KW@58..60 "fn" | 81 | FN_KW@58..60 "fn" |
82 | WHITESPACE@60..61 " " | 82 | WHITESPACE@60..61 " " |
83 | NAME@61..62 | 83 | 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 9e0cec35f..7447d516e 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 | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..49 | 1 | SOURCE_FILE@0..49 |
2 | TYPE_ALIAS_DEF@0..12 | 2 | TYPE_ALIAS@0..12 |
3 | TYPE_KW@0..4 "type" | 3 | TYPE_KW@0..4 "type" |
4 | WHITESPACE@4..5 " " | 4 | WHITESPACE@4..5 " " |
5 | NAME@5..6 | 5 | NAME@5..6 |
@@ -12,7 +12,7 @@ SOURCE_FILE@0..49 | |||
12 | R_PAREN@10..11 ")" | 12 | R_PAREN@10..11 ")" |
13 | SEMICOLON@11..12 ";" | 13 | SEMICOLON@11..12 ";" |
14 | WHITESPACE@12..14 "\n\n" | 14 | WHITESPACE@12..14 "\n\n" |
15 | FN_DEF@14..48 | 15 | FN@14..48 |
16 | FN_KW@14..16 "fn" | 16 | FN_KW@14..16 "fn" |
17 | WHITESPACE@16..17 " " | 17 | WHITESPACE@16..17 " " |
18 | NAME@17..21 | 18 | 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 7fa3033ac..3ef916e55 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 @@ | |||
1 | SOURCE_FILE@0..71 | 1 | SOURCE_FILE@0..71 |
2 | FN_DEF@0..70 | 2 | FN@0..70 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | 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 d93968016..53410a1ee 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 @@ | |||
1 | SOURCE_FILE@0..50 | 1 | SOURCE_FILE@0..50 |
2 | FN_DEF@0..17 | 2 | FN@0..17 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | NAME@3..6 |
@@ -23,7 +23,7 @@ SOURCE_FILE@0..50 | |||
23 | L_CURLY@15..16 "{" | 23 | L_CURLY@15..16 "{" |
24 | R_CURLY@16..17 "}" | 24 | R_CURLY@16..17 "}" |
25 | WHITESPACE@17..19 "\n\n" | 25 | WHITESPACE@17..19 "\n\n" |
26 | FN_DEF@19..50 | 26 | FN@19..50 |
27 | FN_KW@19..21 "fn" | 27 | FN_KW@19..21 "fn" |
28 | WHITESPACE@21..22 " " | 28 | WHITESPACE@21..22 " " |
29 | NAME@22..26 | 29 | 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 b5c72ee36..a1dfd58f2 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 @@ | |||
1 | SOURCE_FILE@0..79 | 1 | SOURCE_FILE@0..79 |
2 | FN_DEF@0..78 | 2 | FN@0..78 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..6 | 5 | 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 ddcb139c1..767b516a2 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 @@ | |||
1 | SOURCE_FILE@0..105 | 1 | SOURCE_FILE@0..105 |
2 | FN_DEF@0..104 | 2 | FN@0..104 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | 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 098152fc3..1fd1a2888 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 @@ | |||
1 | SOURCE_FILE@0..56 | 1 | SOURCE_FILE@0..56 |
2 | FN_DEF@0..55 | 2 | FN@0..55 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | 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 c6e982976..ba49c115b 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 @@ | |||
1 | SOURCE_FILE@0..35 | 1 | SOURCE_FILE@0..35 |
2 | FN_DEF@0..34 | 2 | FN@0..34 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..7 | 5 | 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 bf791ee2b..0c22c31a4 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 | |||
51 | WHITESPACE@91..92 "\n" | 51 | WHITESPACE@91..92 "\n" |
52 | R_CURLY@92..93 "}" | 52 | R_CURLY@92..93 "}" |
53 | WHITESPACE@93..95 "\n\n" | 53 | WHITESPACE@93..95 "\n\n" |
54 | FN_DEF@95..348 | 54 | FN@95..348 |
55 | ATTR@95..102 | 55 | ATTR@95..102 |
56 | POUND@95..96 "#" | 56 | POUND@95..96 "#" |
57 | L_BRACK@96..97 "[" | 57 | 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 40619b46e..a87bbf4eb 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 | |||
8 | ASSOC_ITEM_LIST@8..169 | 8 | ASSOC_ITEM_LIST@8..169 |
9 | L_CURLY@8..9 "{" | 9 | L_CURLY@8..9 "{" |
10 | WHITESPACE@9..14 "\n " | 10 | WHITESPACE@9..14 "\n " |
11 | FN_DEF@14..46 | 11 | FN@14..46 |
12 | FN_KW@14..16 "fn" | 12 | FN_KW@14..16 "fn" |
13 | WHITESPACE@16..17 " " | 13 | WHITESPACE@16..17 " " |
14 | NAME@17..19 | 14 | NAME@17..19 |
@@ -50,7 +50,7 @@ SOURCE_FILE@0..170 | |||
50 | L_CURLY@44..45 "{" | 50 | L_CURLY@44..45 "{" |
51 | R_CURLY@45..46 "}" | 51 | R_CURLY@45..46 "}" |
52 | WHITESPACE@46..51 "\n " | 52 | WHITESPACE@46..51 "\n " |
53 | FN_DEF@51..74 | 53 | FN@51..74 |
54 | FN_KW@51..53 "fn" | 54 | FN_KW@51..53 "fn" |
55 | WHITESPACE@53..54 " " | 55 | WHITESPACE@53..54 " " |
56 | NAME@54..56 | 56 | NAME@54..56 |
@@ -92,7 +92,7 @@ SOURCE_FILE@0..170 | |||
92 | L_CURLY@72..73 "{" | 92 | L_CURLY@72..73 "{" |
93 | R_CURLY@73..74 "}" | 93 | R_CURLY@73..74 "}" |
94 | WHITESPACE@74..79 "\n " | 94 | WHITESPACE@74..79 "\n " |
95 | FN_DEF@79..108 | 95 | FN@79..108 |
96 | FN_KW@79..81 "fn" | 96 | FN_KW@79..81 "fn" |
97 | WHITESPACE@81..82 " " | 97 | WHITESPACE@81..82 " " |
98 | NAME@82..84 | 98 | NAME@82..84 |
@@ -123,7 +123,7 @@ SOURCE_FILE@0..170 | |||
123 | L_CURLY@106..107 "{" | 123 | L_CURLY@106..107 "{" |
124 | R_CURLY@107..108 "}" | 124 | R_CURLY@107..108 "}" |
125 | WHITESPACE@108..113 "\n " | 125 | WHITESPACE@108..113 "\n " |
126 | FN_DEF@113..135 | 126 | FN@113..135 |
127 | FN_KW@113..115 "fn" | 127 | FN_KW@113..115 "fn" |
128 | WHITESPACE@115..116 " " | 128 | WHITESPACE@115..116 " " |
129 | NAME@116..118 | 129 | NAME@116..118 |
@@ -155,7 +155,7 @@ SOURCE_FILE@0..170 | |||
155 | L_CURLY@133..134 "{" | 155 | L_CURLY@133..134 "{" |
156 | R_CURLY@134..135 "}" | 156 | R_CURLY@134..135 "}" |
157 | WHITESPACE@135..140 "\n " | 157 | WHITESPACE@135..140 "\n " |
158 | FN_DEF@140..167 | 158 | FN@140..167 |
159 | FN_KW@140..142 "fn" | 159 | FN_KW@140..142 "fn" |
160 | WHITESPACE@142..143 " " | 160 | WHITESPACE@142..143 " " |
161 | NAME@143..146 | 161 | 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 5a9f07c89..7adedb02e 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 | |||
8 | EXTERN_ITEM_LIST@11..125 | 8 | EXTERN_ITEM_LIST@11..125 |
9 | L_CURLY@11..12 "{" | 9 | L_CURLY@11..12 "{" |
10 | WHITESPACE@12..17 "\n " | 10 | WHITESPACE@12..17 "\n " |
11 | FN_DEF@17..40 | 11 | FN@17..40 |
12 | FN_KW@17..19 "fn" | 12 | FN_KW@17..19 "fn" |
13 | WHITESPACE@19..20 " " | 13 | WHITESPACE@19..20 " " |
14 | NAME@20..21 | 14 | NAME@20..21 |
@@ -37,7 +37,7 @@ SOURCE_FILE@0..126 | |||
37 | R_PAREN@38..39 ")" | 37 | R_PAREN@38..39 ")" |
38 | SEMICOLON@39..40 ";" | 38 | SEMICOLON@39..40 ";" |
39 | WHITESPACE@40..45 "\n " | 39 | WHITESPACE@40..45 "\n " |
40 | FN_DEF@45..70 | 40 | FN@45..70 |
41 | FN_KW@45..47 "fn" | 41 | FN_KW@45..47 "fn" |
42 | WHITESPACE@47..48 " " | 42 | WHITESPACE@47..48 " " |
43 | NAME@48..49 | 43 | NAME@48..49 |
@@ -69,7 +69,7 @@ SOURCE_FILE@0..126 | |||
69 | R_PAREN@68..69 ")" | 69 | R_PAREN@68..69 ")" |
70 | SEMICOLON@69..70 ";" | 70 | SEMICOLON@69..70 ";" |
71 | WHITESPACE@70..75 "\n " | 71 | WHITESPACE@70..75 "\n " |
72 | FN_DEF@75..123 | 72 | FN@75..123 |
73 | FN_KW@75..77 "fn" | 73 | FN_KW@75..77 "fn" |
74 | WHITESPACE@77..78 " " | 74 | WHITESPACE@77..78 " " |
75 | NAME@78..79 | 75 | 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 7b026e33b..ef0eca47c 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 | |||
11 | ASSOC_ITEM_LIST@7..136 | 11 | ASSOC_ITEM_LIST@7..136 |
12 | L_CURLY@7..8 "{" | 12 | L_CURLY@7..8 "{" |
13 | WHITESPACE@8..13 "\n " | 13 | WHITESPACE@8..13 "\n " |
14 | FN_DEF@13..45 | 14 | FN@13..45 |
15 | FN_KW@13..15 "fn" | 15 | FN_KW@13..15 "fn" |
16 | WHITESPACE@15..16 " " | 16 | WHITESPACE@15..16 " " |
17 | NAME@16..18 | 17 | NAME@16..18 |
@@ -53,7 +53,7 @@ SOURCE_FILE@0..137 | |||
53 | L_CURLY@43..44 "{" | 53 | L_CURLY@43..44 "{" |
54 | R_CURLY@44..45 "}" | 54 | R_CURLY@44..45 "}" |
55 | WHITESPACE@45..50 "\n " | 55 | WHITESPACE@45..50 "\n " |
56 | FN_DEF@50..73 | 56 | FN@50..73 |
57 | FN_KW@50..52 "fn" | 57 | FN_KW@50..52 "fn" |
58 | WHITESPACE@52..53 " " | 58 | WHITESPACE@52..53 " " |
59 | NAME@53..55 | 59 | NAME@53..55 |
@@ -95,7 +95,7 @@ SOURCE_FILE@0..137 | |||
95 | L_CURLY@71..72 "{" | 95 | L_CURLY@71..72 "{" |
96 | R_CURLY@72..73 "}" | 96 | R_CURLY@72..73 "}" |
97 | WHITESPACE@73..78 "\n " | 97 | WHITESPACE@73..78 "\n " |
98 | FN_DEF@78..107 | 98 | FN@78..107 |
99 | FN_KW@78..80 "fn" | 99 | FN_KW@78..80 "fn" |
100 | WHITESPACE@80..81 " " | 100 | WHITESPACE@80..81 " " |
101 | NAME@81..83 | 101 | NAME@81..83 |
@@ -126,7 +126,7 @@ SOURCE_FILE@0..137 | |||
126 | L_CURLY@105..106 "{" | 126 | L_CURLY@105..106 "{" |
127 | R_CURLY@106..107 "}" | 127 | R_CURLY@106..107 "}" |
128 | WHITESPACE@107..112 "\n " | 128 | WHITESPACE@107..112 "\n " |
129 | FN_DEF@112..134 | 129 | FN@112..134 |
130 | FN_KW@112..114 "fn" | 130 | FN_KW@112..114 "fn" |
131 | WHITESPACE@114..115 " " | 131 | WHITESPACE@114..115 " " |
132 | NAME@115..117 | 132 | 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 d1fffdd63..29bd38c05 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 @@ | |||
1 | SOURCE_FILE@0..26 | 1 | SOURCE_FILE@0..26 |
2 | FN_DEF@0..25 | 2 | FN@0..25 |
3 | COMMENT@0..11 "/// Example" | 3 | COMMENT@0..11 "/// Example" |
4 | WHITESPACE@11..13 "\n\n" | 4 | WHITESPACE@11..13 "\n\n" |
5 | FN_KW@13..15 "fn" | 5 | 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 eb2f8eb3c..7996dc121 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 @@ | |||
1 | SOURCE_FILE@0..40 | 1 | SOURCE_FILE@0..40 |
2 | FN_DEF@0..39 | 2 | FN@0..39 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..4 | 5 | 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 503585103..e4c2578f6 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 @@ | |||
1 | SOURCE_FILE@0..374 | 1 | SOURCE_FILE@0..374 |
2 | FN_DEF@0..55 | 2 | FN@0..55 |
3 | FN_KW@0..2 "fn" | 3 | FN_KW@0..2 "fn" |
4 | WHITESPACE@2..3 " " | 4 | WHITESPACE@2..3 " " |
5 | NAME@3..12 | 5 | NAME@3..12 |
@@ -59,7 +59,7 @@ SOURCE_FILE@0..374 | |||
59 | WHITESPACE@53..54 "\n" | 59 | WHITESPACE@53..54 "\n" |
60 | R_CURLY@54..55 "}" | 60 | R_CURLY@54..55 "}" |
61 | WHITESPACE@55..56 "\n" | 61 | WHITESPACE@55..56 "\n" |
62 | FN_DEF@56..107 | 62 | FN@56..107 |
63 | FN_KW@56..58 "fn" | 63 | FN_KW@56..58 "fn" |
64 | WHITESPACE@58..59 " " | 64 | WHITESPACE@58..59 " " |
65 | NAME@59..66 | 65 | NAME@59..66 |
@@ -110,7 +110,7 @@ SOURCE_FILE@0..374 | |||
110 | WHITESPACE@105..106 "\n" | 110 | WHITESPACE@105..106 "\n" |
111 | R_CURLY@106..107 "}" | 111 | R_CURLY@106..107 "}" |
112 | WHITESPACE@107..108 "\n" | 112 | WHITESPACE@107..108 "\n" |
113 | FN_DEF@108..170 | 113 | FN@108..170 |
114 | FN_KW@108..110 "fn" | 114 | FN_KW@108..110 "fn" |
115 | WHITESPACE@110..111 " " | 115 | WHITESPACE@110..111 " " |
116 | NAME@111..121 | 116 | NAME@111..121 |
@@ -177,7 +177,7 @@ SOURCE_FILE@0..374 | |||
177 | WHITESPACE@168..169 "\n" | 177 | WHITESPACE@168..169 "\n" |
178 | R_CURLY@169..170 "}" | 178 | R_CURLY@169..170 "}" |
179 | WHITESPACE@170..171 "\n" | 179 | WHITESPACE@170..171 "\n" |
180 | FN_DEF@171..223 | 180 | FN@171..223 |
181 | FN_KW@171..173 "fn" | 181 | FN_KW@171..173 "fn" |
182 | WHITESPACE@173..174 " " | 182 | WHITESPACE@173..174 " " |
183 | NAME@174..183 | 183 | NAME@174..183 |
@@ -231,7 +231,7 @@ SOURCE_FILE@0..374 | |||
231 | WHITESPACE@221..222 "\n" | 231 | WHITESPACE@221..222 "\n" |
232 | R_CURLY@222..223 "}" | 232 | R_CURLY@222..223 "}" |
233 | WHITESPACE@223..224 "\n" | 233 | WHITESPACE@223..224 "\n" |
234 | FN_DEF@224..300 | 234 | FN@224..300 |
235 | FN_KW@224..226 "fn" | 235 | FN_KW@224..226 "fn" |
236 | WHITESPACE@226..227 " " | 236 | WHITESPACE@226..227 " " |
237 | NAME@227..236 | 237 | NAME@227..236 |
@@ -313,7 +313,7 @@ SOURCE_FILE@0..374 | |||
313 | WHITESPACE@298..299 "\n" | 313 | WHITESPACE@298..299 "\n" |
314 | R_CURLY@299..300 "}" | 314 | R_CURLY@299..300 "}" |
315 | WHITESPACE@300..301 "\n" | 315 | WHITESPACE@300..301 "\n" |
316 | FN_DEF@301..373 | 316 | FN@301..373 |
317 | FN_KW@301..303 "fn" | 317 | FN_KW@301..303 "fn" |
318 | WHITESPACE@303..304 " " | 318 | WHITESPACE@303..304 " " |
319 | NAME@304..314 | 319 | NAME@304..314 |
diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs index 87a1367ac..3a0780eb5 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( | |||
1095 | let RangeInfo { range: _, info: navs } = nav_info; | 1095 | let RangeInfo { range: _, info: navs } = nav_info; |
1096 | let res = navs | 1096 | let res = navs |
1097 | .into_iter() | 1097 | .into_iter() |
1098 | .filter(|it| it.kind == SyntaxKind::FN_DEF) | 1098 | .filter(|it| it.kind == SyntaxKind::FN) |
1099 | .map(|it| to_proto::call_hierarchy_item(&snap, it)) | 1099 | .map(|it| to_proto::call_hierarchy_item(&snap, it)) |
1100 | .collect::<Result<Vec<_>>>()?; | 1100 | .collect::<Result<Vec<_>>>()?; |
1101 | 1101 | ||
diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs index c6935c029..34a0d039c 100644 --- a/crates/rust-analyzer/src/to_proto.rs +++ b/crates/rust-analyzer/src/to_proto.rs | |||
@@ -31,14 +31,14 @@ pub(crate) fn range(line_index: &LineIndex, range: TextRange) -> lsp_types::Rang | |||
31 | 31 | ||
32 | pub(crate) fn symbol_kind(syntax_kind: SyntaxKind) -> lsp_types::SymbolKind { | 32 | pub(crate) fn symbol_kind(syntax_kind: SyntaxKind) -> lsp_types::SymbolKind { |
33 | match syntax_kind { | 33 | match syntax_kind { |
34 | SyntaxKind::FN_DEF => lsp_types::SymbolKind::Function, | 34 | SyntaxKind::FN => lsp_types::SymbolKind::Function, |
35 | SyntaxKind::STRUCT_DEF => lsp_types::SymbolKind::Struct, | 35 | SyntaxKind::STRUCT_DEF => lsp_types::SymbolKind::Struct, |
36 | SyntaxKind::ENUM_DEF => lsp_types::SymbolKind::Enum, | 36 | SyntaxKind::ENUM_DEF => lsp_types::SymbolKind::Enum, |
37 | SyntaxKind::ENUM_VARIANT => lsp_types::SymbolKind::EnumMember, | 37 | SyntaxKind::ENUM_VARIANT => lsp_types::SymbolKind::EnumMember, |
38 | SyntaxKind::TRAIT_DEF => lsp_types::SymbolKind::Interface, | 38 | SyntaxKind::TRAIT_DEF => lsp_types::SymbolKind::Interface, |
39 | SyntaxKind::MACRO_CALL => lsp_types::SymbolKind::Function, | 39 | SyntaxKind::MACRO_CALL => lsp_types::SymbolKind::Function, |
40 | SyntaxKind::MODULE => lsp_types::SymbolKind::Module, | 40 | SyntaxKind::MODULE => lsp_types::SymbolKind::Module, |
41 | SyntaxKind::TYPE_ALIAS_DEF => lsp_types::SymbolKind::TypeParameter, | 41 | SyntaxKind::TYPE_ALIAS => lsp_types::SymbolKind::TypeParameter, |
42 | SyntaxKind::RECORD_FIELD_DEF => lsp_types::SymbolKind::Field, | 42 | SyntaxKind::RECORD_FIELD_DEF => lsp_types::SymbolKind::Field, |
43 | SyntaxKind::STATIC_DEF => lsp_types::SymbolKind::Constant, | 43 | SyntaxKind::STATIC_DEF => lsp_types::SymbolKind::Constant, |
44 | SyntaxKind::CONST_DEF => lsp_types::SymbolKind::Constant, | 44 | SyntaxKind::CONST_DEF => lsp_types::SymbolKind::Constant, |