diff options
Diffstat (limited to 'crates')
52 files changed, 189 insertions, 144 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 f185e61e5..a2d9006e4 100644 --- a/crates/ra_assists/src/handlers/add_missing_impl_members.rs +++ b/crates/ra_assists/src/handlers/add_missing_impl_members.rs | |||
@@ -112,7 +112,7 @@ fn add_missing_impl_members_inner( | |||
112 | ) -> Option<()> { | 112 | ) -> Option<()> { |
113 | let _p = ra_prof::profile("add_missing_impl_members_inner"); | 113 | let _p = ra_prof::profile("add_missing_impl_members_inner"); |
114 | let impl_def = ctx.find_node_at_offset::<ast::ImplDef>()?; | 114 | let impl_def = ctx.find_node_at_offset::<ast::ImplDef>()?; |
115 | let impl_item_list = impl_def.item_list()?; | 115 | let impl_item_list = impl_def.assoc_item_list()?; |
116 | 116 | ||
117 | let trait_ = resolve_target_trait(&ctx.sema, &impl_def)?; | 117 | let trait_ = resolve_target_trait(&ctx.sema, &impl_def)?; |
118 | 118 | ||
@@ -121,6 +121,7 @@ fn add_missing_impl_members_inner( | |||
121 | ast::AssocItem::FnDef(def) => def.name(), | 121 | ast::AssocItem::FnDef(def) => def.name(), |
122 | ast::AssocItem::TypeAliasDef(def) => def.name(), | 122 | ast::AssocItem::TypeAliasDef(def) => def.name(), |
123 | ast::AssocItem::ConstDef(def) => def.name(), | 123 | ast::AssocItem::ConstDef(def) => def.name(), |
124 | ast::AssocItem::MacroCall(_) => None, | ||
124 | } | 125 | } |
125 | .map(|it| it.text().clone()) | 126 | .map(|it| it.text().clone()) |
126 | }; | 127 | }; |
diff --git a/crates/ra_assists/src/handlers/generate_new.rs b/crates/ra_assists/src/handlers/generate_new.rs index e27def1d8..25bc171bf 100644 --- a/crates/ra_assists/src/handlers/generate_new.rs +++ b/crates/ra_assists/src/handlers/generate_new.rs | |||
@@ -158,7 +158,7 @@ fn find_struct_impl(ctx: &AssistContext, strukt: &ast::StructDef) -> Option<Opti | |||
158 | } | 158 | } |
159 | 159 | ||
160 | fn has_new_fn(imp: &ast::ImplDef) -> bool { | 160 | fn has_new_fn(imp: &ast::ImplDef) -> bool { |
161 | if let Some(il) = imp.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::FnDef(f) = item { |
164 | if let Some(name) = f.name() { | 164 | if let Some(name) = f.name() { |
diff --git a/crates/ra_assists/src/handlers/move_bounds.rs b/crates/ra_assists/src/handlers/move_bounds.rs index ba3dafb99..6b73fff44 100644 --- a/crates/ra_assists/src/handlers/move_bounds.rs +++ b/crates/ra_assists/src/handlers/move_bounds.rs | |||
@@ -38,8 +38,8 @@ pub(crate) fn move_bounds_to_where_clause(acc: &mut Assists, ctx: &AssistContext | |||
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::FnDef(it) => it.body()?.syntax().clone().into(), |
41 | ast::TraitDef(it) => it.item_list()?.syntax().clone().into(), | 41 | ast::TraitDef(it) => it.assoc_item_list()?.syntax().clone().into(), |
42 | ast::ImplDef(it) => it.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(), |
44 | ast::StructDef(it) => { | 44 | ast::StructDef(it) => { |
45 | it.syntax().children_with_tokens() | 45 | it.syntax().children_with_tokens() |
diff --git a/crates/ra_assists/src/utils.rs b/crates/ra_assists/src/utils.rs index 02de902d6..27c33df23 100644 --- a/crates/ra_assists/src/utils.rs +++ b/crates/ra_assists/src/utils.rs | |||
@@ -63,7 +63,7 @@ pub fn get_missing_assoc_items( | |||
63 | let mut impl_fns_consts = FxHashSet::default(); | 63 | let mut impl_fns_consts = FxHashSet::default(); |
64 | let mut impl_type = FxHashSet::default(); | 64 | let mut impl_type = FxHashSet::default(); |
65 | 65 | ||
66 | if let Some(item_list) = impl_def.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::FnDef(f) => { |
@@ -83,6 +83,7 @@ pub fn get_missing_assoc_items( | |||
83 | impl_fns_consts.insert(n.syntax().to_string()); | 83 | impl_fns_consts.insert(n.syntax().to_string()); |
84 | } | 84 | } |
85 | } | 85 | } |
86 | ast::AssocItem::MacroCall(_) => (), | ||
86 | } | 87 | } |
87 | } | 88 | } |
88 | } | 89 | } |
diff --git a/crates/ra_assists/src/utils/insert_use.rs b/crates/ra_assists/src/utils/insert_use.rs index 8c4f33e59..c05027eff 100644 --- a/crates/ra_assists/src/utils/insert_use.rs +++ b/crates/ra_assists/src/utils/insert_use.rs | |||
@@ -215,7 +215,7 @@ fn walk_use_tree_for_best_action( | |||
215 | let prev_len = current_path_segments.len(); | 215 | let prev_len = current_path_segments.len(); |
216 | 216 | ||
217 | let tree_list = current_use_tree.use_tree_list(); | 217 | let tree_list = current_use_tree.use_tree_list(); |
218 | let alias = current_use_tree.alias(); | 218 | let alias = current_use_tree.rename(); |
219 | 219 | ||
220 | let path = match current_use_tree.path() { | 220 | let path = match current_use_tree.path() { |
221 | Some(path) => path, | 221 | Some(path) => path, |
diff --git a/crates/ra_hir_def/src/item_tree/lower.rs b/crates/ra_hir_def/src/item_tree/lower.rs index eb1da4632..6c58c6378 100644 --- a/crates/ra_hir_def/src/item_tree/lower.rs +++ b/crates/ra_hir_def/src/item_tree/lower.rs | |||
@@ -153,13 +153,12 @@ impl Ctx { | |||
153 | self.forced_visibility = forced_vis; | 153 | self.forced_visibility = forced_vis; |
154 | } | 154 | } |
155 | 155 | ||
156 | fn lower_assoc_item(&mut self, item: &ast::Item) -> Option<AssocItem> { | 156 | fn lower_assoc_item(&mut self, item: &ast::AssocItem) -> Option<AssocItem> { |
157 | match item { | 157 | match item { |
158 | ast::Item::FnDef(ast) => self.lower_function(ast).map(Into::into), | 158 | ast::AssocItem::FnDef(ast) => self.lower_function(ast).map(Into::into), |
159 | ast::Item::TypeAliasDef(ast) => self.lower_type_alias(ast).map(Into::into), | 159 | ast::AssocItem::TypeAliasDef(ast) => self.lower_type_alias(ast).map(Into::into), |
160 | ast::Item::ConstDef(ast) => Some(self.lower_const(ast).into()), | 160 | ast::AssocItem::ConstDef(ast) => Some(self.lower_const(ast).into()), |
161 | ast::Item::MacroCall(ast) => self.lower_macro_call(ast).map(Into::into), | 161 | ast::AssocItem::MacroCall(ast) => self.lower_macro_call(ast).map(Into::into), |
162 | _ => None, | ||
163 | } | 162 | } |
164 | } | 163 | } |
165 | 164 | ||
@@ -419,9 +418,9 @@ impl Ctx { | |||
419 | let generic_params = | 418 | let generic_params = |
420 | self.lower_generic_params_and_inner_items(GenericsOwner::Trait(trait_def), trait_def); | 419 | self.lower_generic_params_and_inner_items(GenericsOwner::Trait(trait_def), trait_def); |
421 | let auto = trait_def.auto_token().is_some(); | 420 | let auto = trait_def.auto_token().is_some(); |
422 | let items = trait_def.item_list().map(|list| { | 421 | let items = trait_def.assoc_item_list().map(|list| { |
423 | self.with_inherited_visibility(visibility, |this| { | 422 | self.with_inherited_visibility(visibility, |this| { |
424 | list.items() | 423 | list.assoc_items() |
425 | .filter_map(|item| { | 424 | .filter_map(|item| { |
426 | let attrs = Attrs::new(&item, &this.hygiene); | 425 | let attrs = Attrs::new(&item, &this.hygiene); |
427 | this.collect_inner_items(item.syntax()); | 426 | this.collect_inner_items(item.syntax()); |
@@ -454,9 +453,9 @@ impl Ctx { | |||
454 | 453 | ||
455 | // We cannot use `assoc_items()` here as that does not include macro calls. | 454 | // We cannot use `assoc_items()` here as that does not include macro calls. |
456 | let items = impl_def | 455 | let items = impl_def |
457 | .item_list() | 456 | .assoc_item_list() |
458 | .into_iter() | 457 | .into_iter() |
459 | .flat_map(|it| it.items()) | 458 | .flat_map(|it| it.assoc_items()) |
460 | .filter_map(|item| { | 459 | .filter_map(|item| { |
461 | self.collect_inner_items(item.syntax()); | 460 | self.collect_inner_items(item.syntax()); |
462 | let assoc = self.lower_assoc_item(&item)?; | 461 | let assoc = self.lower_assoc_item(&item)?; |
@@ -502,7 +501,7 @@ impl Ctx { | |||
502 | extern_crate: &ast::ExternCrateItem, | 501 | extern_crate: &ast::ExternCrateItem, |
503 | ) -> Option<FileItemTreeId<ExternCrate>> { | 502 | ) -> Option<FileItemTreeId<ExternCrate>> { |
504 | let path = ModPath::from_name_ref(&extern_crate.name_ref()?); | 503 | let path = ModPath::from_name_ref(&extern_crate.name_ref()?); |
505 | let alias = extern_crate.alias().map(|a| { | 504 | let alias = extern_crate.rename().map(|a| { |
506 | a.name().map(|it| it.as_name()).map_or(ImportAlias::Underscore, ImportAlias::Alias) | 505 | a.name().map(|it| it.as_name()).map_or(ImportAlias::Underscore, ImportAlias::Alias) |
507 | }); | 506 | }); |
508 | let visibility = self.lower_visibility(extern_crate); | 507 | let visibility = self.lower_visibility(extern_crate); |
diff --git a/crates/ra_hir_def/src/path/lower/lower_use.rs b/crates/ra_hir_def/src/path/lower/lower_use.rs index 7cc655487..794be45e8 100644 --- a/crates/ra_hir_def/src/path/lower/lower_use.rs +++ b/crates/ra_hir_def/src/path/lower/lower_use.rs | |||
@@ -31,7 +31,7 @@ pub(crate) fn lower_use_tree( | |||
31 | lower_use_tree(prefix.clone(), child_tree, hygiene, cb); | 31 | lower_use_tree(prefix.clone(), child_tree, hygiene, cb); |
32 | } | 32 | } |
33 | } else { | 33 | } else { |
34 | let alias = tree.alias().map(|a| { | 34 | let alias = tree.rename().map(|a| { |
35 | a.name().map(|it| it.as_name()).map_or(ImportAlias::Underscore, ImportAlias::Alias) | 35 | a.name().map(|it| it.as_name()).map_or(ImportAlias::Underscore, ImportAlias::Alias) |
36 | }); | 36 | }); |
37 | let is_glob = tree.star_token().is_some(); | 37 | let is_glob = tree.star_token().is_some(); |
diff --git a/crates/ra_ide/src/completion/complete_fn_param.rs b/crates/ra_ide/src/completion/complete_fn_param.rs index 7a53083f5..d4b6112a5 100644 --- a/crates/ra_ide/src/completion/complete_fn_param.rs +++ b/crates/ra_ide/src/completion/complete_fn_param.rs | |||
@@ -18,26 +18,36 @@ pub(super) fn complete_fn_param(acc: &mut Completions, ctx: &CompletionContext) | |||
18 | } | 18 | } |
19 | 19 | ||
20 | let mut params = FxHashMap::default(); | 20 | let mut params = FxHashMap::default(); |
21 | |||
21 | let me = ctx.token.ancestors().find_map(ast::FnDef::cast); | 22 | let me = ctx.token.ancestors().find_map(ast::FnDef::cast); |
23 | let mut process_fn = |func: ast::FnDef| { | ||
24 | if Some(&func) == me.as_ref() { | ||
25 | return; | ||
26 | } | ||
27 | func.param_list().into_iter().flat_map(|it| it.params()).for_each(|param| { | ||
28 | let text = param.syntax().text().to_string(); | ||
29 | params.entry(text).or_insert(param); | ||
30 | }) | ||
31 | }; | ||
32 | |||
22 | for node in ctx.token.parent().ancestors() { | 33 | for node in ctx.token.parent().ancestors() { |
23 | let items = match_ast! { | 34 | match_ast! { |
24 | match node { | 35 | match node { |
25 | ast::SourceFile(it) => it.items(), | 36 | ast::SourceFile(it) => it.items().filter_map(|item| match item { |
26 | ast::ItemList(it) => it.items(), | 37 | ast::Item::FnDef(it) => Some(it), |
38 | _ => None, | ||
39 | }).for_each(&mut process_fn), | ||
40 | ast::ItemList(it) => it.items().filter_map(|item| match item { | ||
41 | ast::Item::FnDef(it) => Some(it), | ||
42 | _ => None, | ||
43 | }).for_each(&mut process_fn), | ||
44 | ast::AssocItemList(it) => it.assoc_items().filter_map(|item| match item { | ||
45 | ast::AssocItem::FnDef(it) => Some(it), | ||
46 | _ => None, | ||
47 | }).for_each(&mut process_fn), | ||
27 | _ => continue, | 48 | _ => continue, |
28 | } | 49 | } |
29 | }; | 50 | }; |
30 | for item in items { | ||
31 | if let ast::Item::FnDef(func) = item { | ||
32 | if Some(&func) == me.as_ref() { | ||
33 | continue; | ||
34 | } | ||
35 | func.param_list().into_iter().flat_map(|it| it.params()).for_each(|param| { | ||
36 | let text = param.syntax().text().to_string(); | ||
37 | params.entry(text).or_insert(param); | ||
38 | }) | ||
39 | } | ||
40 | } | ||
41 | } | 51 | } |
42 | 52 | ||
43 | params | 53 | params |
diff --git a/crates/ra_ide/src/completion/complete_keyword.rs b/crates/ra_ide/src/completion/complete_keyword.rs index fcdaeef49..1581b2d5d 100644 --- a/crates/ra_ide/src/completion/complete_keyword.rs +++ b/crates/ra_ide/src/completion/complete_keyword.rs | |||
@@ -66,27 +66,24 @@ pub(super) fn complete_expr_keyword(acc: &mut Completions, ctx: &CompletionConte | |||
66 | add_keyword(ctx, acc, "fn", "fn $0() {}") | 66 | add_keyword(ctx, acc, "fn", "fn $0() {}") |
67 | } | 67 | } |
68 | 68 | ||
69 | if (ctx.has_item_list_or_source_file_parent && !has_trait_or_impl_parent) | 69 | if (ctx.has_item_list_or_source_file_parent) || ctx.block_expr_parent { |
70 | || ctx.block_expr_parent | ||
71 | { | ||
72 | add_keyword(ctx, acc, "trait", "trait $0 {}"); | 70 | add_keyword(ctx, acc, "trait", "trait $0 {}"); |
73 | add_keyword(ctx, acc, "impl", "impl $0 {}"); | 71 | add_keyword(ctx, acc, "impl", "impl $0 {}"); |
74 | } | 72 | } |
75 | 73 | ||
76 | return; | 74 | return; |
77 | } | 75 | } |
78 | if ctx.has_item_list_or_source_file_parent || ctx.block_expr_parent { | 76 | if ctx.has_item_list_or_source_file_parent || has_trait_or_impl_parent || ctx.block_expr_parent |
77 | { | ||
79 | add_keyword(ctx, acc, "fn", "fn $0() {}"); | 78 | add_keyword(ctx, acc, "fn", "fn $0() {}"); |
80 | } | 79 | } |
81 | if (ctx.has_item_list_or_source_file_parent && !has_trait_or_impl_parent) | 80 | if (ctx.has_item_list_or_source_file_parent) || ctx.block_expr_parent { |
82 | || ctx.block_expr_parent | ||
83 | { | ||
84 | add_keyword(ctx, acc, "use", "use "); | 81 | add_keyword(ctx, acc, "use", "use "); |
85 | add_keyword(ctx, acc, "impl", "impl $0 {}"); | 82 | add_keyword(ctx, acc, "impl", "impl $0 {}"); |
86 | add_keyword(ctx, acc, "trait", "trait $0 {}"); | 83 | add_keyword(ctx, acc, "trait", "trait $0 {}"); |
87 | } | 84 | } |
88 | 85 | ||
89 | if ctx.has_item_list_or_source_file_parent && !has_trait_or_impl_parent { | 86 | if ctx.has_item_list_or_source_file_parent { |
90 | add_keyword(ctx, acc, "enum", "enum $0 {}"); | 87 | add_keyword(ctx, acc, "enum", "enum $0 {}"); |
91 | add_keyword(ctx, acc, "struct", "struct $0"); | 88 | add_keyword(ctx, acc, "struct", "struct $0"); |
92 | add_keyword(ctx, acc, "union", "union $0 {}"); | 89 | add_keyword(ctx, acc, "union", "union $0 {}"); |
@@ -108,29 +105,28 @@ pub(super) fn complete_expr_keyword(acc: &mut Completions, ctx: &CompletionConte | |||
108 | add_keyword(ctx, acc, "else", "else {$0}"); | 105 | add_keyword(ctx, acc, "else", "else {$0}"); |
109 | add_keyword(ctx, acc, "else if", "else if $0 {}"); | 106 | add_keyword(ctx, acc, "else if", "else if $0 {}"); |
110 | } | 107 | } |
111 | if (ctx.has_item_list_or_source_file_parent && !has_trait_or_impl_parent) | 108 | if (ctx.has_item_list_or_source_file_parent) || ctx.block_expr_parent { |
112 | || ctx.block_expr_parent | ||
113 | { | ||
114 | add_keyword(ctx, acc, "mod", "mod $0 {}"); | 109 | add_keyword(ctx, acc, "mod", "mod $0 {}"); |
115 | } | 110 | } |
116 | if ctx.bind_pat_parent || ctx.ref_pat_parent { | 111 | if ctx.bind_pat_parent || ctx.ref_pat_parent { |
117 | add_keyword(ctx, acc, "mut", "mut "); | 112 | add_keyword(ctx, acc, "mut", "mut "); |
118 | } | 113 | } |
119 | if ctx.has_item_list_or_source_file_parent || ctx.block_expr_parent { | 114 | if ctx.has_item_list_or_source_file_parent || has_trait_or_impl_parent || ctx.block_expr_parent |
115 | { | ||
120 | add_keyword(ctx, acc, "const", "const "); | 116 | add_keyword(ctx, acc, "const", "const "); |
121 | add_keyword(ctx, acc, "type", "type "); | 117 | add_keyword(ctx, acc, "type", "type "); |
122 | } | 118 | } |
123 | if (ctx.has_item_list_or_source_file_parent && !has_trait_or_impl_parent) | 119 | if (ctx.has_item_list_or_source_file_parent) || ctx.block_expr_parent { |
124 | || ctx.block_expr_parent | ||
125 | { | ||
126 | add_keyword(ctx, acc, "static", "static "); | 120 | add_keyword(ctx, acc, "static", "static "); |
127 | }; | 121 | }; |
128 | if (ctx.has_item_list_or_source_file_parent && !has_trait_or_impl_parent) | 122 | if (ctx.has_item_list_or_source_file_parent) || ctx.block_expr_parent { |
129 | || ctx.block_expr_parent | ||
130 | { | ||
131 | add_keyword(ctx, acc, "extern", "extern "); | 123 | add_keyword(ctx, acc, "extern", "extern "); |
132 | } | 124 | } |
133 | if ctx.has_item_list_or_source_file_parent || ctx.block_expr_parent || ctx.is_match_arm { | 125 | if ctx.has_item_list_or_source_file_parent |
126 | || has_trait_or_impl_parent | ||
127 | || ctx.block_expr_parent | ||
128 | || ctx.is_match_arm | ||
129 | { | ||
134 | add_keyword(ctx, acc, "unsafe", "unsafe "); | 130 | add_keyword(ctx, acc, "unsafe", "unsafe "); |
135 | } | 131 | } |
136 | if ctx.in_loop_body { | 132 | if ctx.in_loop_body { |
@@ -142,7 +138,7 @@ pub(super) fn complete_expr_keyword(acc: &mut Completions, ctx: &CompletionConte | |||
142 | add_keyword(ctx, acc, "break", "break"); | 138 | add_keyword(ctx, acc, "break", "break"); |
143 | } | 139 | } |
144 | } | 140 | } |
145 | if ctx.has_item_list_or_source_file_parent && !ctx.has_trait_parent { | 141 | if ctx.has_item_list_or_source_file_parent || ctx.has_impl_parent { |
146 | add_keyword(ctx, acc, "pub", "pub ") | 142 | add_keyword(ctx, acc, "pub", "pub ") |
147 | } | 143 | } |
148 | 144 | ||
diff --git a/crates/ra_ide/src/completion/patterns.rs b/crates/ra_ide/src/completion/patterns.rs index b2fe13280..175209d8a 100644 --- a/crates/ra_ide/src/completion/patterns.rs +++ b/crates/ra_ide/src/completion/patterns.rs | |||
@@ -13,7 +13,7 @@ use crate::completion::test_utils::check_pattern_is_applicable; | |||
13 | 13 | ||
14 | pub(crate) fn has_trait_parent(element: SyntaxElement) -> bool { | 14 | pub(crate) fn has_trait_parent(element: SyntaxElement) -> bool { |
15 | not_same_range_ancestor(element) | 15 | not_same_range_ancestor(element) |
16 | .filter(|it| it.kind() == ITEM_LIST) | 16 | .filter(|it| it.kind() == ASSOC_ITEM_LIST) |
17 | .and_then(|it| it.parent()) | 17 | .and_then(|it| it.parent()) |
18 | .filter(|it| it.kind() == TRAIT_DEF) | 18 | .filter(|it| it.kind() == TRAIT_DEF) |
19 | .is_some() | 19 | .is_some() |
@@ -25,7 +25,7 @@ fn test_has_trait_parent() { | |||
25 | 25 | ||
26 | pub(crate) fn has_impl_parent(element: SyntaxElement) -> bool { | 26 | pub(crate) fn has_impl_parent(element: SyntaxElement) -> bool { |
27 | not_same_range_ancestor(element) | 27 | not_same_range_ancestor(element) |
28 | .filter(|it| it.kind() == ITEM_LIST) | 28 | .filter(|it| it.kind() == ASSOC_ITEM_LIST) |
29 | .and_then(|it| it.parent()) | 29 | .and_then(|it| it.parent()) |
30 | .filter(|it| it.kind() == IMPL_DEF) | 30 | .filter(|it| it.kind() == IMPL_DEF) |
31 | .is_some() | 31 | .is_some() |
@@ -73,7 +73,7 @@ pub(crate) fn has_item_list_or_source_file_parent(element: SyntaxElement) -> boo | |||
73 | #[test] | 73 | #[test] |
74 | fn test_has_item_list_or_source_file_parent() { | 74 | fn test_has_item_list_or_source_file_parent() { |
75 | check_pattern_is_applicable(r"i<|>", has_item_list_or_source_file_parent); | 75 | check_pattern_is_applicable(r"i<|>", has_item_list_or_source_file_parent); |
76 | check_pattern_is_applicable(r"impl { f<|> }", has_item_list_or_source_file_parent); | 76 | check_pattern_is_applicable(r"mod foo { f<|> }", has_item_list_or_source_file_parent); |
77 | } | 77 | } |
78 | 78 | ||
79 | pub(crate) fn is_match_arm(element: SyntaxElement) -> bool { | 79 | pub(crate) fn is_match_arm(element: SyntaxElement) -> bool { |
diff --git a/crates/ra_ide_db/src/defs.rs b/crates/ra_ide_db/src/defs.rs index f391a8e43..1464c5f2a 100644 --- a/crates/ra_ide_db/src/defs.rs +++ b/crates/ra_ide_db/src/defs.rs | |||
@@ -119,7 +119,7 @@ pub fn classify_name(sema: &Semantics<RootDatabase>, name: &ast::Name) -> Option | |||
119 | 119 | ||
120 | match_ast! { | 120 | match_ast! { |
121 | match parent { | 121 | match parent { |
122 | ast::Alias(it) => { | 122 | ast::Rename(it) => { |
123 | let use_tree = it.syntax().parent().and_then(ast::UseTree::cast)?; | 123 | let use_tree = it.syntax().parent().and_then(ast::UseTree::cast)?; |
124 | let path = use_tree.path()?; | 124 | let path = use_tree.path()?; |
125 | let path_segment = path.segment()?; | 125 | let path_segment = path.segment()?; |
diff --git a/crates/ra_parser/src/grammar.rs b/crates/ra_parser/src/grammar.rs index de2c98afd..7dfac2813 100644 --- a/crates/ra_parser/src/grammar.rs +++ b/crates/ra_parser/src/grammar.rs | |||
@@ -149,12 +149,12 @@ pub(crate) fn reparser( | |||
149 | USE_TREE_LIST => items::use_tree_list, | 149 | USE_TREE_LIST => items::use_tree_list, |
150 | EXTERN_ITEM_LIST => items::extern_item_list, | 150 | EXTERN_ITEM_LIST => items::extern_item_list, |
151 | TOKEN_TREE if first_child? == T!['{'] => items::token_tree, | 151 | TOKEN_TREE if first_child? == T!['{'] => items::token_tree, |
152 | ITEM_LIST => match parent? { | 152 | ASSOC_ITEM_LIST => match parent? { |
153 | IMPL_DEF => items::impl_item_list, | 153 | IMPL_DEF => items::impl_item_list, |
154 | TRAIT_DEF => items::trait_item_list, | 154 | TRAIT_DEF => items::trait_item_list, |
155 | MODULE => items::mod_item_list, | ||
156 | _ => return None, | 155 | _ => return None, |
157 | }, | 156 | }, |
157 | ITEM_LIST => items::mod_item_list, | ||
158 | _ => return None, | 158 | _ => return None, |
159 | }; | 159 | }; |
160 | Some(res) | 160 | Some(res) |
@@ -224,7 +224,7 @@ fn opt_alias(p: &mut Parser) { | |||
224 | if !p.eat(T![_]) { | 224 | if !p.eat(T![_]) { |
225 | name(p); | 225 | name(p); |
226 | } | 226 | } |
227 | m.complete(p, ALIAS); | 227 | m.complete(p, RENAME); |
228 | } | 228 | } |
229 | } | 229 | } |
230 | 230 | ||
diff --git a/crates/ra_parser/src/grammar/items/traits.rs b/crates/ra_parser/src/grammar/items/traits.rs index c819e33be..ef9c8ff5b 100644 --- a/crates/ra_parser/src/grammar/items/traits.rs +++ b/crates/ra_parser/src/grammar/items/traits.rs | |||
@@ -50,7 +50,7 @@ pub(crate) fn trait_item_list(p: &mut Parser) { | |||
50 | item_or_macro(p, true, ItemFlavor::Trait); | 50 | item_or_macro(p, true, ItemFlavor::Trait); |
51 | } | 51 | } |
52 | p.expect(T!['}']); | 52 | p.expect(T!['}']); |
53 | m.complete(p, ITEM_LIST); | 53 | m.complete(p, ASSOC_ITEM_LIST); |
54 | } | 54 | } |
55 | 55 | ||
56 | // test impl_def | 56 | // test impl_def |
@@ -107,7 +107,7 @@ pub(crate) fn impl_item_list(p: &mut Parser) { | |||
107 | item_or_macro(p, true, ItemFlavor::Mod); | 107 | item_or_macro(p, true, ItemFlavor::Mod); |
108 | } | 108 | } |
109 | p.expect(T!['}']); | 109 | p.expect(T!['}']); |
110 | m.complete(p, ITEM_LIST); | 110 | m.complete(p, ASSOC_ITEM_LIST); |
111 | } | 111 | } |
112 | 112 | ||
113 | // test impl_type_params | 113 | // test impl_type_params |
diff --git a/crates/ra_parser/src/syntax_kind/generated.rs b/crates/ra_parser/src/syntax_kind/generated.rs index 625f0c822..f14b60b65 100644 --- a/crates/ra_parser/src/syntax_kind/generated.rs +++ b/crates/ra_parser/src/syntax_kind/generated.rs | |||
@@ -213,6 +213,7 @@ pub enum SyntaxKind { | |||
213 | TUPLE_FIELD_DEF, | 213 | TUPLE_FIELD_DEF, |
214 | ENUM_VARIANT_LIST, | 214 | ENUM_VARIANT_LIST, |
215 | ITEM_LIST, | 215 | ITEM_LIST, |
216 | ASSOC_ITEM_LIST, | ||
216 | ATTR, | 217 | ATTR, |
217 | META_ITEM, | 218 | META_ITEM, |
218 | USE_TREE, | 219 | USE_TREE, |
@@ -220,7 +221,7 @@ pub enum SyntaxKind { | |||
220 | PATH, | 221 | PATH, |
221 | PATH_SEGMENT, | 222 | PATH_SEGMENT, |
222 | LITERAL, | 223 | LITERAL, |
223 | ALIAS, | 224 | RENAME, |
224 | VISIBILITY, | 225 | VISIBILITY, |
225 | WHERE_CLAUSE, | 226 | WHERE_CLAUSE, |
226 | WHERE_PRED, | 227 | WHERE_PRED, |
diff --git a/crates/ra_syntax/src/ast/edit.rs b/crates/ra_syntax/src/ast/edit.rs index abc7a646c..2e958fa23 100644 --- a/crates/ra_syntax/src/ast/edit.rs +++ b/crates/ra_syntax/src/ast/edit.rs | |||
@@ -80,9 +80,12 @@ where | |||
80 | } | 80 | } |
81 | } | 81 | } |
82 | 82 | ||
83 | impl ast::ItemList { | 83 | impl ast::AssocItemList { |
84 | #[must_use] | 84 | #[must_use] |
85 | pub fn append_items(&self, items: impl IntoIterator<Item = ast::AssocItem>) -> ast::ItemList { | 85 | pub fn append_items( |
86 | &self, | ||
87 | items: impl IntoIterator<Item = ast::AssocItem>, | ||
88 | ) -> ast::AssocItemList { | ||
86 | let mut res = self.clone(); | 89 | let mut res = self.clone(); |
87 | if !self.syntax().text().contains_char('\n') { | 90 | if !self.syntax().text().contains_char('\n') { |
88 | res = make_multiline(res); | 91 | res = make_multiline(res); |
@@ -92,7 +95,7 @@ impl ast::ItemList { | |||
92 | } | 95 | } |
93 | 96 | ||
94 | #[must_use] | 97 | #[must_use] |
95 | pub fn append_item(&self, item: ast::AssocItem) -> ast::ItemList { | 98 | pub fn append_item(&self, item: ast::AssocItem) -> ast::AssocItemList { |
96 | let (indent, position) = match self.assoc_items().last() { | 99 | let (indent, position) = match self.assoc_items().last() { |
97 | Some(it) => ( | 100 | Some(it) => ( |
98 | leading_indent(it.syntax()).unwrap_or_default().to_string(), | 101 | leading_indent(it.syntax()).unwrap_or_default().to_string(), |
@@ -314,8 +317,12 @@ impl ast::UseTree { | |||
314 | Some(it) => it, | 317 | Some(it) => it, |
315 | None => return self.clone(), | 318 | None => return self.clone(), |
316 | }; | 319 | }; |
317 | let use_tree = | 320 | let use_tree = make::use_tree( |
318 | make::use_tree(suffix, self.use_tree_list(), self.alias(), self.star_token().is_some()); | 321 | suffix, |
322 | self.use_tree_list(), | ||
323 | self.rename(), | ||
324 | self.star_token().is_some(), | ||
325 | ); | ||
319 | let nested = make::use_tree_list(iter::once(use_tree)); | 326 | let nested = make::use_tree_list(iter::once(use_tree)); |
320 | return make::use_tree(prefix.clone(), Some(nested), None, false); | 327 | return make::use_tree(prefix.clone(), Some(nested), None, false); |
321 | 328 | ||
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index dfda79550..01e8111b0 100644 --- a/crates/ra_syntax/src/ast/generated/nodes.rs +++ b/crates/ra_syntax/src/ast/generated/nodes.rs | |||
@@ -75,7 +75,7 @@ impl ExternCrateItem { | |||
75 | pub fn crate_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![crate]) } | 75 | pub fn crate_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![crate]) } |
76 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } | 76 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } |
77 | pub fn self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![self]) } | 77 | pub fn self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![self]) } |
78 | pub fn alias(&self) -> Option<Alias> { support::child(&self.syntax) } | 78 | pub fn rename(&self) -> Option<Rename> { support::child(&self.syntax) } |
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)] |
@@ -112,7 +112,7 @@ impl ImplDef { | |||
112 | pub fn impl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![impl]) } | 112 | pub fn impl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![impl]) } |
113 | pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) } | 113 | pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) } |
114 | pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) } | 114 | pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) } |
115 | pub fn item_list(&self) -> Option<ItemList> { support::child(&self.syntax) } | 115 | pub fn assoc_item_list(&self) -> Option<AssocItemList> { support::child(&self.syntax) } |
116 | } | 116 | } |
117 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 117 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
118 | pub struct MacroCall { | 118 | pub struct MacroCall { |
@@ -180,7 +180,7 @@ impl TraitDef { | |||
180 | pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } | 180 | pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } |
181 | pub fn auto_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![auto]) } | 181 | pub fn auto_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![auto]) } |
182 | pub fn trait_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![trait]) } | 182 | pub fn trait_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![trait]) } |
183 | pub fn item_list(&self) -> Option<ItemList> { 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 TypeAliasDef { |
@@ -238,11 +238,6 @@ impl Visibility { | |||
238 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } | 238 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } |
239 | } | 239 | } |
240 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 240 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
241 | pub struct Abi { | ||
242 | pub(crate) syntax: SyntaxNode, | ||
243 | } | ||
244 | impl Abi {} | ||
245 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
246 | pub struct Name { | 241 | pub struct Name { |
247 | pub(crate) syntax: SyntaxNode, | 242 | pub(crate) syntax: SyntaxNode, |
248 | } | 243 | } |
@@ -250,6 +245,21 @@ impl Name { | |||
250 | pub fn ident_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![ident]) } | 245 | pub fn ident_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![ident]) } |
251 | } | 246 | } |
252 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 247 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
248 | pub struct ItemList { | ||
249 | pub(crate) syntax: SyntaxNode, | ||
250 | } | ||
251 | impl ast::AttrsOwner for ItemList {} | ||
252 | impl ast::ModuleItemOwner for ItemList {} | ||
253 | impl ItemList { | ||
254 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } | ||
255 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } | ||
256 | } | ||
257 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
258 | pub struct Abi { | ||
259 | pub(crate) syntax: SyntaxNode, | ||
260 | } | ||
261 | impl Abi {} | ||
262 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
253 | pub struct TypeParamList { | 263 | pub struct TypeParamList { |
254 | pub(crate) syntax: SyntaxNode, | 264 | pub(crate) syntax: SyntaxNode, |
255 | } | 265 | } |
@@ -367,11 +377,10 @@ impl TypeBoundList { | |||
367 | pub fn bounds(&self) -> AstChildren<TypeBound> { support::children(&self.syntax) } | 377 | pub fn bounds(&self) -> AstChildren<TypeBound> { support::children(&self.syntax) } |
368 | } | 378 | } |
369 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 379 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
370 | pub struct ItemList { | 380 | pub struct AssocItemList { |
371 | pub(crate) syntax: SyntaxNode, | 381 | pub(crate) syntax: SyntaxNode, |
372 | } | 382 | } |
373 | impl ast::ModuleItemOwner for ItemList {} | 383 | impl AssocItemList { |
374 | impl ItemList { | ||
375 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } | 384 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } |
376 | pub fn assoc_items(&self) -> AstChildren<AssocItem> { support::children(&self.syntax) } | 385 | pub fn assoc_items(&self) -> AstChildren<AssocItem> { support::children(&self.syntax) } |
377 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } | 386 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } |
@@ -1169,7 +1178,7 @@ impl UseTree { | |||
1169 | pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) } | 1178 | pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) } |
1170 | pub fn star_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![*]) } | 1179 | pub fn star_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![*]) } |
1171 | pub fn use_tree_list(&self) -> Option<UseTreeList> { support::child(&self.syntax) } | 1180 | pub fn use_tree_list(&self) -> Option<UseTreeList> { support::child(&self.syntax) } |
1172 | pub fn alias(&self) -> Option<Alias> { support::child(&self.syntax) } | 1181 | pub fn rename(&self) -> Option<Rename> { support::child(&self.syntax) } |
1173 | } | 1182 | } |
1174 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1183 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1175 | pub struct UseTreeList { | 1184 | pub struct UseTreeList { |
@@ -1181,11 +1190,11 @@ impl UseTreeList { | |||
1181 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } | 1190 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } |
1182 | } | 1191 | } |
1183 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1192 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1184 | pub struct Alias { | 1193 | pub struct Rename { |
1185 | pub(crate) syntax: SyntaxNode, | 1194 | pub(crate) syntax: SyntaxNode, |
1186 | } | 1195 | } |
1187 | impl ast::NameOwner for Alias {} | 1196 | impl ast::NameOwner for Rename {} |
1188 | impl Alias { | 1197 | impl Rename { |
1189 | pub fn as_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![as]) } | 1198 | pub fn as_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![as]) } |
1190 | } | 1199 | } |
1191 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1200 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
@@ -1336,10 +1345,10 @@ pub enum AssocItem { | |||
1336 | FnDef(FnDef), | 1345 | FnDef(FnDef), |
1337 | TypeAliasDef(TypeAliasDef), | 1346 | TypeAliasDef(TypeAliasDef), |
1338 | ConstDef(ConstDef), | 1347 | ConstDef(ConstDef), |
1348 | MacroCall(MacroCall), | ||
1339 | } | 1349 | } |
1340 | impl ast::AttrsOwner for AssocItem {} | 1350 | impl ast::AttrsOwner for AssocItem {} |
1341 | impl ast::NameOwner for AssocItem {} | 1351 | impl ast::NameOwner for AssocItem {} |
1342 | impl ast::VisibilityOwner for AssocItem {} | ||
1343 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1352 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1344 | pub enum Pat { | 1353 | pub enum Pat { |
1345 | OrPat(OrPat), | 1354 | OrPat(OrPat), |
@@ -1574,8 +1583,8 @@ impl AstNode for Visibility { | |||
1574 | } | 1583 | } |
1575 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1584 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1576 | } | 1585 | } |
1577 | impl AstNode for Abi { | 1586 | impl AstNode for Name { |
1578 | fn can_cast(kind: SyntaxKind) -> bool { kind == ABI } | 1587 | fn can_cast(kind: SyntaxKind) -> bool { kind == NAME } |
1579 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1588 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1580 | if Self::can_cast(syntax.kind()) { | 1589 | if Self::can_cast(syntax.kind()) { |
1581 | Some(Self { syntax }) | 1590 | Some(Self { syntax }) |
@@ -1585,8 +1594,19 @@ impl AstNode for Abi { | |||
1585 | } | 1594 | } |
1586 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1595 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1587 | } | 1596 | } |
1588 | impl AstNode for Name { | 1597 | impl AstNode for ItemList { |
1589 | fn can_cast(kind: SyntaxKind) -> bool { kind == NAME } | 1598 | fn can_cast(kind: SyntaxKind) -> bool { kind == ITEM_LIST } |
1599 | fn cast(syntax: SyntaxNode) -> Option<Self> { | ||
1600 | if Self::can_cast(syntax.kind()) { | ||
1601 | Some(Self { syntax }) | ||
1602 | } else { | ||
1603 | None | ||
1604 | } | ||
1605 | } | ||
1606 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | ||
1607 | } | ||
1608 | impl AstNode for Abi { | ||
1609 | fn can_cast(kind: SyntaxKind) -> bool { kind == ABI } | ||
1590 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1610 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1591 | if Self::can_cast(syntax.kind()) { | 1611 | if Self::can_cast(syntax.kind()) { |
1592 | Some(Self { syntax }) | 1612 | Some(Self { syntax }) |
@@ -1728,8 +1748,8 @@ impl AstNode for TypeBoundList { | |||
1728 | } | 1748 | } |
1729 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1749 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1730 | } | 1750 | } |
1731 | impl AstNode for ItemList { | 1751 | impl AstNode for AssocItemList { |
1732 | fn can_cast(kind: SyntaxKind) -> bool { kind == ITEM_LIST } | 1752 | fn can_cast(kind: SyntaxKind) -> bool { kind == ASSOC_ITEM_LIST } |
1733 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1753 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1734 | if Self::can_cast(syntax.kind()) { | 1754 | if Self::can_cast(syntax.kind()) { |
1735 | Some(Self { syntax }) | 1755 | Some(Self { syntax }) |
@@ -2663,8 +2683,8 @@ impl AstNode for UseTreeList { | |||
2663 | } | 2683 | } |
2664 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2684 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2665 | } | 2685 | } |
2666 | impl AstNode for Alias { | 2686 | impl AstNode for Rename { |
2667 | fn can_cast(kind: SyntaxKind) -> bool { kind == ALIAS } | 2687 | fn can_cast(kind: SyntaxKind) -> bool { kind == RENAME } |
2668 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 2688 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
2669 | if Self::can_cast(syntax.kind()) { | 2689 | if Self::can_cast(syntax.kind()) { |
2670 | Some(Self { syntax }) | 2690 | Some(Self { syntax }) |
@@ -3144,10 +3164,13 @@ impl From<TypeAliasDef> for AssocItem { | |||
3144 | impl From<ConstDef> for AssocItem { | 3164 | impl From<ConstDef> for AssocItem { |
3145 | fn from(node: ConstDef) -> AssocItem { AssocItem::ConstDef(node) } | 3165 | fn from(node: ConstDef) -> AssocItem { AssocItem::ConstDef(node) } |
3146 | } | 3166 | } |
3167 | impl From<MacroCall> for AssocItem { | ||
3168 | fn from(node: MacroCall) -> AssocItem { AssocItem::MacroCall(node) } | ||
3169 | } | ||
3147 | impl AstNode for AssocItem { | 3170 | impl AstNode for AssocItem { |
3148 | fn can_cast(kind: SyntaxKind) -> bool { | 3171 | fn can_cast(kind: SyntaxKind) -> bool { |
3149 | match kind { | 3172 | match kind { |
3150 | FN_DEF | TYPE_ALIAS_DEF | CONST_DEF => true, | 3173 | FN_DEF | TYPE_ALIAS_DEF | CONST_DEF | MACRO_CALL => true, |
3151 | _ => false, | 3174 | _ => false, |
3152 | } | 3175 | } |
3153 | } | 3176 | } |
@@ -3156,6 +3179,7 @@ impl AstNode for AssocItem { | |||
3156 | FN_DEF => AssocItem::FnDef(FnDef { syntax }), | 3179 | FN_DEF => AssocItem::FnDef(FnDef { syntax }), |
3157 | TYPE_ALIAS_DEF => AssocItem::TypeAliasDef(TypeAliasDef { syntax }), | 3180 | TYPE_ALIAS_DEF => AssocItem::TypeAliasDef(TypeAliasDef { syntax }), |
3158 | CONST_DEF => AssocItem::ConstDef(ConstDef { syntax }), | 3181 | CONST_DEF => AssocItem::ConstDef(ConstDef { syntax }), |
3182 | MACRO_CALL => AssocItem::MacroCall(MacroCall { syntax }), | ||
3159 | _ => return None, | 3183 | _ => return None, |
3160 | }; | 3184 | }; |
3161 | Some(res) | 3185 | Some(res) |
@@ -3165,6 +3189,7 @@ impl AstNode for AssocItem { | |||
3165 | AssocItem::FnDef(it) => &it.syntax, | 3189 | AssocItem::FnDef(it) => &it.syntax, |
3166 | AssocItem::TypeAliasDef(it) => &it.syntax, | 3190 | AssocItem::TypeAliasDef(it) => &it.syntax, |
3167 | AssocItem::ConstDef(it) => &it.syntax, | 3191 | AssocItem::ConstDef(it) => &it.syntax, |
3192 | AssocItem::MacroCall(it) => &it.syntax, | ||
3168 | } | 3193 | } |
3169 | } | 3194 | } |
3170 | } | 3195 | } |
@@ -3515,12 +3540,17 @@ impl std::fmt::Display for Visibility { | |||
3515 | std::fmt::Display::fmt(self.syntax(), f) | 3540 | std::fmt::Display::fmt(self.syntax(), f) |
3516 | } | 3541 | } |
3517 | } | 3542 | } |
3518 | impl std::fmt::Display for Abi { | 3543 | impl std::fmt::Display for Name { |
3519 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3544 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3520 | std::fmt::Display::fmt(self.syntax(), f) | 3545 | std::fmt::Display::fmt(self.syntax(), f) |
3521 | } | 3546 | } |
3522 | } | 3547 | } |
3523 | impl std::fmt::Display for Name { | 3548 | impl std::fmt::Display for ItemList { |
3549 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
3550 | std::fmt::Display::fmt(self.syntax(), f) | ||
3551 | } | ||
3552 | } | ||
3553 | impl std::fmt::Display for Abi { | ||
3524 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3554 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3525 | std::fmt::Display::fmt(self.syntax(), f) | 3555 | std::fmt::Display::fmt(self.syntax(), f) |
3526 | } | 3556 | } |
@@ -3585,7 +3615,7 @@ impl std::fmt::Display for TypeBoundList { | |||
3585 | std::fmt::Display::fmt(self.syntax(), f) | 3615 | std::fmt::Display::fmt(self.syntax(), f) |
3586 | } | 3616 | } |
3587 | } | 3617 | } |
3588 | impl std::fmt::Display for ItemList { | 3618 | impl std::fmt::Display for AssocItemList { |
3589 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3619 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3590 | std::fmt::Display::fmt(self.syntax(), f) | 3620 | std::fmt::Display::fmt(self.syntax(), f) |
3591 | } | 3621 | } |
@@ -4010,7 +4040,7 @@ impl std::fmt::Display for UseTreeList { | |||
4010 | std::fmt::Display::fmt(self.syntax(), f) | 4040 | std::fmt::Display::fmt(self.syntax(), f) |
4011 | } | 4041 | } |
4012 | } | 4042 | } |
4013 | impl std::fmt::Display for Alias { | 4043 | impl std::fmt::Display for Rename { |
4014 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 4044 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4015 | std::fmt::Display::fmt(self.syntax(), f) | 4045 | std::fmt::Display::fmt(self.syntax(), f) |
4016 | } | 4046 | } |
diff --git a/crates/ra_syntax/src/ast/make.rs b/crates/ra_syntax/src/ast/make.rs index 192c610f1..2b05ed2d4 100644 --- a/crates/ra_syntax/src/ast/make.rs +++ b/crates/ra_syntax/src/ast/make.rs | |||
@@ -37,7 +37,7 @@ fn path_from_text(text: &str) -> ast::Path { | |||
37 | pub fn use_tree( | 37 | pub fn use_tree( |
38 | path: ast::Path, | 38 | path: ast::Path, |
39 | use_tree_list: Option<ast::UseTreeList>, | 39 | use_tree_list: Option<ast::UseTreeList>, |
40 | alias: Option<ast::Alias>, | 40 | alias: Option<ast::Rename>, |
41 | add_star: bool, | 41 | add_star: bool, |
42 | ) -> ast::UseTree { | 42 | ) -> ast::UseTree { |
43 | let mut buf = "use ".to_string(); | 43 | let mut buf = "use ".to_string(); |
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 31cc4e551..a87e5061a 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 | |||
@@ -8,7 +8,7 @@ [email protected] | |||
8 | [email protected] | 8 | [email protected] |
9 | [email protected] "FnScopes" | 9 | [email protected] "FnScopes" |
10 | [email protected] " " | 10 | [email protected] " " |
11 | [email protected] | 11 | ASSOC_[email protected] |
12 | [email protected] "{" | 12 | [email protected] "{" |
13 | [email protected] "\n " | 13 | [email protected] "\n " |
14 | [email protected] | 14 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/err/0026_imp_recovery.rast b/crates/ra_syntax/test_data/parser/err/0026_imp_recovery.rast index bf07409fb..254ff546a 100644 --- a/crates/ra_syntax/test_data/parser/err/0026_imp_recovery.rast +++ b/crates/ra_syntax/test_data/parser/err/0026_imp_recovery.rast | |||
@@ -41,7 +41,7 @@ [email protected] | |||
41 | [email protected] "T" | 41 | [email protected] "T" |
42 | [email protected] ">" | 42 | [email protected] ">" |
43 | [email protected] " " | 43 | [email protected] " " |
44 | [email protected] | 44 | ASSOC_[email protected] |
45 | [email protected] "{" | 45 | [email protected] "{" |
46 | [email protected] "}" | 46 | [email protected] "}" |
47 | [email protected] "\n" | 47 | [email protected] "\n" |
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 e3cda7c43..bc446e3df 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 | |||
@@ -14,7 +14,7 @@ [email protected] | |||
14 | [email protected] "(" | 14 | [email protected] "(" |
15 | [email protected] ")" | 15 | [email protected] ")" |
16 | [email protected] " " | 16 | [email protected] " " |
17 | [email protected] | 17 | ASSOC_[email protected] |
18 | [email protected] "{" | 18 | [email protected] "{" |
19 | [email protected] "\n " | 19 | [email protected] "\n " |
20 | [email protected] | 20 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/err/0043_default_const.rast b/crates/ra_syntax/test_data/parser/err/0043_default_const.rast index 8eb583ef8..6ca1a4870 100644 --- a/crates/ra_syntax/test_data/parser/err/0043_default_const.rast +++ b/crates/ra_syntax/test_data/parser/err/0043_default_const.rast | |||
@@ -5,7 +5,7 @@ [email protected] | |||
5 | [email protected] | 5 | [email protected] |
6 | [email protected] "T" | 6 | [email protected] "T" |
7 | [email protected] " " | 7 | [email protected] " " |
8 | [email protected] | 8 | ASSOC_[email protected] |
9 | [email protected] "{" | 9 | [email protected] "{" |
10 | [email protected] "\n " | 10 | [email protected] "\n " |
11 | [email protected] | 11 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0004_impl_type.rast b/crates/ra_syntax/test_data/parser/inline/err/0004_impl_type.rast index fd939be8d..2d0253aa0 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0004_impl_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0004_impl_type.rast | |||
@@ -8,7 +8,7 @@ [email protected] | |||
8 | [email protected] | 8 | [email protected] |
9 | [email protected] "Type" | 9 | [email protected] "Type" |
10 | [email protected] " " | 10 | [email protected] " " |
11 | [email protected] | 11 | ASSOC_[email protected] |
12 | [email protected] "{" | 12 | [email protected] "{" |
13 | [email protected] "}" | 13 | [email protected] "}" |
14 | [email protected] "\n" | 14 | [email protected] "\n" |
@@ -29,7 +29,7 @@ [email protected] | |||
29 | [email protected] | 29 | [email protected] |
30 | [email protected] "T" | 30 | [email protected] "T" |
31 | [email protected] " " | 31 | [email protected] " " |
32 | [email protected] | 32 | ASSOC_[email protected] |
33 | [email protected] "{" | 33 | [email protected] "{" |
34 | [email protected] "}" | 34 | [email protected] "}" |
35 | [email protected] "\n" | 35 | [email protected] "\n" |
@@ -45,7 +45,7 @@ [email protected] | |||
45 | [email protected] | 45 | [email protected] |
46 | [email protected] "NotType" | 46 | [email protected] "NotType" |
47 | [email protected] " " | 47 | [email protected] " " |
48 | [email protected] | 48 | ASSOC_[email protected] |
49 | [email protected] "{" | 49 | [email protected] "{" |
50 | [email protected] "}" | 50 | [email protected] "}" |
51 | [email protected] "\n" | 51 | [email protected] "\n" |
@@ -69,7 +69,7 @@ [email protected] | |||
69 | [email protected] | 69 | [email protected] |
70 | [email protected] "NotType" | 70 | [email protected] "NotType" |
71 | [email protected] " " | 71 | [email protected] " " |
72 | [email protected] | 72 | ASSOC_[email protected] |
73 | [email protected] "{" | 73 | [email protected] "{" |
74 | [email protected] "}" | 74 | [email protected] "}" |
75 | [email protected] "\n" | 75 | [email protected] "\n" |
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 b8cd0587d..5501dc5a6 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 | |||
@@ -5,7 +5,7 @@ [email protected] | |||
5 | [email protected] | 5 | [email protected] |
6 | [email protected] "T" | 6 | [email protected] "T" |
7 | [email protected] " " | 7 | [email protected] " " |
8 | [email protected] | 8 | ASSOC_[email protected] |
9 | [email protected] "{" | 9 | [email protected] "{" |
10 | [email protected] "\n " | 10 | [email protected] "\n " |
11 | [email protected] | 11 | [email protected] |
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 a38b4f573..f422acdda 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 | |||
@@ -8,7 +8,7 @@ [email protected] | |||
8 | [email protected] | 8 | [email protected] |
9 | [email protected] "F" | 9 | [email protected] "F" |
10 | [email protected] " " | 10 | [email protected] " " |
11 | [email protected] | 11 | ASSOC_[email protected] |
12 | [email protected] "{" | 12 | [email protected] "{" |
13 | [email protected] "\n " | 13 | [email protected] "\n " |
14 | [email protected] | 14 | [email protected] |
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 9f4a9e69b..0cd1dffc9 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 | |||
@@ -8,7 +8,7 @@ [email protected] | |||
8 | [email protected] | 8 | [email protected] |
9 | [email protected] "S" | 9 | [email protected] "S" |
10 | [email protected] " " | 10 | [email protected] " " |
11 | [email protected] | 11 | ASSOC_[email protected] |
12 | [email protected] "{" | 12 | [email protected] "{" |
13 | [email protected] "\n " | 13 | [email protected] "\n " |
14 | [email protected] | 14 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0016_unsafe_trait.rast b/crates/ra_syntax/test_data/parser/inline/ok/0016_unsafe_trait.rast index d59c6006d..69b82e33c 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0016_unsafe_trait.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0016_unsafe_trait.rast | |||
@@ -7,7 +7,7 @@ [email protected] | |||
7 | [email protected] | 7 | [email protected] |
8 | [email protected] "T" | 8 | [email protected] "T" |
9 | [email protected] " " | 9 | [email protected] " " |
10 | [email protected] | 10 | ASSOC_[email protected] |
11 | [email protected] "{" | 11 | [email protected] "{" |
12 | [email protected] "}" | 12 | [email protected] "}" |
13 | [email protected] "\n" | 13 | [email protected] "\n" |
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 15da6fdd6..79148e953 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 | |||
@@ -8,7 +8,7 @@ [email protected] | |||
8 | [email protected] | 8 | [email protected] |
9 | [email protected] "S" | 9 | [email protected] "S" |
10 | [email protected] " " | 10 | [email protected] " " |
11 | [email protected] | 11 | ASSOC_[email protected] |
12 | [email protected] "{" | 12 | [email protected] "{" |
13 | [email protected] "\n " | 13 | [email protected] "\n " |
14 | [email protected] | 14 | [email protected] |
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 c204aeb63..31b5b6616 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 | |||
@@ -8,7 +8,7 @@ [email protected] | |||
8 | [email protected] | 8 | [email protected] |
9 | [email protected] "F" | 9 | [email protected] "F" |
10 | [email protected] " " | 10 | [email protected] " " |
11 | [email protected] | 11 | ASSOC_[email protected] |
12 | [email protected] "{" | 12 | [email protected] "{" |
13 | [email protected] "\n " | 13 | [email protected] "\n " |
14 | [email protected] | 14 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0041_trait_item.rast b/crates/ra_syntax/test_data/parser/inline/ok/0041_trait_item.rast index 1ae791361..884ab2dbf 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0041_trait_item.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0041_trait_item.rast | |||
@@ -48,7 +48,7 @@ [email protected] | |||
48 | [email protected] | 48 | [email protected] |
49 | [email protected] "Copy" | 49 | [email protected] "Copy" |
50 | [email protected] " " | 50 | [email protected] " " |
51 | [email protected] | 51 | ASSOC_[email protected] |
52 | [email protected] "{" | 52 | [email protected] "{" |
53 | [email protected] "}" | 53 | [email protected] "}" |
54 | [email protected] "\n" | 54 | [email protected] "\n" |
@@ -119,7 +119,7 @@ [email protected] | |||
119 | [email protected] | 119 | [email protected] |
120 | [email protected] "Copy" | 120 | [email protected] "Copy" |
121 | [email protected] " " | 121 | [email protected] " " |
122 | [email protected] | 122 | ASSOC_[email protected] |
123 | [email protected] "{" | 123 | [email protected] "{" |
124 | [email protected] "}" | 124 | [email protected] "}" |
125 | [email protected] "\n" | 125 | [email protected] "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0043_use_alias.rast b/crates/ra_syntax/test_data/parser/inline/ok/0043_use_alias.rast index f0e09d40d..8e9061e1d 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0043_use_alias.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0043_use_alias.rast | |||
@@ -13,7 +13,7 @@ [email protected] | |||
13 | [email protected] | 13 | [email protected] |
14 | [email protected] "path" | 14 | [email protected] "path" |
15 | [email protected] " " | 15 | [email protected] " " |
16 | ALIAS@15..27 | 16 | RENAME@15..27 |
17 | [email protected] "as" | 17 | [email protected] "as" |
18 | [email protected] " " | 18 | [email protected] " " |
19 | [email protected] | 19 | [email protected] |
@@ -43,7 +43,7 @@ [email protected] | |||
43 | [email protected] | 43 | [email protected] |
44 | [email protected] "path" | 44 | [email protected] "path" |
45 | [email protected] " " | 45 | [email protected] " " |
46 | ALIAS@54..72 | 46 | RENAME@54..72 |
47 | [email protected] "as" | 47 | [email protected] "as" |
48 | [email protected] " " | 48 | [email protected] " " |
49 | [email protected] | 49 | [email protected] |
@@ -61,7 +61,7 @@ [email protected] | |||
61 | [email protected] | 61 | [email protected] |
62 | [email protected] "path" | 62 | [email protected] "path" |
63 | [email protected] " " | 63 | [email protected] " " |
64 | ALIAS@91..108 | 64 | RENAME@91..108 |
65 | [email protected] "as" | 65 | [email protected] "as" |
66 | [email protected] " " | 66 | [email protected] " " |
67 | [email protected] | 67 | [email protected] |
@@ -130,7 +130,7 @@ [email protected] | |||
130 | [email protected] | 130 | [email protected] |
131 | [email protected] "Trait" | 131 | [email protected] "Trait" |
132 | [email protected] " " | 132 | [email protected] " " |
133 | ALIAS@192..196 | 133 | RENAME@192..196 |
134 | [email protected] "as" | 134 | [email protected] "as" |
135 | [email protected] " " | 135 | [email protected] " " |
136 | [email protected] "_" | 136 | [email protected] "_" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0047_unsafe_default_impl.rast b/crates/ra_syntax/test_data/parser/inline/ok/0047_unsafe_default_impl.rast index 52de6023b..8a6b5a8fc 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0047_unsafe_default_impl.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0047_unsafe_default_impl.rast | |||
@@ -12,7 +12,7 @@ [email protected] | |||
12 | [email protected] | 12 | [email protected] |
13 | [email protected] "Foo" | 13 | [email protected] "Foo" |
14 | [email protected] " " | 14 | [email protected] " " |
15 | [email protected] | 15 | ASSOC_[email protected] |
16 | [email protected] "{" | 16 | [email protected] "{" |
17 | [email protected] "}" | 17 | [email protected] "}" |
18 | [email protected] "\n" | 18 | [email protected] "\n" |
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 8bf62cda9..5f1429102 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 | |||
@@ -5,7 +5,7 @@ [email protected] | |||
5 | [email protected] | 5 | [email protected] |
6 | [email protected] "T" | 6 | [email protected] "T" |
7 | [email protected] " " | 7 | [email protected] " " |
8 | [email protected] | 8 | ASSOC_[email protected] |
9 | [email protected] "{" | 9 | [email protected] "{" |
10 | [email protected] " " | 10 | [email protected] " " |
11 | [email protected] | 11 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0063_impl_def_neg.rast b/crates/ra_syntax/test_data/parser/inline/ok/0063_impl_def_neg.rast index 24b9a1f46..31178f86e 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0063_impl_def_neg.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0063_impl_def_neg.rast | |||
@@ -17,7 +17,7 @@ [email protected] | |||
17 | [email protected] | 17 | [email protected] |
18 | [email protected] "X" | 18 | [email protected] "X" |
19 | [email protected] " " | 19 | [email protected] " " |
20 | [email protected] | 20 | ASSOC_[email protected] |
21 | [email protected] "{" | 21 | [email protected] "{" |
22 | [email protected] "}" | 22 | [email protected] "}" |
23 | [email protected] "\n" | 23 | [email protected] "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0079_impl_def.rast b/crates/ra_syntax/test_data/parser/inline/ok/0079_impl_def.rast index a00ab40f9..26825ef86 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0079_impl_def.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0079_impl_def.rast | |||
@@ -8,7 +8,7 @@ [email protected] | |||
8 | [email protected] | 8 | [email protected] |
9 | [email protected] "Foo" | 9 | [email protected] "Foo" |
10 | [email protected] " " | 10 | [email protected] " " |
11 | [email protected] | 11 | ASSOC_[email protected] |
12 | [email protected] "{" | 12 | [email protected] "{" |
13 | [email protected] "}" | 13 | [email protected] "}" |
14 | [email protected] "\n" | 14 | [email protected] "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0087_unsafe_impl.rast b/crates/ra_syntax/test_data/parser/inline/ok/0087_unsafe_impl.rast index 01ed3afca..e3223cee5 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0087_unsafe_impl.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0087_unsafe_impl.rast | |||
@@ -10,7 +10,7 @@ [email protected] | |||
10 | [email protected] | 10 | [email protected] |
11 | [email protected] "Foo" | 11 | [email protected] "Foo" |
12 | [email protected] " " | 12 | [email protected] " " |
13 | [email protected] | 13 | ASSOC_[email protected] |
14 | [email protected] "{" | 14 | [email protected] "{" |
15 | [email protected] "}" | 15 | [email protected] "}" |
16 | [email protected] "\n" | 16 | [email protected] "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0091_auto_trait.rast b/crates/ra_syntax/test_data/parser/inline/ok/0091_auto_trait.rast index 800412cef..7efa4c34d 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0091_auto_trait.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0091_auto_trait.rast | |||
@@ -7,7 +7,7 @@ [email protected] | |||
7 | [email protected] | 7 | [email protected] |
8 | [email protected] "T" | 8 | [email protected] "T" |
9 | [email protected] " " | 9 | [email protected] " " |
10 | [email protected] | 10 | ASSOC_[email protected] |
11 | [email protected] "{" | 11 | [email protected] "{" |
12 | [email protected] "}" | 12 | [email protected] "}" |
13 | [email protected] "\n" | 13 | [email protected] "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0094_unsafe_auto_trait.rast b/crates/ra_syntax/test_data/parser/inline/ok/0094_unsafe_auto_trait.rast index 9370f6ae7..fad27be66 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0094_unsafe_auto_trait.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0094_unsafe_auto_trait.rast | |||
@@ -9,7 +9,7 @@ [email protected] | |||
9 | [email protected] | 9 | [email protected] |
10 | [email protected] "T" | 10 | [email protected] "T" |
11 | [email protected] " " | 11 | [email protected] " " |
12 | [email protected] | 12 | ASSOC_[email protected] |
13 | [email protected] "{" | 13 | [email protected] "{" |
14 | [email protected] "}" | 14 | [email protected] "}" |
15 | [email protected] "\n" | 15 | [email protected] "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0097_default_impl.rast b/crates/ra_syntax/test_data/parser/inline/ok/0097_default_impl.rast index 80bda4ba7..8a839a4a6 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0097_default_impl.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0097_default_impl.rast | |||
@@ -10,7 +10,7 @@ [email protected] | |||
10 | [email protected] | 10 | [email protected] |
11 | [email protected] "Foo" | 11 | [email protected] "Foo" |
12 | [email protected] " " | 12 | [email protected] " " |
13 | [email protected] | 13 | ASSOC_[email protected] |
14 | [email protected] "{" | 14 | [email protected] "{" |
15 | [email protected] "}" | 15 | [email protected] "}" |
16 | [email protected] "\n" | 16 | [email protected] "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0118_impl_inner_attributes.rast b/crates/ra_syntax/test_data/parser/inline/ok/0118_impl_inner_attributes.rast index a65a5c85f..ea54347fc 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0118_impl_inner_attributes.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0118_impl_inner_attributes.rast | |||
@@ -17,7 +17,7 @@ [email protected] | |||
17 | [email protected] | 17 | [email protected] |
18 | [email protected] "F" | 18 | [email protected] "F" |
19 | [email protected] " " | 19 | [email protected] " " |
20 | [email protected] | 20 | ASSOC_[email protected] |
21 | [email protected] "{" | 21 | [email protected] "{" |
22 | [email protected] "\n " | 22 | [email protected] "\n " |
23 | [email protected] "//! This is a doc com ..." | 23 | [email protected] "//! This is a doc com ..." |
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 00ce5ecf0..3772cb64b 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 | |||
@@ -16,7 +16,7 @@ [email protected] | |||
16 | [email protected] | 16 | [email protected] |
17 | [email protected] "Foo" | 17 | [email protected] "Foo" |
18 | [email protected] " " | 18 | [email protected] " " |
19 | [email protected] | 19 | ASSOC_[email protected] |
20 | [email protected] "{" | 20 | [email protected] "{" |
21 | [email protected] "\n " | 21 | [email protected] "\n " |
22 | [email protected] | 22 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0150_impl_type_params.rast b/crates/ra_syntax/test_data/parser/inline/ok/0150_impl_type_params.rast index e70c3b710..77e12cad6 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0150_impl_type_params.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0150_impl_type_params.rast | |||
@@ -32,7 +32,7 @@ [email protected] | |||
32 | [email protected] "N" | 32 | [email protected] "N" |
33 | [email protected] ">" | 33 | [email protected] ">" |
34 | [email protected] " " | 34 | [email protected] " " |
35 | [email protected] | 35 | ASSOC_[email protected] |
36 | [email protected] "{" | 36 | [email protected] "{" |
37 | [email protected] "}" | 37 | [email protected] "}" |
38 | [email protected] "\n" | 38 | [email protected] "\n" |
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 adb6159f4..c0b8c0300 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 | |||
@@ -16,7 +16,7 @@ [email protected] | |||
16 | [email protected] | 16 | [email protected] |
17 | [email protected] "Foo" | 17 | [email protected] "Foo" |
18 | [email protected] " " | 18 | [email protected] " " |
19 | [email protected] | 19 | ASSOC_[email protected] |
20 | [email protected] "{" | 20 | [email protected] "{" |
21 | [email protected] "\n " | 21 | [email protected] "\n " |
22 | [email protected] | 22 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_impl.rast b/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_impl.rast index a9eda5668..e0c338297 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_impl.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_impl.rast | |||
@@ -12,7 +12,7 @@ [email protected] | |||
12 | [email protected] | 12 | [email protected] |
13 | [email protected] "Foo" | 13 | [email protected] "Foo" |
14 | [email protected] " " | 14 | [email protected] " " |
15 | [email protected] | 15 | ASSOC_[email protected] |
16 | [email protected] "{" | 16 | [email protected] "{" |
17 | [email protected] "}" | 17 | [email protected] "}" |
18 | [email protected] "\n" | 18 | [email protected] "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0007_extern_crate.rast b/crates/ra_syntax/test_data/parser/ok/0007_extern_crate.rast index 271486605..948c4ddb3 100644 --- a/crates/ra_syntax/test_data/parser/ok/0007_extern_crate.rast +++ b/crates/ra_syntax/test_data/parser/ok/0007_extern_crate.rast | |||
@@ -16,7 +16,7 @@ [email protected] | |||
16 | [email protected] | 16 | [email protected] |
17 | [email protected] "foo" | 17 | [email protected] "foo" |
18 | [email protected] " " | 18 | [email protected] " " |
19 | ALIAS@35..41 | 19 | RENAME@35..41 |
20 | [email protected] "as" | 20 | [email protected] "as" |
21 | [email protected] " " | 21 | [email protected] " " |
22 | [email protected] | 22 | [email protected] |
@@ -30,7 +30,7 @@ [email protected] | |||
30 | [email protected] " " | 30 | [email protected] " " |
31 | [email protected] "self" | 31 | [email protected] "self" |
32 | [email protected] " " | 32 | [email protected] " " |
33 | ALIAS@61..67 | 33 | RENAME@61..67 |
34 | [email protected] "as" | 34 | [email protected] "as" |
35 | [email protected] " " | 35 | [email protected] " " |
36 | [email protected] | 36 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/ok/0015_use_tree.rast b/crates/ra_syntax/test_data/parser/ok/0015_use_tree.rast index 09e0050f0..cdddb4214 100644 --- a/crates/ra_syntax/test_data/parser/ok/0015_use_tree.rast +++ b/crates/ra_syntax/test_data/parser/ok/0015_use_tree.rast | |||
@@ -8,7 +8,7 @@ [email protected] | |||
8 | [email protected] | 8 | [email protected] |
9 | [email protected] "foo" | 9 | [email protected] "foo" |
10 | [email protected] " " | 10 | [email protected] " " |
11 | ALIAS@8..14 | 11 | RENAME@8..14 |
12 | [email protected] "as" | 12 | [email protected] "as" |
13 | [email protected] " " | 13 | [email protected] " " |
14 | [email protected] | 14 | [email protected] |
@@ -32,7 +32,7 @@ [email protected] | |||
32 | [email protected] | 32 | [email protected] |
33 | [email protected] "a" | 33 | [email protected] "a" |
34 | [email protected] " " | 34 | [email protected] " " |
35 | ALIAS@28..32 | 35 | RENAME@28..32 |
36 | [email protected] "as" | 36 | [email protected] "as" |
37 | [email protected] " " | 37 | [email protected] " " |
38 | [email protected] | 38 | [email protected] |
@@ -55,7 +55,7 @@ [email protected] | |||
55 | [email protected] | 55 | [email protected] |
56 | [email protected] "foo" | 56 | [email protected] "foo" |
57 | [email protected] " " | 57 | [email protected] " " |
58 | ALIAS@48..52 | 58 | RENAME@48..52 |
59 | [email protected] "as" | 59 | [email protected] "as" |
60 | [email protected] " " | 60 | [email protected] " " |
61 | [email protected] | 61 | [email protected] |
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 0aadc11a4..63693de4f 100644 --- a/crates/ra_syntax/test_data/parser/ok/0030_traits.rast +++ b/crates/ra_syntax/test_data/parser/ok/0030_traits.rast | |||
@@ -5,7 +5,7 @@ [email protected] | |||
5 | [email protected] | 5 | [email protected] |
6 | [email protected] "Runnable" | 6 | [email protected] "Runnable" |
7 | [email protected] " " | 7 | [email protected] " " |
8 | [email protected] | 8 | ASSOC_[email protected] |
9 | [email protected] "{" | 9 | [email protected] "{" |
10 | [email protected] "\n " | 10 | [email protected] "\n " |
11 | [email protected] | 11 | [email protected] |
@@ -26,7 +26,7 @@ [email protected] | |||
26 | [email protected] | 26 | [email protected] |
27 | [email protected] "TraitWithExpr" | 27 | [email protected] "TraitWithExpr" |
28 | [email protected] " " | 28 | [email protected] " " |
29 | [email protected] | 29 | ASSOC_[email protected] |
30 | [email protected] "{" | 30 | [email protected] "{" |
31 | [email protected] "\n " | 31 | [email protected] "\n " |
32 | [email protected] | 32 | [email protected] |
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 468982b74..573edc081 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 | |||
@@ -17,7 +17,7 @@ [email protected] | |||
17 | [email protected] | 17 | [email protected] |
18 | [email protected] "Foo" | 18 | [email protected] "Foo" |
19 | [email protected] " " | 19 | [email protected] " " |
20 | [email protected] | 20 | ASSOC_[email protected] |
21 | [email protected] "{" | 21 | [email protected] "{" |
22 | [email protected] "\n " | 22 | [email protected] "\n " |
23 | [email protected] | 23 | [email protected] |
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 e8b095251..69aa0ba4d 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 | |||
@@ -98,7 +98,7 @@ [email protected] | |||
98 | [email protected] | 98 | [email protected] |
99 | [email protected] "Whatever" | 99 | [email protected] "Whatever" |
100 | [email protected] " " | 100 | [email protected] " " |
101 | [email protected] | 101 | ASSOC_[email protected] |
102 | [email protected] "{" | 102 | [email protected] "{" |
103 | [email protected] "\n " | 103 | [email protected] "\n " |
104 | [email protected] | 104 | [email protected] |
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 816740a7c..919c690de 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 | |||
@@ -192,7 +192,7 @@ [email protected] | |||
192 | [email protected] | 192 | [email protected] |
193 | [email protected] "Foo" | 193 | [email protected] "Foo" |
194 | [email protected] " " | 194 | [email protected] " " |
195 | [email protected] | 195 | ASSOC_[email protected] |
196 | [email protected] "{" | 196 | [email protected] "{" |
197 | [email protected] "\n " | 197 | [email protected] "\n " |
198 | [email protected] | 198 | [email protected] |
@@ -260,7 +260,7 @@ [email protected] | |||
260 | [email protected] | 260 | [email protected] |
261 | [email protected] "S" | 261 | [email protected] "S" |
262 | [email protected] " " | 262 | [email protected] " " |
263 | [email protected] | 263 | ASSOC_[email protected] |
264 | [email protected] "{" | 264 | [email protected] "{" |
265 | [email protected] "\n " | 265 | [email protected] "\n " |
266 | [email protected] | 266 | [email protected] |
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 886b211d0..40619b46e 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 | |||
@@ -5,7 +5,7 @@ [email protected] | |||
5 | [email protected] | 5 | [email protected] |
6 | [email protected] "T" | 6 | [email protected] "T" |
7 | [email protected] " " | 7 | [email protected] " " |
8 | [email protected] | 8 | ASSOC_[email protected] |
9 | [email protected] "{" | 9 | [email protected] "{" |
10 | [email protected] "\n " | 10 | [email protected] "\n " |
11 | [email protected] | 11 | [email protected] |
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 a0423806c..7b026e33b 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 | |||
@@ -8,7 +8,7 @@ [email protected] | |||
8 | [email protected] | 8 | [email protected] |
9 | [email protected] "U" | 9 | [email protected] "U" |
10 | [email protected] " " | 10 | [email protected] " " |
11 | [email protected] | 11 | ASSOC_[email protected] |
12 | [email protected] "{" | 12 | [email protected] "{" |
13 | [email protected] "\n " | 13 | [email protected] "\n " |
14 | [email protected] | 14 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/ok/0066_default_const.rast b/crates/ra_syntax/test_data/parser/ok/0066_default_const.rast index dab0247ee..584b2faf1 100644 --- a/crates/ra_syntax/test_data/parser/ok/0066_default_const.rast +++ b/crates/ra_syntax/test_data/parser/ok/0066_default_const.rast | |||
@@ -16,7 +16,7 @@ [email protected] | |||
16 | [email protected] | 16 | [email protected] |
17 | [email protected] "Foo" | 17 | [email protected] "Foo" |
18 | [email protected] " " | 18 | [email protected] " " |
19 | [email protected] | 19 | ASSOC_[email protected] |
20 | [email protected] "{" | 20 | [email protected] "{" |
21 | [email protected] "\n " | 21 | [email protected] "\n " |
22 | [email protected] | 22 | [email protected] |