diff options
author | Aleksey Kladov <[email protected]> | 2020-07-30 16:56:53 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-07-30 16:56:53 +0100 |
commit | 1766aae145c6925a33e427f2fe6ef2a56c301665 (patch) | |
tree | dfcf22990794a5990602a468b862d544fbe63f0a /crates | |
parent | 609680ef97dbf82c07b6b06e21aa366423892304 (diff) |
Rename EnumVariant -> Variant
Diffstat (limited to 'crates')
30 files changed, 80 insertions, 80 deletions
diff --git a/crates/ra_assists/src/handlers/extract_struct_from_enum_variant.rs b/crates/ra_assists/src/handlers/extract_struct_from_enum_variant.rs index 2b8e273b3..ccec688ca 100644 --- a/crates/ra_assists/src/handlers/extract_struct_from_enum_variant.rs +++ b/crates/ra_assists/src/handlers/extract_struct_from_enum_variant.rs | |||
@@ -31,7 +31,7 @@ pub(crate) fn extract_struct_from_enum_variant( | |||
31 | acc: &mut Assists, | 31 | acc: &mut Assists, |
32 | ctx: &AssistContext, | 32 | ctx: &AssistContext, |
33 | ) -> Option<()> { | 33 | ) -> Option<()> { |
34 | let variant = ctx.find_node_at_offset::<ast::EnumVariant>()?; | 34 | let variant = ctx.find_node_at_offset::<ast::Variant>()?; |
35 | let field_list = match variant.kind() { | 35 | let field_list = match variant.kind() { |
36 | ast::StructKind::Tuple(field_list) => field_list, | 36 | ast::StructKind::Tuple(field_list) => field_list, |
37 | _ => return None, | 37 | _ => return None, |
diff --git a/crates/ra_assists/src/handlers/generate_from_impl_for_enum.rs b/crates/ra_assists/src/handlers/generate_from_impl_for_enum.rs index a347e3c2e..5b282a30a 100644 --- a/crates/ra_assists/src/handlers/generate_from_impl_for_enum.rs +++ b/crates/ra_assists/src/handlers/generate_from_impl_for_enum.rs | |||
@@ -22,7 +22,7 @@ use crate::{utils::FamousDefs, AssistContext, AssistId, AssistKind, Assists}; | |||
22 | // } | 22 | // } |
23 | // ``` | 23 | // ``` |
24 | pub(crate) fn generate_from_impl_for_enum(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { | 24 | pub(crate) fn generate_from_impl_for_enum(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { |
25 | let variant = ctx.find_node_at_offset::<ast::EnumVariant>()?; | 25 | let variant = ctx.find_node_at_offset::<ast::Variant>()?; |
26 | let variant_name = variant.name()?; | 26 | let variant_name = variant.name()?; |
27 | let enum_name = variant.parent_enum().name()?; | 27 | let enum_name = variant.parent_enum().name()?; |
28 | let field_list = match variant.kind() { | 28 | let field_list = match variant.kind() { |
@@ -69,7 +69,7 @@ impl From<{0}> for {1} {{ | |||
69 | 69 | ||
70 | fn existing_from_impl( | 70 | fn existing_from_impl( |
71 | sema: &'_ hir::Semantics<'_, RootDatabase>, | 71 | sema: &'_ hir::Semantics<'_, RootDatabase>, |
72 | variant: &ast::EnumVariant, | 72 | variant: &ast::Variant, |
73 | ) -> Option<()> { | 73 | ) -> Option<()> { |
74 | let variant = sema.to_def(variant)?; | 74 | let variant = sema.to_def(variant)?; |
75 | let enum_ = variant.parent_enum(sema.db); | 75 | let enum_ = variant.parent_enum(sema.db); |
diff --git a/crates/ra_hir/src/has_source.rs b/crates/ra_hir/src/has_source.rs index 88399f724..1c5747581 100644 --- a/crates/ra_hir/src/has_source.rs +++ b/crates/ra_hir/src/has_source.rs | |||
@@ -75,8 +75,8 @@ impl HasSource for Enum { | |||
75 | } | 75 | } |
76 | } | 76 | } |
77 | impl HasSource for EnumVariant { | 77 | impl HasSource for EnumVariant { |
78 | type Ast = ast::EnumVariant; | 78 | type Ast = ast::Variant; |
79 | fn source(self, db: &dyn HirDatabase) -> InFile<ast::EnumVariant> { | 79 | fn source(self, db: &dyn HirDatabase) -> InFile<ast::Variant> { |
80 | self.parent.id.child_source(db.upcast()).map(|map| map[self.id].clone()) | 80 | self.parent.id.child_source(db.upcast()).map(|map| map[self.id].clone()) |
81 | } | 81 | } |
82 | } | 82 | } |
diff --git a/crates/ra_hir/src/semantics.rs b/crates/ra_hir/src/semantics.rs index f8e70fe27..e18df2537 100644 --- a/crates/ra_hir/src/semantics.rs +++ b/crates/ra_hir/src/semantics.rs | |||
@@ -591,7 +591,7 @@ to_def_impls![ | |||
591 | (crate::Function, ast::Fn, fn_to_def), | 591 | (crate::Function, ast::Fn, fn_to_def), |
592 | (crate::Field, ast::RecordField, record_field_to_def), | 592 | (crate::Field, ast::RecordField, record_field_to_def), |
593 | (crate::Field, ast::TupleField, tuple_field_to_def), | 593 | (crate::Field, ast::TupleField, tuple_field_to_def), |
594 | (crate::EnumVariant, ast::EnumVariant, enum_variant_to_def), | 594 | (crate::EnumVariant, ast::Variant, enum_variant_to_def), |
595 | (crate::TypeParam, ast::TypeParam, type_param_to_def), | 595 | (crate::TypeParam, ast::TypeParam, type_param_to_def), |
596 | (crate::MacroDef, ast::MacroCall, macro_call_to_def), // this one is dubious, not all calls are macros | 596 | (crate::MacroDef, ast::MacroCall, macro_call_to_def), // this one is dubious, not all calls are macros |
597 | (crate::Local, ast::BindPat, bind_pat_to_def), | 597 | (crate::Local, ast::BindPat, bind_pat_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 9f81b952f..b85a12680 100644 --- a/crates/ra_hir/src/semantics/source_to_def.rs +++ b/crates/ra_hir/src/semantics/source_to_def.rs | |||
@@ -100,9 +100,9 @@ impl SourceToDefCtx<'_, '_> { | |||
100 | } | 100 | } |
101 | pub(super) fn enum_variant_to_def( | 101 | pub(super) fn enum_variant_to_def( |
102 | &mut self, | 102 | &mut self, |
103 | src: InFile<ast::EnumVariant>, | 103 | src: InFile<ast::Variant>, |
104 | ) -> Option<EnumVariantId> { | 104 | ) -> Option<EnumVariantId> { |
105 | self.to_def(src, keys::ENUM_VARIANT) | 105 | self.to_def(src, keys::VARIANT) |
106 | } | 106 | } |
107 | pub(super) fn bind_pat_to_def( | 107 | pub(super) fn bind_pat_to_def( |
108 | &mut self, | 108 | &mut self, |
diff --git a/crates/ra_hir_def/src/adt.rs b/crates/ra_hir_def/src/adt.rs index df98ded62..231c1dfab 100644 --- a/crates/ra_hir_def/src/adt.rs +++ b/crates/ra_hir_def/src/adt.rs | |||
@@ -112,7 +112,7 @@ impl EnumData { | |||
112 | 112 | ||
113 | impl HasChildSource for EnumId { | 113 | impl HasChildSource for EnumId { |
114 | type ChildId = LocalEnumVariantId; | 114 | type ChildId = LocalEnumVariantId; |
115 | type Value = ast::EnumVariant; | 115 | type Value = ast::Variant; |
116 | fn child_source(&self, db: &dyn DefDatabase) -> InFile<ArenaMap<Self::ChildId, Self::Value>> { | 116 | fn child_source(&self, db: &dyn DefDatabase) -> InFile<ArenaMap<Self::ChildId, Self::Value>> { |
117 | let src = self.lookup(db).source(db); | 117 | let src = self.lookup(db).source(db); |
118 | let mut trace = Trace::new_for_map(); | 118 | let mut trace = Trace::new_for_map(); |
@@ -123,7 +123,7 @@ impl HasChildSource for EnumId { | |||
123 | 123 | ||
124 | fn lower_enum( | 124 | fn lower_enum( |
125 | db: &dyn DefDatabase, | 125 | db: &dyn DefDatabase, |
126 | trace: &mut Trace<EnumVariantData, ast::EnumVariant>, | 126 | trace: &mut Trace<EnumVariantData, ast::Variant>, |
127 | ast: &InFile<ast::Enum>, | 127 | ast: &InFile<ast::Enum>, |
128 | module_id: ModuleId, | 128 | module_id: ModuleId, |
129 | ) { | 129 | ) { |
diff --git a/crates/ra_hir_def/src/child_by_source.rs b/crates/ra_hir_def/src/child_by_source.rs index a885ec96d..dcb00a1d9 100644 --- a/crates/ra_hir_def/src/child_by_source.rs +++ b/crates/ra_hir_def/src/child_by_source.rs | |||
@@ -162,7 +162,7 @@ impl ChildBySource for EnumId { | |||
162 | let arena_map = arena_map.as_ref(); | 162 | let arena_map = arena_map.as_ref(); |
163 | for (local_id, source) in arena_map.value.iter() { | 163 | for (local_id, source) in arena_map.value.iter() { |
164 | let id = EnumVariantId { parent: *self, local_id }; | 164 | let id = EnumVariantId { parent: *self, local_id }; |
165 | res[keys::ENUM_VARIANT].insert(arena_map.with_value(source.clone()), id) | 165 | res[keys::VARIANT].insert(arena_map.with_value(source.clone()), id) |
166 | } | 166 | } |
167 | 167 | ||
168 | res | 168 | res |
diff --git a/crates/ra_hir_def/src/item_tree/lower.rs b/crates/ra_hir_def/src/item_tree/lower.rs index da7238416..6d963c852 100644 --- a/crates/ra_hir_def/src/item_tree/lower.rs +++ b/crates/ra_hir_def/src/item_tree/lower.rs | |||
@@ -259,7 +259,7 @@ impl Ctx { | |||
259 | Some(id(self.data().enums.alloc(res))) | 259 | Some(id(self.data().enums.alloc(res))) |
260 | } | 260 | } |
261 | 261 | ||
262 | fn lower_variants(&mut self, variants: &ast::EnumVariantList) -> IdRange<Variant> { | 262 | fn lower_variants(&mut self, variants: &ast::VariantList) -> IdRange<Variant> { |
263 | let start = self.next_variant_idx(); | 263 | let start = self.next_variant_idx(); |
264 | for variant in variants.variants() { | 264 | for variant in variants.variants() { |
265 | if let Some(data) = self.lower_variant(&variant) { | 265 | if let Some(data) = self.lower_variant(&variant) { |
@@ -271,7 +271,7 @@ impl Ctx { | |||
271 | IdRange::new(start..end) | 271 | IdRange::new(start..end) |
272 | } | 272 | } |
273 | 273 | ||
274 | fn lower_variant(&mut self, variant: &ast::EnumVariant) -> Option<Variant> { | 274 | fn lower_variant(&mut self, variant: &ast::Variant) -> Option<Variant> { |
275 | let name = variant.name()?.as_name(); | 275 | let name = variant.name()?.as_name(); |
276 | let fields = self.lower_fields(&variant.kind()); | 276 | let fields = self.lower_fields(&variant.kind()); |
277 | let res = Variant { name, fields }; | 277 | let res = Variant { name, fields }; |
diff --git a/crates/ra_hir_def/src/keys.rs b/crates/ra_hir_def/src/keys.rs index 2695e8c24..c2a03dfed 100644 --- a/crates/ra_hir_def/src/keys.rs +++ b/crates/ra_hir_def/src/keys.rs | |||
@@ -24,7 +24,7 @@ pub const STRUCT: Key<ast::Struct, StructId> = Key::new(); | |||
24 | pub const UNION: Key<ast::Union, UnionId> = Key::new(); | 24 | pub const UNION: Key<ast::Union, UnionId> = Key::new(); |
25 | pub const ENUM: Key<ast::Enum, EnumId> = Key::new(); | 25 | pub const ENUM: Key<ast::Enum, EnumId> = Key::new(); |
26 | 26 | ||
27 | pub const ENUM_VARIANT: Key<ast::EnumVariant, EnumVariantId> = Key::new(); | 27 | pub const VARIANT: Key<ast::Variant, EnumVariantId> = Key::new(); |
28 | pub const TUPLE_FIELD: Key<ast::TupleField, FieldId> = Key::new(); | 28 | pub const TUPLE_FIELD: Key<ast::TupleField, FieldId> = Key::new(); |
29 | pub const RECORD_FIELD: Key<ast::RecordField, FieldId> = Key::new(); | 29 | pub const RECORD_FIELD: Key<ast::RecordField, FieldId> = Key::new(); |
30 | pub const TYPE_PARAM: Key<ast::TypeParam, TypeParamId> = Key::new(); | 30 | pub const TYPE_PARAM: Key<ast::TypeParam, TypeParamId> = Key::new(); |
diff --git a/crates/ra_ide/src/display/navigation_target.rs b/crates/ra_ide/src/display/navigation_target.rs index 02fefd6bb..c30b91fe0 100644 --- a/crates/ra_ide/src/display/navigation_target.rs +++ b/crates/ra_ide/src/display/navigation_target.rs | |||
@@ -388,7 +388,7 @@ pub(crate) fn docs_from_symbol(db: &RootDatabase, symbol: &FileSymbol) -> Option | |||
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::RecordField(it) => it.doc_comment_text(), | 390 | ast::RecordField(it) => it.doc_comment_text(), |
391 | ast::EnumVariant(it) => it.doc_comment_text(), | 391 | ast::Variant(it) => it.doc_comment_text(), |
392 | ast::MacroCall(it) => it.doc_comment_text(), | 392 | ast::MacroCall(it) => it.doc_comment_text(), |
393 | _ => None, | 393 | _ => None, |
394 | } | 394 | } |
@@ -413,7 +413,7 @@ pub(crate) fn description_from_symbol(db: &RootDatabase, symbol: &FileSymbol) -> | |||
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::RecordField(it) => it.short_label(), | 415 | ast::RecordField(it) => it.short_label(), |
416 | ast::EnumVariant(it) => it.short_label(), | 416 | ast::Variant(it) => it.short_label(), |
417 | _ => None, | 417 | _ => None, |
418 | } | 418 | } |
419 | } | 419 | } |
diff --git a/crates/ra_ide/src/display/short_label.rs b/crates/ra_ide/src/display/short_label.rs index 5bf70937f..ddf1059ee 100644 --- a/crates/ra_ide/src/display/short_label.rs +++ b/crates/ra_ide/src/display/short_label.rs | |||
@@ -71,7 +71,7 @@ impl ShortLabel for ast::RecordField { | |||
71 | } | 71 | } |
72 | } | 72 | } |
73 | 73 | ||
74 | impl ShortLabel for ast::EnumVariant { | 74 | impl ShortLabel for ast::Variant { |
75 | fn short_label(&self) -> Option<String> { | 75 | fn short_label(&self) -> Option<String> { |
76 | Some(self.name()?.text().to_string()) | 76 | Some(self.name()?.text().to_string()) |
77 | } | 77 | } |
diff --git a/crates/ra_ide/src/extend_selection.rs b/crates/ra_ide/src/extend_selection.rs index 04a7f0ac4..fc81b48cc 100644 --- a/crates/ra_ide/src/extend_selection.rs +++ b/crates/ra_ide/src/extend_selection.rs | |||
@@ -42,7 +42,7 @@ fn try_extend_selection( | |||
42 | RECORD_FIELD_LIST, | 42 | RECORD_FIELD_LIST, |
43 | TUPLE_FIELD_LIST, | 43 | TUPLE_FIELD_LIST, |
44 | RECORD_EXPR_FIELD_LIST, | 44 | RECORD_EXPR_FIELD_LIST, |
45 | ENUM_VARIANT_LIST, | 45 | VARIANT_LIST, |
46 | USE_TREE_LIST, | 46 | USE_TREE_LIST, |
47 | GENERIC_PARAM_LIST, | 47 | GENERIC_PARAM_LIST, |
48 | TYPE_ARG_LIST, | 48 | TYPE_ARG_LIST, |
diff --git a/crates/ra_ide/src/file_structure.rs b/crates/ra_ide/src/file_structure.rs index c909f96aa..43202499d 100644 --- a/crates/ra_ide/src/file_structure.rs +++ b/crates/ra_ide/src/file_structure.rs | |||
@@ -129,7 +129,7 @@ fn structure_node(node: &SyntaxNode) -> Option<StructureNode> { | |||
129 | ast::Struct(it) => decl(it), | 129 | ast::Struct(it) => decl(it), |
130 | ast::Union(it) => decl(it), | 130 | ast::Union(it) => decl(it), |
131 | ast::Enum(it) => decl(it), | 131 | ast::Enum(it) => decl(it), |
132 | ast::EnumVariant(it) => decl(it), | 132 | ast::Variant(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::TypeAlias(it) => { | 135 | ast::TypeAlias(it) => { |
@@ -319,7 +319,7 @@ fn very_obsolete() {} | |||
319 | label: "X", | 319 | label: "X", |
320 | navigation_range: 169..170, | 320 | navigation_range: 169..170, |
321 | node_range: 169..170, | 321 | node_range: 169..170, |
322 | kind: ENUM_VARIANT, | 322 | kind: VARIANT, |
323 | detail: None, | 323 | detail: None, |
324 | deprecated: false, | 324 | deprecated: false, |
325 | }, | 325 | }, |
@@ -330,7 +330,7 @@ fn very_obsolete() {} | |||
330 | label: "Y", | 330 | label: "Y", |
331 | navigation_range: 172..173, | 331 | navigation_range: 172..173, |
332 | node_range: 172..178, | 332 | node_range: 172..178, |
333 | kind: ENUM_VARIANT, | 333 | kind: VARIANT, |
334 | detail: None, | 334 | detail: None, |
335 | deprecated: false, | 335 | deprecated: false, |
336 | }, | 336 | }, |
diff --git a/crates/ra_ide/src/folding_ranges.rs b/crates/ra_ide/src/folding_ranges.rs index 8dcce9f56..5a6e17936 100644 --- a/crates/ra_ide/src/folding_ranges.rs +++ b/crates/ra_ide/src/folding_ranges.rs | |||
@@ -93,7 +93,7 @@ fn fold_kind(kind: SyntaxKind) -> Option<FoldKind> { | |||
93 | | USE_TREE_LIST | 93 | | USE_TREE_LIST |
94 | | BLOCK_EXPR | 94 | | BLOCK_EXPR |
95 | | MATCH_ARM_LIST | 95 | | MATCH_ARM_LIST |
96 | | ENUM_VARIANT_LIST | 96 | | VARIANT_LIST |
97 | | TOKEN_TREE => Some(FoldKind::Block), | 97 | | TOKEN_TREE => Some(FoldKind::Block), |
98 | _ => None, | 98 | _ => None, |
99 | } | 99 | } |
diff --git a/crates/ra_ide/src/references.rs b/crates/ra_ide/src/references.rs index 2a62dab6c..519e4bf1a 100644 --- a/crates/ra_ide/src/references.rs +++ b/crates/ra_ide/src/references.rs | |||
@@ -390,7 +390,7 @@ enum Foo { | |||
390 | } | 390 | } |
391 | "#, | 391 | "#, |
392 | ); | 392 | ); |
393 | check_result(refs, "B ENUM_VARIANT FileId(1) 22..23 22..23 Other", &[]); | 393 | check_result(refs, "B VARIANT FileId(1) 22..23 22..23 Other", &[]); |
394 | } | 394 | } |
395 | 395 | ||
396 | #[test] | 396 | #[test] |
diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs index 7e2833bd5..ce890c816 100644 --- a/crates/ra_ide/src/syntax_highlighting.rs +++ b/crates/ra_ide/src/syntax_highlighting.rs | |||
@@ -716,7 +716,7 @@ fn highlight_name_by_syntax(name: ast::Name) -> Highlight { | |||
716 | FN => 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 | VARIANT => HighlightTag::EnumVariant, |
720 | BIND_PAT => HighlightTag::Local, | 720 | BIND_PAT => HighlightTag::Local, |
721 | _ => default, | 721 | _ => default, |
722 | }; | 722 | }; |
diff --git a/crates/ra_ide_db/src/defs.rs b/crates/ra_ide_db/src/defs.rs index 586b3d750..635cf706c 100644 --- a/crates/ra_ide_db/src/defs.rs +++ b/crates/ra_ide_db/src/defs.rs | |||
@@ -170,7 +170,7 @@ pub fn classify_name(sema: &Semantics<RootDatabase>, name: &ast::Name) -> Option | |||
170 | let def: hir::Static = sema.to_def(&it)?; | 170 | let def: hir::Static = sema.to_def(&it)?; |
171 | Some(NameClass::Definition(Definition::ModuleDef(def.into()))) | 171 | Some(NameClass::Definition(Definition::ModuleDef(def.into()))) |
172 | }, | 172 | }, |
173 | ast::EnumVariant(it) => { | 173 | ast::Variant(it) => { |
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 | }, |
diff --git a/crates/ra_parser/src/grammar.rs b/crates/ra_parser/src/grammar.rs index 03041d110..22a7acdf3 100644 --- a/crates/ra_parser/src/grammar.rs +++ b/crates/ra_parser/src/grammar.rs | |||
@@ -144,7 +144,7 @@ pub(crate) fn reparser( | |||
144 | BLOCK_EXPR => expressions::block_expr, | 144 | BLOCK_EXPR => expressions::block_expr, |
145 | RECORD_FIELD_LIST => items::record_field_def_list, | 145 | RECORD_FIELD_LIST => items::record_field_def_list, |
146 | RECORD_EXPR_FIELD_LIST => items::record_field_list, | 146 | RECORD_EXPR_FIELD_LIST => items::record_field_list, |
147 | ENUM_VARIANT_LIST => items::enum_variant_list, | 147 | VARIANT_LIST => items::enum_variant_list, |
148 | MATCH_ARM_LIST => items::match_arm_list, | 148 | MATCH_ARM_LIST => items::match_arm_list, |
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, |
diff --git a/crates/ra_parser/src/grammar/items/adt.rs b/crates/ra_parser/src/grammar/items/adt.rs index aeb7ce86b..addfb59d4 100644 --- a/crates/ra_parser/src/grammar/items/adt.rs +++ b/crates/ra_parser/src/grammar/items/adt.rs | |||
@@ -91,7 +91,7 @@ pub(crate) fn enum_variant_list(p: &mut Parser) { | |||
91 | if p.eat(T![=]) { | 91 | if p.eat(T![=]) { |
92 | expressions::expr(p); | 92 | expressions::expr(p); |
93 | } | 93 | } |
94 | var.complete(p, ENUM_VARIANT); | 94 | var.complete(p, VARIANT); |
95 | } else { | 95 | } else { |
96 | var.abandon(p); | 96 | var.abandon(p); |
97 | p.err_and_bump("expected enum variant"); | 97 | p.err_and_bump("expected enum variant"); |
@@ -101,7 +101,7 @@ pub(crate) fn enum_variant_list(p: &mut Parser) { | |||
101 | } | 101 | } |
102 | } | 102 | } |
103 | p.expect(T!['}']); | 103 | p.expect(T!['}']); |
104 | m.complete(p, ENUM_VARIANT_LIST); | 104 | m.complete(p, VARIANT_LIST); |
105 | } | 105 | } |
106 | 106 | ||
107 | pub(crate) fn record_field_def_list(p: &mut Parser) { | 107 | pub(crate) fn record_field_def_list(p: &mut Parser) { |
diff --git a/crates/ra_parser/src/syntax_kind/generated.rs b/crates/ra_parser/src/syntax_kind/generated.rs index fde9e55f1..3b82347f3 100644 --- a/crates/ra_parser/src/syntax_kind/generated.rs +++ b/crates/ra_parser/src/syntax_kind/generated.rs | |||
@@ -206,12 +206,12 @@ pub enum SyntaxKind { | |||
206 | BIN_EXPR, | 206 | BIN_EXPR, |
207 | EXTERN_BLOCK, | 207 | EXTERN_BLOCK, |
208 | EXTERN_ITEM_LIST, | 208 | EXTERN_ITEM_LIST, |
209 | ENUM_VARIANT, | 209 | VARIANT, |
210 | RECORD_FIELD_LIST, | 210 | RECORD_FIELD_LIST, |
211 | RECORD_FIELD, | 211 | RECORD_FIELD, |
212 | TUPLE_FIELD_LIST, | 212 | TUPLE_FIELD_LIST, |
213 | TUPLE_FIELD, | 213 | TUPLE_FIELD, |
214 | ENUM_VARIANT_LIST, | 214 | VARIANT_LIST, |
215 | ITEM_LIST, | 215 | ITEM_LIST, |
216 | ASSOC_ITEM_LIST, | 216 | ASSOC_ITEM_LIST, |
217 | ATTR, | 217 | ATTR, |
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index 1d1452546..6613b54ba 100644 --- a/crates/ra_syntax/src/ast/generated/nodes.rs +++ b/crates/ra_syntax/src/ast/generated/nodes.rs | |||
@@ -53,7 +53,7 @@ impl ast::VisibilityOwner for Enum {} | |||
53 | impl ast::GenericParamsOwner for Enum {} | 53 | impl ast::GenericParamsOwner for Enum {} |
54 | impl Enum { | 54 | impl Enum { |
55 | pub fn enum_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![enum]) } | 55 | pub fn enum_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![enum]) } |
56 | pub fn variant_list(&self) -> Option<EnumVariantList> { support::child(&self.syntax) } | 56 | pub fn variant_list(&self) -> Option<VariantList> { support::child(&self.syntax) } |
57 | } | 57 | } |
58 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 58 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
59 | pub struct ExternBlock { | 59 | pub struct ExternBlock { |
@@ -427,22 +427,22 @@ impl TupleField { | |||
427 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 427 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
428 | } | 428 | } |
429 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 429 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
430 | pub struct EnumVariantList { | 430 | pub struct VariantList { |
431 | pub(crate) syntax: SyntaxNode, | 431 | pub(crate) syntax: SyntaxNode, |
432 | } | 432 | } |
433 | impl EnumVariantList { | 433 | impl VariantList { |
434 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } | 434 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } |
435 | pub fn variants(&self) -> AstChildren<EnumVariant> { support::children(&self.syntax) } | 435 | pub fn variants(&self) -> AstChildren<Variant> { support::children(&self.syntax) } |
436 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } | 436 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } |
437 | } | 437 | } |
438 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 438 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
439 | pub struct EnumVariant { | 439 | pub struct Variant { |
440 | pub(crate) syntax: SyntaxNode, | 440 | pub(crate) syntax: SyntaxNode, |
441 | } | 441 | } |
442 | impl ast::AttrsOwner for EnumVariant {} | 442 | impl ast::AttrsOwner for Variant {} |
443 | impl ast::NameOwner for EnumVariant {} | 443 | impl ast::NameOwner for Variant {} |
444 | impl ast::VisibilityOwner for EnumVariant {} | 444 | impl ast::VisibilityOwner for Variant {} |
445 | impl EnumVariant { | 445 | impl Variant { |
446 | pub fn field_list(&self) -> Option<FieldList> { support::child(&self.syntax) } | 446 | pub fn field_list(&self) -> Option<FieldList> { support::child(&self.syntax) } |
447 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } | 447 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
448 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 448 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
@@ -1806,8 +1806,8 @@ impl AstNode for TupleField { | |||
1806 | } | 1806 | } |
1807 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1807 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1808 | } | 1808 | } |
1809 | impl AstNode for EnumVariantList { | 1809 | impl AstNode for VariantList { |
1810 | fn can_cast(kind: SyntaxKind) -> bool { kind == ENUM_VARIANT_LIST } | 1810 | fn can_cast(kind: SyntaxKind) -> bool { kind == VARIANT_LIST } |
1811 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1811 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1812 | if Self::can_cast(syntax.kind()) { | 1812 | if Self::can_cast(syntax.kind()) { |
1813 | Some(Self { syntax }) | 1813 | Some(Self { syntax }) |
@@ -1817,8 +1817,8 @@ impl AstNode for EnumVariantList { | |||
1817 | } | 1817 | } |
1818 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1818 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1819 | } | 1819 | } |
1820 | impl AstNode for EnumVariant { | 1820 | impl AstNode for Variant { |
1821 | fn can_cast(kind: SyntaxKind) -> bool { kind == ENUM_VARIANT } | 1821 | fn can_cast(kind: SyntaxKind) -> bool { kind == VARIANT } |
1822 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1822 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1823 | if Self::can_cast(syntax.kind()) { | 1823 | if Self::can_cast(syntax.kind()) { |
1824 | Some(Self { syntax }) | 1824 | Some(Self { syntax }) |
@@ -3640,12 +3640,12 @@ impl std::fmt::Display for TupleField { | |||
3640 | std::fmt::Display::fmt(self.syntax(), f) | 3640 | std::fmt::Display::fmt(self.syntax(), f) |
3641 | } | 3641 | } |
3642 | } | 3642 | } |
3643 | impl std::fmt::Display for EnumVariantList { | 3643 | impl std::fmt::Display for VariantList { |
3644 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3644 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3645 | std::fmt::Display::fmt(self.syntax(), f) | 3645 | std::fmt::Display::fmt(self.syntax(), f) |
3646 | } | 3646 | } |
3647 | } | 3647 | } |
3648 | impl std::fmt::Display for EnumVariant { | 3648 | impl std::fmt::Display for Variant { |
3649 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3649 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3650 | std::fmt::Display::fmt(self.syntax(), f) | 3650 | std::fmt::Display::fmt(self.syntax(), f) |
3651 | } | 3651 | } |
diff --git a/crates/ra_syntax/src/ast/node_ext.rs b/crates/ra_syntax/src/ast/node_ext.rs index 02e6e52c2..05ec49cec 100644 --- a/crates/ra_syntax/src/ast/node_ext.rs +++ b/crates/ra_syntax/src/ast/node_ext.rs | |||
@@ -247,7 +247,7 @@ impl ast::RecordFieldPat { | |||
247 | } | 247 | } |
248 | } | 248 | } |
249 | 249 | ||
250 | impl ast::EnumVariant { | 250 | impl ast::Variant { |
251 | pub fn parent_enum(&self) -> ast::Enum { | 251 | pub fn parent_enum(&self) -> ast::Enum { |
252 | self.syntax() | 252 | self.syntax() |
253 | .parent() | 253 | .parent() |
@@ -480,7 +480,7 @@ impl ast::DocCommentsOwner for ast::Union {} | |||
480 | impl ast::DocCommentsOwner for ast::RecordField {} | 480 | impl ast::DocCommentsOwner for ast::RecordField {} |
481 | impl ast::DocCommentsOwner for ast::TupleField {} | 481 | impl ast::DocCommentsOwner for ast::TupleField {} |
482 | impl ast::DocCommentsOwner for ast::Enum {} | 482 | impl ast::DocCommentsOwner for ast::Enum {} |
483 | impl ast::DocCommentsOwner for ast::EnumVariant {} | 483 | impl ast::DocCommentsOwner for ast::Variant {} |
484 | impl ast::DocCommentsOwner for ast::TraitDef {} | 484 | 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 {} |
diff --git a/crates/ra_syntax/src/parsing/text_tree_sink.rs b/crates/ra_syntax/src/parsing/text_tree_sink.rs index faffd0d32..c586dc320 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 | STRUCT | ENUM | ENUM_VARIANT | FN | TRAIT_DEF | 149 | MACRO_CALL | CONST_DEF | TYPE_ALIAS | STRUCT | ENUM | VARIANT | FN | TRAIT_DEF |
150 | | MODULE | RECORD_FIELD | STATIC_DEF => { | 150 | | MODULE | RECORD_FIELD | 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/test_data/parser/err/0025_nope.rast b/crates/ra_syntax/test_data/parser/err/0025_nope.rast index 94456e48c..fca646557 100644 --- a/crates/ra_syntax/test_data/parser/err/0025_nope.rast +++ b/crates/ra_syntax/test_data/parser/err/0025_nope.rast | |||
@@ -17,15 +17,15 @@ [email protected] | |||
17 | [email protected] | 17 | [email protected] |
18 | [email protected] "Test" | 18 | [email protected] "Test" |
19 | [email protected] " " | 19 | [email protected] " " |
20 | ENUM_[email protected] | 20 | [email protected] |
21 | [email protected] "{" | 21 | [email protected] "{" |
22 | [email protected] "\n " | 22 | [email protected] "\n " |
23 | ENUM_[email protected] | 23 | [email protected] |
24 | [email protected] | 24 | [email protected] |
25 | [email protected] "Var1" | 25 | [email protected] "Var1" |
26 | [email protected] "," | 26 | [email protected] "," |
27 | [email protected] "\n " | 27 | [email protected] "\n " |
28 | ENUM_[email protected] | 28 | [email protected] |
29 | [email protected] | 29 | [email protected] |
30 | [email protected] "Var2" | 30 | [email protected] "Var2" |
31 | [email protected] | 31 | [email protected] |
@@ -39,7 +39,7 @@ [email protected] | |||
39 | [email protected] ")" | 39 | [email protected] ")" |
40 | [email protected] "," | 40 | [email protected] "," |
41 | [email protected] "\n " | 41 | [email protected] "\n " |
42 | ENUM_[email protected] | 42 | [email protected] |
43 | [email protected] | 43 | [email protected] |
44 | [email protected] "Var3" | 44 | [email protected] "Var3" |
45 | [email protected] " " | 45 | [email protected] " " |
@@ -85,10 +85,10 @@ [email protected] | |||
85 | [email protected] | 85 | [email protected] |
86 | [email protected] "Test2" | 86 | [email protected] "Test2" |
87 | [email protected] " " | 87 | [email protected] " " |
88 | ENUM_[email protected] | 88 | [email protected] |
89 | [email protected] "{" | 89 | [email protected] "{" |
90 | [email protected] "\n " | 90 | [email protected] "\n " |
91 | ENUM_[email protected] | 91 | [email protected] |
92 | [email protected] | 92 | [email protected] |
93 | [email protected] "Fine" | 93 | [email protected] "Fine" |
94 | [email protected] "," | 94 | [email protected] "," |
@@ -101,10 +101,10 @@ [email protected] | |||
101 | [email protected] | 101 | [email protected] |
102 | [email protected] "Test3" | 102 | [email protected] "Test3" |
103 | [email protected] " " | 103 | [email protected] " " |
104 | ENUM_[email protected] | 104 | [email protected] |
105 | [email protected] "{" | 105 | [email protected] "{" |
106 | [email protected] "\n " | 106 | [email protected] "\n " |
107 | ENUM_[email protected] | 107 | [email protected] |
108 | [email protected] | 108 | [email protected] |
109 | [email protected] "StillFine" | 109 | [email protected] "StillFine" |
110 | [email protected] " " | 110 | [email protected] " " |
@@ -140,10 +140,10 @@ [email protected] | |||
140 | [email protected] | 140 | [email protected] |
141 | [email protected] "Test4" | 141 | [email protected] "Test4" |
142 | [email protected] " " | 142 | [email protected] " " |
143 | ENUM_[email protected] | 143 | [email protected] |
144 | [email protected] "{" | 144 | [email protected] "{" |
145 | [email protected] "\n " | 145 | [email protected] "\n " |
146 | ENUM_[email protected] | 146 | [email protected] |
147 | [email protected] | 147 | [email protected] |
148 | [email protected] "Nope" | 148 | [email protected] "Nope" |
149 | [email protected] | 149 | [email protected] |
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 25e6cc170..f2561abd6 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 | |||
@@ -4,7 +4,7 @@ [email protected] | |||
4 | [email protected] " " | 4 | [email protected] " " |
5 | [email protected] | 5 | [email protected] |
6 | [email protected] "F" | 6 | [email protected] "F" |
7 | ENUM_[email protected] | 7 | [email protected] |
8 | [email protected] "{" | 8 | [email protected] "{" |
9 | [email protected] "}" | 9 | [email protected] "}" |
10 | [email protected] "\n" | 10 | [email protected] "\n" |
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 9cc8172e0..429a0506e 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 | |||
@@ -17,15 +17,15 @@ [email protected] | |||
17 | [email protected] | 17 | [email protected] |
18 | [email protected] "LocalEnum" | 18 | [email protected] "LocalEnum" |
19 | [email protected] " " | 19 | [email protected] " " |
20 | ENUM_[email protected] | 20 | [email protected] |
21 | [email protected] "{" | 21 | [email protected] "{" |
22 | [email protected] "\n " | 22 | [email protected] "\n " |
23 | ENUM_[email protected] | 23 | [email protected] |
24 | [email protected] | 24 | [email protected] |
25 | [email protected] "One" | 25 | [email protected] "One" |
26 | [email protected] "," | 26 | [email protected] "," |
27 | [email protected] "\n " | 27 | [email protected] "\n " |
28 | ENUM_[email protected] | 28 | [email protected] |
29 | [email protected] | 29 | [email protected] |
30 | [email protected] "Two" | 30 | [email protected] "Two" |
31 | [email protected] "," | 31 | [email protected] "," |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0157_variant_discriminant.rast b/crates/ra_syntax/test_data/parser/inline/ok/0157_variant_discriminant.rast index 0331558d2..a2e05eb2e 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0157_variant_discriminant.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0157_variant_discriminant.rast | |||
@@ -5,10 +5,10 @@ [email protected] | |||
5 | [email protected] | 5 | [email protected] |
6 | [email protected] "E" | 6 | [email protected] "E" |
7 | [email protected] " " | 7 | [email protected] " " |
8 | ENUM_[email protected] | 8 | [email protected] |
9 | [email protected] "{" | 9 | [email protected] "{" |
10 | [email protected] " " | 10 | [email protected] " " |
11 | ENUM_[email protected] | 11 | [email protected] |
12 | [email protected] | 12 | [email protected] |
13 | [email protected] "X" | 13 | [email protected] "X" |
14 | [email protected] | 14 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/ok/0019_enums.rast b/crates/ra_syntax/test_data/parser/ok/0019_enums.rast index 1ffcffc1a..c3df00814 100644 --- a/crates/ra_syntax/test_data/parser/ok/0019_enums.rast +++ b/crates/ra_syntax/test_data/parser/ok/0019_enums.rast | |||
@@ -5,7 +5,7 @@ [email protected] | |||
5 | [email protected] | 5 | [email protected] |
6 | [email protected] "E1" | 6 | [email protected] "E1" |
7 | [email protected] " " | 7 | [email protected] " " |
8 | ENUM_[email protected] | 8 | [email protected] |
9 | [email protected] "{" | 9 | [email protected] "{" |
10 | [email protected] "\n" | 10 | [email protected] "\n" |
11 | [email protected] "}" | 11 | [email protected] "}" |
@@ -22,7 +22,7 @@ [email protected] | |||
22 | [email protected] "T" | 22 | [email protected] "T" |
23 | [email protected] ">" | 23 | [email protected] ">" |
24 | [email protected] " " | 24 | [email protected] " " |
25 | ENUM_[email protected] | 25 | [email protected] |
26 | [email protected] "{" | 26 | [email protected] "{" |
27 | [email protected] "\n" | 27 | [email protected] "\n" |
28 | [email protected] "}" | 28 | [email protected] "}" |
@@ -33,10 +33,10 @@ [email protected] | |||
33 | [email protected] | 33 | [email protected] |
34 | [email protected] "E3" | 34 | [email protected] "E3" |
35 | [email protected] " " | 35 | [email protected] " " |
36 | ENUM_[email protected] | 36 | [email protected] |
37 | [email protected] "{" | 37 | [email protected] "{" |
38 | [email protected] "\n " | 38 | [email protected] "\n " |
39 | ENUM_[email protected] | 39 | [email protected] |
40 | [email protected] | 40 | [email protected] |
41 | [email protected] "X" | 41 | [email protected] "X" |
42 | [email protected] "\n" | 42 | [email protected] "\n" |
@@ -48,10 +48,10 @@ [email protected] | |||
48 | [email protected] | 48 | [email protected] |
49 | [email protected] "E4" | 49 | [email protected] "E4" |
50 | [email protected] " " | 50 | [email protected] " " |
51 | ENUM_[email protected] | 51 | [email protected] |
52 | [email protected] "{" | 52 | [email protected] "{" |
53 | [email protected] "\n " | 53 | [email protected] "\n " |
54 | ENUM_[email protected] | 54 | [email protected] |
55 | [email protected] | 55 | [email protected] |
56 | [email protected] "X" | 56 | [email protected] "X" |
57 | [email protected] "," | 57 | [email protected] "," |
@@ -64,15 +64,15 @@ [email protected] | |||
64 | [email protected] | 64 | [email protected] |
65 | [email protected] "E5" | 65 | [email protected] "E5" |
66 | [email protected] " " | 66 | [email protected] " " |
67 | ENUM_[email protected] | 67 | [email protected] |
68 | [email protected] "{" | 68 | [email protected] "{" |
69 | [email protected] "\n " | 69 | [email protected] "\n " |
70 | ENUM_[email protected] | 70 | [email protected] |
71 | [email protected] | 71 | [email protected] |
72 | [email protected] "A" | 72 | [email protected] "A" |
73 | [email protected] "," | 73 | [email protected] "," |
74 | [email protected] "\n " | 74 | [email protected] "\n " |
75 | ENUM_[email protected] | 75 | [email protected] |
76 | [email protected] | 76 | [email protected] |
77 | [email protected] "B" | 77 | [email protected] "B" |
78 | [email protected] " " | 78 | [email protected] " " |
@@ -82,7 +82,7 @@ [email protected] | |||
82 | [email protected] "92" | 82 | [email protected] "92" |
83 | [email protected] "," | 83 | [email protected] "," |
84 | [email protected] "\n " | 84 | [email protected] "\n " |
85 | ENUM_[email protected] | 85 | [email protected] |
86 | [email protected] | 86 | [email protected] |
87 | [email protected] "C" | 87 | [email protected] "C" |
88 | [email protected] " " | 88 | [email protected] " " |
@@ -119,7 +119,7 @@ [email protected] | |||
119 | [email protected] "}" | 119 | [email protected] "}" |
120 | [email protected] "," | 120 | [email protected] "," |
121 | [email protected] "\n " | 121 | [email protected] "\n " |
122 | ENUM_[email protected] | 122 | [email protected] |
123 | [email protected] | 123 | [email protected] |
124 | [email protected] "F" | 124 | [email protected] "F" |
125 | [email protected] " " | 125 | [email protected] " " |
@@ -128,7 +128,7 @@ [email protected] | |||
128 | [email protected] "}" | 128 | [email protected] "}" |
129 | [email protected] "," | 129 | [email protected] "," |
130 | [email protected] "\n " | 130 | [email protected] "\n " |
131 | ENUM_[email protected] | 131 | [email protected] |
132 | [email protected] | 132 | [email protected] |
133 | [email protected] "D" | 133 | [email protected] "D" |
134 | [email protected] | 134 | [email protected] |
@@ -143,7 +143,7 @@ [email protected] | |||
143 | [email protected] ")" | 143 | [email protected] ")" |
144 | [email protected] "," | 144 | [email protected] "," |
145 | [email protected] "\n " | 145 | [email protected] "\n " |
146 | ENUM_[email protected] | 146 | [email protected] |
147 | [email protected] | 147 | [email protected] |
148 | [email protected] "E" | 148 | [email protected] "E" |
149 | [email protected] | 149 | [email protected] |
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 9db4f0aa1..7a54fa113 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 | |||
@@ -262,10 +262,10 @@ [email protected] | |||
262 | [email protected] | 262 | [email protected] |
263 | [email protected] "A" | 263 | [email protected] "A" |
264 | [email protected] " " | 264 | [email protected] " " |
265 | ENUM_[email protected] | 265 | [email protected] |
266 | [email protected] "{" | 266 | [email protected] "{" |
267 | [email protected] "\n " | 267 | [email protected] "\n " |
268 | ENUM_[email protected] | 268 | [email protected] |
269 | [email protected] | 269 | [email protected] |
270 | [email protected] "B" | 270 | [email protected] "B" |
271 | [email protected] | 271 | [email protected] |
diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs index 62acbfb91..dcd81da6e 100644 --- a/crates/rust-analyzer/src/to_proto.rs +++ b/crates/rust-analyzer/src/to_proto.rs | |||
@@ -34,7 +34,7 @@ pub(crate) fn symbol_kind(syntax_kind: SyntaxKind) -> lsp_types::SymbolKind { | |||
34 | SyntaxKind::FN => lsp_types::SymbolKind::Function, | 34 | SyntaxKind::FN => lsp_types::SymbolKind::Function, |
35 | SyntaxKind::STRUCT => lsp_types::SymbolKind::Struct, | 35 | SyntaxKind::STRUCT => lsp_types::SymbolKind::Struct, |
36 | SyntaxKind::ENUM => lsp_types::SymbolKind::Enum, | 36 | SyntaxKind::ENUM => lsp_types::SymbolKind::Enum, |
37 | SyntaxKind::ENUM_VARIANT => lsp_types::SymbolKind::EnumMember, | 37 | SyntaxKind::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, |