diff options
Diffstat (limited to 'crates')
60 files changed, 158 insertions, 158 deletions
diff --git a/crates/ra_assists/src/handlers/change_visibility.rs b/crates/ra_assists/src/handlers/change_visibility.rs index 72d06d55b..12c40a3cc 100644 --- a/crates/ra_assists/src/handlers/change_visibility.rs +++ b/crates/ra_assists/src/handlers/change_visibility.rs | |||
@@ -1,7 +1,7 @@ | |||
1 | use ra_syntax::{ | 1 | use ra_syntax::{ |
2 | ast::{self, NameOwner, VisibilityOwner}, | 2 | ast::{self, NameOwner, VisibilityOwner}, |
3 | AstNode, | 3 | AstNode, |
4 | SyntaxKind::{CONST_DEF, ENUM_DEF, FN, MODULE, STATIC_DEF, STRUCT_DEF, TRAIT_DEF, VISIBILITY}, | 4 | SyntaxKind::{CONST_DEF, ENUM_DEF, FN, MODULE, STATIC_DEF, STRUCT, TRAIT_DEF, VISIBILITY}, |
5 | T, | 5 | T, |
6 | }; | 6 | }; |
7 | use test_utils::mark; | 7 | use test_utils::mark; |
@@ -36,7 +36,7 @@ fn add_vis(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { | |||
36 | 36 | ||
37 | let (offset, target) = if let Some(keyword) = item_keyword { | 37 | let (offset, target) = if let Some(keyword) = item_keyword { |
38 | let parent = keyword.parent(); | 38 | let parent = keyword.parent(); |
39 | let def_kws = vec![CONST_DEF, STATIC_DEF, FN, MODULE, STRUCT_DEF, ENUM_DEF, TRAIT_DEF]; | 39 | let def_kws = vec![CONST_DEF, STATIC_DEF, FN, MODULE, STRUCT, ENUM_DEF, TRAIT_DEF]; |
40 | // Parent is not a definition, can't add visibility | 40 | // Parent is not a definition, can't add visibility |
41 | if !def_kws.iter().any(|&def_kw| def_kw == parent.kind()) { | 41 | if !def_kws.iter().any(|&def_kw| def_kw == parent.kind()) { |
42 | return None; | 42 | return None; |
diff --git a/crates/ra_assists/src/handlers/generate_new.rs b/crates/ra_assists/src/handlers/generate_new.rs index 340f9b103..22b47d254 100644 --- a/crates/ra_assists/src/handlers/generate_new.rs +++ b/crates/ra_assists/src/handlers/generate_new.rs | |||
@@ -31,7 +31,7 @@ use crate::{AssistContext, AssistId, AssistKind, Assists}; | |||
31 | // | 31 | // |
32 | // ``` | 32 | // ``` |
33 | pub(crate) fn generate_new(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { | 33 | pub(crate) fn generate_new(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { |
34 | let strukt = ctx.find_node_at_offset::<ast::StructDef>()?; | 34 | let strukt = ctx.find_node_at_offset::<ast::Struct>()?; |
35 | 35 | ||
36 | // We want to only apply this to non-union structs with named fields | 36 | // We want to only apply this to non-union structs with named fields |
37 | let field_list = match strukt.kind() { | 37 | let field_list = match strukt.kind() { |
@@ -91,7 +91,7 @@ pub(crate) fn generate_new(acc: &mut Assists, ctx: &AssistContext) -> Option<()> | |||
91 | 91 | ||
92 | // Generates the surrounding `impl Type { <code> }` including type and lifetime | 92 | // Generates the surrounding `impl Type { <code> }` including type and lifetime |
93 | // parameters | 93 | // parameters |
94 | fn generate_impl_text(strukt: &ast::StructDef, code: &str) -> String { | 94 | fn generate_impl_text(strukt: &ast::Struct, code: &str) -> String { |
95 | let type_params = strukt.generic_param_list(); | 95 | let type_params = strukt.generic_param_list(); |
96 | let mut buf = String::with_capacity(code.len()); | 96 | let mut buf = String::with_capacity(code.len()); |
97 | buf.push_str("\n\nimpl"); | 97 | buf.push_str("\n\nimpl"); |
@@ -122,7 +122,7 @@ fn generate_impl_text(strukt: &ast::StructDef, code: &str) -> String { | |||
122 | // | 122 | // |
123 | // FIXME: change the new fn checking to a more semantic approach when that's more | 123 | // FIXME: change the new fn checking to a more semantic approach when that's more |
124 | // viable (e.g. we process proc macros, etc) | 124 | // viable (e.g. we process proc macros, etc) |
125 | fn find_struct_impl(ctx: &AssistContext, strukt: &ast::StructDef) -> Option<Option<ast::ImplDef>> { | 125 | fn find_struct_impl(ctx: &AssistContext, strukt: &ast::Struct) -> Option<Option<ast::ImplDef>> { |
126 | let db = ctx.db(); | 126 | let db = ctx.db(); |
127 | let module = strukt.syntax().ancestors().find(|node| { | 127 | let module = strukt.syntax().ancestors().find(|node| { |
128 | ast::Module::can_cast(node.kind()) || ast::SourceFile::can_cast(node.kind()) | 128 | ast::Module::can_cast(node.kind()) || ast::SourceFile::can_cast(node.kind()) |
diff --git a/crates/ra_assists/src/handlers/move_bounds.rs b/crates/ra_assists/src/handlers/move_bounds.rs index 15327facb..3b82477c5 100644 --- a/crates/ra_assists/src/handlers/move_bounds.rs +++ b/crates/ra_assists/src/handlers/move_bounds.rs | |||
@@ -41,7 +41,7 @@ pub(crate) fn move_bounds_to_where_clause(acc: &mut Assists, ctx: &AssistContext | |||
41 | ast::TraitDef(it) => it.assoc_item_list()?.syntax().clone().into(), | 41 | ast::TraitDef(it) => it.assoc_item_list()?.syntax().clone().into(), |
42 | ast::ImplDef(it) => it.assoc_item_list()?.syntax().clone().into(), | 42 | ast::ImplDef(it) => it.assoc_item_list()?.syntax().clone().into(), |
43 | ast::EnumDef(it) => it.variant_list()?.syntax().clone().into(), | 43 | ast::EnumDef(it) => it.variant_list()?.syntax().clone().into(), |
44 | ast::StructDef(it) => { | 44 | ast::Struct(it) => { |
45 | it.syntax().children_with_tokens() | 45 | it.syntax().children_with_tokens() |
46 | .find(|it| it.kind() == RECORD_FIELD_LIST || it.kind() == T![;])? | 46 | .find(|it| it.kind() == RECORD_FIELD_LIST || it.kind() == T![;])? |
47 | }, | 47 | }, |
diff --git a/crates/ra_hir/src/has_source.rs b/crates/ra_hir/src/has_source.rs index 3a3d82109..811a12e00 100644 --- a/crates/ra_hir/src/has_source.rs +++ b/crates/ra_hir/src/has_source.rs | |||
@@ -57,8 +57,8 @@ impl HasSource for Field { | |||
57 | } | 57 | } |
58 | } | 58 | } |
59 | impl HasSource for Struct { | 59 | impl HasSource for Struct { |
60 | type Ast = ast::StructDef; | 60 | type Ast = ast::Struct; |
61 | fn source(self, db: &dyn HirDatabase) -> InFile<ast::StructDef> { | 61 | fn source(self, db: &dyn HirDatabase) -> InFile<ast::Struct> { |
62 | self.id.lookup(db.upcast()).source(db.upcast()) | 62 | self.id.lookup(db.upcast()).source(db.upcast()) |
63 | } | 63 | } |
64 | } | 64 | } |
diff --git a/crates/ra_hir/src/semantics.rs b/crates/ra_hir/src/semantics.rs index 6c8775402..7df018b05 100644 --- a/crates/ra_hir/src/semantics.rs +++ b/crates/ra_hir/src/semantics.rs | |||
@@ -580,7 +580,7 @@ macro_rules! to_def_impls { | |||
580 | 580 | ||
581 | to_def_impls![ | 581 | to_def_impls![ |
582 | (crate::Module, ast::Module, module_to_def), | 582 | (crate::Module, ast::Module, module_to_def), |
583 | (crate::Struct, ast::StructDef, struct_to_def), | 583 | (crate::Struct, ast::Struct, struct_to_def), |
584 | (crate::Enum, ast::EnumDef, enum_to_def), | 584 | (crate::Enum, ast::EnumDef, enum_to_def), |
585 | (crate::Union, ast::Union, union_to_def), | 585 | (crate::Union, ast::Union, union_to_def), |
586 | (crate::Trait, ast::TraitDef, trait_to_def), | 586 | (crate::Trait, ast::TraitDef, trait_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 0093a8671..75b773352 100644 --- a/crates/ra_hir/src/semantics/source_to_def.rs +++ b/crates/ra_hir/src/semantics/source_to_def.rs | |||
@@ -74,7 +74,7 @@ impl SourceToDefCtx<'_, '_> { | |||
74 | pub(super) fn fn_to_def(&mut self, src: InFile<ast::Fn>) -> Option<FunctionId> { | 74 | pub(super) fn fn_to_def(&mut self, src: InFile<ast::Fn>) -> Option<FunctionId> { |
75 | self.to_def(src, keys::FUNCTION) | 75 | self.to_def(src, keys::FUNCTION) |
76 | } | 76 | } |
77 | pub(super) fn struct_to_def(&mut self, src: InFile<ast::StructDef>) -> Option<StructId> { | 77 | pub(super) fn struct_to_def(&mut self, src: InFile<ast::Struct>) -> Option<StructId> { |
78 | self.to_def(src, keys::STRUCT) | 78 | self.to_def(src, keys::STRUCT) |
79 | } | 79 | } |
80 | pub(super) fn enum_to_def(&mut self, src: InFile<ast::EnumDef>) -> Option<EnumId> { | 80 | pub(super) fn enum_to_def(&mut self, src: InFile<ast::EnumDef>) -> Option<EnumId> { |
@@ -166,7 +166,7 @@ impl SourceToDefCtx<'_, '_> { | |||
166 | let def = self.fn_to_def(container.with_value(it))?; | 166 | let def = self.fn_to_def(container.with_value(it))?; |
167 | DefWithBodyId::from(def).into() | 167 | DefWithBodyId::from(def).into() |
168 | }, | 168 | }, |
169 | ast::StructDef(it) => { | 169 | ast::Struct(it) => { |
170 | let def = self.struct_to_def(container.with_value(it))?; | 170 | let def = self.struct_to_def(container.with_value(it))?; |
171 | VariantId::from(def).into() | 171 | VariantId::from(def).into() |
172 | }, | 172 | }, |
@@ -205,7 +205,7 @@ impl SourceToDefCtx<'_, '_> { | |||
205 | let res: GenericDefId = match_ast! { | 205 | let res: GenericDefId = match_ast! { |
206 | match (container.value) { | 206 | match (container.value) { |
207 | ast::Fn(it) => self.fn_to_def(container.with_value(it))?.into(), | 207 | ast::Fn(it) => self.fn_to_def(container.with_value(it))?.into(), |
208 | ast::StructDef(it) => self.struct_to_def(container.with_value(it))?.into(), | 208 | ast::Struct(it) => self.struct_to_def(container.with_value(it))?.into(), |
209 | ast::EnumDef(it) => self.enum_to_def(container.with_value(it))?.into(), | 209 | ast::EnumDef(it) => self.enum_to_def(container.with_value(it))?.into(), |
210 | ast::TraitDef(it) => self.trait_to_def(container.with_value(it))?.into(), | 210 | ast::TraitDef(it) => self.trait_to_def(container.with_value(it))?.into(), |
211 | ast::TypeAlias(it) => self.type_alias_to_def(container.with_value(it))?.into(), | 211 | ast::TypeAlias(it) => self.type_alias_to_def(container.with_value(it))?.into(), |
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index d8963f63f..840841d87 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs | |||
@@ -652,7 +652,7 @@ impl ExprCollector<'_> { | |||
652 | let id = self.find_inner_item(&def)?; | 652 | let id = self.find_inner_item(&def)?; |
653 | (StaticLoc { container, id }.intern(self.db).into(), def.name()) | 653 | (StaticLoc { container, id }.intern(self.db).into(), def.name()) |
654 | } | 654 | } |
655 | ast::Item::StructDef(def) => { | 655 | ast::Item::Struct(def) => { |
656 | let id = self.find_inner_item(&def)?; | 656 | let id = self.find_inner_item(&def)?; |
657 | (StructLoc { container, id }.intern(self.db).into(), def.name()) | 657 | (StructLoc { container, id }.intern(self.db).into(), def.name()) |
658 | } | 658 | } |
diff --git a/crates/ra_hir_def/src/item_tree.rs b/crates/ra_hir_def/src/item_tree.rs index 7bcc13b06..6b96a4c20 100644 --- a/crates/ra_hir_def/src/item_tree.rs +++ b/crates/ra_hir_def/src/item_tree.rs | |||
@@ -414,7 +414,7 @@ mod_items! { | |||
414 | Import in imports -> ast::Use, | 414 | Import in imports -> ast::Use, |
415 | ExternCrate in extern_crates -> ast::ExternCrate, | 415 | ExternCrate in extern_crates -> ast::ExternCrate, |
416 | Function in functions -> ast::Fn, | 416 | Function in functions -> ast::Fn, |
417 | Struct in structs -> ast::StructDef, | 417 | Struct in structs -> ast::Struct, |
418 | Union in unions -> ast::Union, | 418 | Union in unions -> ast::Union, |
419 | Enum in enums -> ast::EnumDef, | 419 | Enum in enums -> ast::EnumDef, |
420 | Const in consts -> ast::ConstDef, | 420 | Const in consts -> ast::ConstDef, |
@@ -514,7 +514,7 @@ pub struct Struct { | |||
514 | pub visibility: RawVisibilityId, | 514 | pub visibility: RawVisibilityId, |
515 | pub generic_params: GenericParamsId, | 515 | pub generic_params: GenericParamsId, |
516 | pub fields: Fields, | 516 | pub fields: Fields, |
517 | pub ast_id: FileAstId<ast::StructDef>, | 517 | pub ast_id: FileAstId<ast::Struct>, |
518 | pub kind: StructDefKind, | 518 | pub kind: StructDefKind, |
519 | } | 519 | } |
520 | 520 | ||
diff --git a/crates/ra_hir_def/src/item_tree/lower.rs b/crates/ra_hir_def/src/item_tree/lower.rs index 2721a02a5..a85618015 100644 --- a/crates/ra_hir_def/src/item_tree/lower.rs +++ b/crates/ra_hir_def/src/item_tree/lower.rs | |||
@@ -78,7 +78,7 @@ impl Ctx { | |||
78 | 78 | ||
79 | // Collect inner items for 1-to-1-lowered items. | 79 | // Collect inner items for 1-to-1-lowered items. |
80 | match item { | 80 | match item { |
81 | ast::Item::StructDef(_) | 81 | ast::Item::Struct(_) |
82 | | ast::Item::Union(_) | 82 | | ast::Item::Union(_) |
83 | | ast::Item::EnumDef(_) | 83 | | ast::Item::EnumDef(_) |
84 | | ast::Item::Fn(_) | 84 | | ast::Item::Fn(_) |
@@ -103,7 +103,7 @@ impl Ctx { | |||
103 | 103 | ||
104 | let attrs = Attrs::new(item, &self.hygiene); | 104 | let attrs = Attrs::new(item, &self.hygiene); |
105 | let items = match item { | 105 | let items = match item { |
106 | ast::Item::StructDef(ast) => self.lower_struct(ast).map(Into::into), | 106 | ast::Item::Struct(ast) => self.lower_struct(ast).map(Into::into), |
107 | ast::Item::Union(ast) => self.lower_union(ast).map(Into::into), | 107 | ast::Item::Union(ast) => self.lower_union(ast).map(Into::into), |
108 | ast::Item::EnumDef(ast) => self.lower_enum(ast).map(Into::into), | 108 | ast::Item::EnumDef(ast) => self.lower_enum(ast).map(Into::into), |
109 | ast::Item::Fn(ast) => self.lower_function(ast).map(Into::into), | 109 | ast::Item::Fn(ast) => self.lower_function(ast).map(Into::into), |
@@ -165,7 +165,7 @@ impl Ctx { | |||
165 | } | 165 | } |
166 | } | 166 | } |
167 | 167 | ||
168 | fn lower_struct(&mut self, strukt: &ast::StructDef) -> Option<FileItemTreeId<Struct>> { | 168 | fn lower_struct(&mut self, strukt: &ast::Struct) -> Option<FileItemTreeId<Struct>> { |
169 | let visibility = self.lower_visibility(strukt); | 169 | let visibility = self.lower_visibility(strukt); |
170 | let name = strukt.name()?.as_name(); | 170 | let name = strukt.name()?.as_name(); |
171 | let generic_params = self.lower_generic_params(GenericsOwner::Struct, strukt); | 171 | let generic_params = self.lower_generic_params(GenericsOwner::Struct, strukt); |
diff --git a/crates/ra_hir_def/src/item_tree/tests.rs b/crates/ra_hir_def/src/item_tree/tests.rs index 0be021948..db37223da 100644 --- a/crates/ra_hir_def/src/item_tree/tests.rs +++ b/crates/ra_hir_def/src/item_tree/tests.rs | |||
@@ -244,11 +244,11 @@ fn smoke() { | |||
244 | > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_dfl_method"))] }, input: None }]) }] | 244 | > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_dfl_method"))] }, input: None }]) }] |
245 | > Function { name: Name(Text("dfl_method")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: true, is_unsafe: false, params: [Reference(Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Self"))] }, generic_args: [None] }), Mut)], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Fn>(11) } | 245 | > Function { name: Name(Text("dfl_method")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: true, is_unsafe: false, params: [Reference(Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Self"))] }, generic_args: [None] }), Mut)], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Fn>(11) } |
246 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct0"))] }, input: None }]) }] | 246 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct0"))] }, input: None }]) }] |
247 | Struct { name: Name(Text("Struct0")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(1), fields: Unit, ast_id: FileAstId::<ra_syntax::ast::generated::nodes::StructDef>(3), kind: Unit } | 247 | Struct { name: Name(Text("Struct0")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(1), fields: Unit, ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Struct>(3), kind: Unit } |
248 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct1"))] }, input: None }]) }] | 248 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct1"))] }, input: None }]) }] |
249 | Struct { name: Name(Text("Struct1")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(2), fields: Tuple(IdRange::<ra_hir_def::item_tree::Field>(0..1)), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::StructDef>(4), kind: Tuple } | 249 | Struct { name: Name(Text("Struct1")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(2), fields: Tuple(IdRange::<ra_hir_def::item_tree::Field>(0..1)), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Struct>(4), kind: Tuple } |
250 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct2"))] }, input: None }]) }] | 250 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct2"))] }, input: None }]) }] |
251 | Struct { name: Name(Text("Struct2")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(3), fields: Record(IdRange::<ra_hir_def::item_tree::Field>(1..2)), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::StructDef>(5), kind: Record } | 251 | Struct { name: Name(Text("Struct2")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(3), fields: Record(IdRange::<ra_hir_def::item_tree::Field>(1..2)), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Struct>(5), kind: Record } |
252 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("en"))] }, input: None }]) }] | 252 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("en"))] }, input: None }]) }] |
253 | Enum { name: Name(Text("En")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), variants: IdRange::<ra_hir_def::item_tree::Variant>(0..1), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::EnumDef>(6) } | 253 | Enum { name: Name(Text("En")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), variants: IdRange::<ra_hir_def::item_tree::Variant>(0..1), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::EnumDef>(6) } |
254 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("un"))] }, input: None }]) }] | 254 | #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("un"))] }, input: None }]) }] |
diff --git a/crates/ra_hir_def/src/keys.rs b/crates/ra_hir_def/src/keys.rs index 2282aed14..d9ec0f305 100644 --- a/crates/ra_hir_def/src/keys.rs +++ b/crates/ra_hir_def/src/keys.rs | |||
@@ -20,7 +20,7 @@ pub const STATIC: Key<ast::StaticDef, StaticId> = Key::new(); | |||
20 | pub const TYPE_ALIAS: Key<ast::TypeAlias, TypeAliasId> = Key::new(); | 20 | pub const TYPE_ALIAS: Key<ast::TypeAlias, TypeAliasId> = Key::new(); |
21 | pub const IMPL: Key<ast::ImplDef, ImplId> = Key::new(); | 21 | pub const IMPL: Key<ast::ImplDef, ImplId> = Key::new(); |
22 | pub const TRAIT: Key<ast::TraitDef, TraitId> = Key::new(); | 22 | pub const TRAIT: Key<ast::TraitDef, TraitId> = Key::new(); |
23 | pub const STRUCT: Key<ast::StructDef, StructId> = Key::new(); | 23 | pub const STRUCT: Key<ast::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::EnumDef, EnumId> = Key::new(); | 25 | pub const ENUM: Key<ast::EnumDef, EnumId> = Key::new(); |
26 | 26 | ||
diff --git a/crates/ra_hir_expand/src/builtin_derive.rs b/crates/ra_hir_expand/src/builtin_derive.rs index ef3508494..489ec0513 100644 --- a/crates/ra_hir_expand/src/builtin_derive.rs +++ b/crates/ra_hir_expand/src/builtin_derive.rs | |||
@@ -72,7 +72,7 @@ fn parse_adt(tt: &tt::Subtree) -> Result<BasicAdtInfo, mbe::ExpandError> { | |||
72 | let node = item.syntax(); | 72 | let node = item.syntax(); |
73 | let (name, params) = match_ast! { | 73 | let (name, params) = match_ast! { |
74 | match node { | 74 | match node { |
75 | ast::StructDef(it) => (it.name(), it.generic_param_list()), | 75 | ast::Struct(it) => (it.name(), it.generic_param_list()), |
76 | ast::EnumDef(it) => (it.name(), it.generic_param_list()), | 76 | ast::EnumDef(it) => (it.name(), it.generic_param_list()), |
77 | ast::Union(it) => (it.name(), it.generic_param_list()), | 77 | ast::Union(it) => (it.name(), it.generic_param_list()), |
78 | _ => { | 78 | _ => { |
diff --git a/crates/ra_ide/src/display/navigation_target.rs b/crates/ra_ide/src/display/navigation_target.rs index 797d2d8e3..5686faaab 100644 --- a/crates/ra_ide/src/display/navigation_target.rs +++ b/crates/ra_ide/src/display/navigation_target.rs | |||
@@ -380,7 +380,7 @@ pub(crate) fn docs_from_symbol(db: &RootDatabase, symbol: &FileSymbol) -> Option | |||
380 | match_ast! { | 380 | match_ast! { |
381 | match node { | 381 | match node { |
382 | ast::Fn(it) => it.doc_comment_text(), | 382 | ast::Fn(it) => it.doc_comment_text(), |
383 | ast::StructDef(it) => it.doc_comment_text(), | 383 | ast::Struct(it) => it.doc_comment_text(), |
384 | ast::EnumDef(it) => it.doc_comment_text(), | 384 | ast::EnumDef(it) => it.doc_comment_text(), |
385 | ast::TraitDef(it) => it.doc_comment_text(), | 385 | ast::TraitDef(it) => it.doc_comment_text(), |
386 | ast::Module(it) => it.doc_comment_text(), | 386 | ast::Module(it) => it.doc_comment_text(), |
@@ -405,7 +405,7 @@ pub(crate) fn description_from_symbol(db: &RootDatabase, symbol: &FileSymbol) -> | |||
405 | match_ast! { | 405 | match_ast! { |
406 | match node { | 406 | match node { |
407 | ast::Fn(it) => it.short_label(), | 407 | ast::Fn(it) => it.short_label(), |
408 | ast::StructDef(it) => it.short_label(), | 408 | ast::Struct(it) => it.short_label(), |
409 | ast::EnumDef(it) => it.short_label(), | 409 | ast::EnumDef(it) => it.short_label(), |
410 | ast::TraitDef(it) => it.short_label(), | 410 | ast::TraitDef(it) => it.short_label(), |
411 | ast::Module(it) => it.short_label(), | 411 | ast::Module(it) => it.short_label(), |
diff --git a/crates/ra_ide/src/display/short_label.rs b/crates/ra_ide/src/display/short_label.rs index 730df1414..504b884c5 100644 --- a/crates/ra_ide/src/display/short_label.rs +++ b/crates/ra_ide/src/display/short_label.rs | |||
@@ -13,7 +13,7 @@ impl ShortLabel for ast::Fn { | |||
13 | } | 13 | } |
14 | } | 14 | } |
15 | 15 | ||
16 | impl ShortLabel for ast::StructDef { | 16 | impl ShortLabel for ast::Struct { |
17 | fn short_label(&self) -> Option<String> { | 17 | fn short_label(&self) -> Option<String> { |
18 | short_label_from_node(self, "struct ") | 18 | short_label_from_node(self, "struct ") |
19 | } | 19 | } |
diff --git a/crates/ra_ide/src/file_structure.rs b/crates/ra_ide/src/file_structure.rs index 874cf72ef..6f198fcbc 100644 --- a/crates/ra_ide/src/file_structure.rs +++ b/crates/ra_ide/src/file_structure.rs | |||
@@ -126,7 +126,7 @@ fn structure_node(node: &SyntaxNode) -> Option<StructureNode> { | |||
126 | 126 | ||
127 | decl_with_detail(it, Some(detail)) | 127 | decl_with_detail(it, Some(detail)) |
128 | }, | 128 | }, |
129 | ast::StructDef(it) => decl(it), | 129 | ast::Struct(it) => decl(it), |
130 | ast::Union(it) => decl(it), | 130 | ast::Union(it) => decl(it), |
131 | ast::EnumDef(it) => decl(it), | 131 | ast::EnumDef(it) => decl(it), |
132 | ast::EnumVariant(it) => decl(it), | 132 | ast::EnumVariant(it) => decl(it), |
@@ -238,7 +238,7 @@ fn very_obsolete() {} | |||
238 | label: "Foo", | 238 | label: "Foo", |
239 | navigation_range: 8..11, | 239 | navigation_range: 8..11, |
240 | node_range: 1..26, | 240 | node_range: 1..26, |
241 | kind: STRUCT_DEF, | 241 | kind: STRUCT, |
242 | detail: None, | 242 | detail: None, |
243 | deprecated: false, | 243 | deprecated: false, |
244 | }, | 244 | }, |
diff --git a/crates/ra_ide/src/goto_implementation.rs b/crates/ra_ide/src/goto_implementation.rs index e41a4a12b..699fad57d 100644 --- a/crates/ra_ide/src/goto_implementation.rs +++ b/crates/ra_ide/src/goto_implementation.rs | |||
@@ -44,7 +44,7 @@ fn impls_for_def( | |||
44 | krate: Crate, | 44 | krate: Crate, |
45 | ) -> Option<Vec<NavigationTarget>> { | 45 | ) -> Option<Vec<NavigationTarget>> { |
46 | let ty = match node { | 46 | let ty = match node { |
47 | ast::AdtDef::StructDef(def) => sema.to_def(def)?.ty(sema.db), | 47 | ast::AdtDef::Struct(def) => sema.to_def(def)?.ty(sema.db), |
48 | ast::AdtDef::EnumDef(def) => sema.to_def(def)?.ty(sema.db), | 48 | ast::AdtDef::EnumDef(def) => sema.to_def(def)?.ty(sema.db), |
49 | ast::AdtDef::Union(def) => sema.to_def(def)?.ty(sema.db), | 49 | ast::AdtDef::Union(def) => sema.to_def(def)?.ty(sema.db), |
50 | }; | 50 | }; |
diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs index 4ef7efd26..83228af2e 100644 --- a/crates/ra_ide/src/hover.rs +++ b/crates/ra_ide/src/hover.rs | |||
@@ -1443,7 +1443,7 @@ fn main() { let s<|>t = S{ f1:0 }; } | |||
1443 | 7..8, | 1443 | 7..8, |
1444 | ), | 1444 | ), |
1445 | name: "S", | 1445 | name: "S", |
1446 | kind: STRUCT_DEF, | 1446 | kind: STRUCT, |
1447 | container_name: None, | 1447 | container_name: None, |
1448 | description: Some( | 1448 | description: Some( |
1449 | "struct S", | 1449 | "struct S", |
@@ -1482,7 +1482,7 @@ fn main() { let s<|>t = S{ f1:Arg(0) }; } | |||
1482 | 24..25, | 1482 | 24..25, |
1483 | ), | 1483 | ), |
1484 | name: "S", | 1484 | name: "S", |
1485 | kind: STRUCT_DEF, | 1485 | kind: STRUCT, |
1486 | container_name: None, | 1486 | container_name: None, |
1487 | description: Some( | 1487 | description: Some( |
1488 | "struct S", | 1488 | "struct S", |
@@ -1501,7 +1501,7 @@ fn main() { let s<|>t = S{ f1:Arg(0) }; } | |||
1501 | 7..10, | 1501 | 7..10, |
1502 | ), | 1502 | ), |
1503 | name: "Arg", | 1503 | name: "Arg", |
1504 | kind: STRUCT_DEF, | 1504 | kind: STRUCT, |
1505 | container_name: None, | 1505 | container_name: None, |
1506 | description: Some( | 1506 | description: Some( |
1507 | "struct Arg", | 1507 | "struct Arg", |
@@ -1540,7 +1540,7 @@ fn main() { let s<|>t = S{ f1: S{ f1: Arg(0) } }; } | |||
1540 | 24..25, | 1540 | 24..25, |
1541 | ), | 1541 | ), |
1542 | name: "S", | 1542 | name: "S", |
1543 | kind: STRUCT_DEF, | 1543 | kind: STRUCT, |
1544 | container_name: None, | 1544 | container_name: None, |
1545 | description: Some( | 1545 | description: Some( |
1546 | "struct S", | 1546 | "struct S", |
@@ -1559,7 +1559,7 @@ fn main() { let s<|>t = S{ f1: S{ f1: Arg(0) } }; } | |||
1559 | 7..10, | 1559 | 7..10, |
1560 | ), | 1560 | ), |
1561 | name: "Arg", | 1561 | name: "Arg", |
1562 | kind: STRUCT_DEF, | 1562 | kind: STRUCT, |
1563 | container_name: None, | 1563 | container_name: None, |
1564 | description: Some( | 1564 | description: Some( |
1565 | "struct Arg", | 1565 | "struct Arg", |
@@ -1601,7 +1601,7 @@ fn main() { let s<|>t = (A(1), B(2), M::C(3) ); } | |||
1601 | 7..8, | 1601 | 7..8, |
1602 | ), | 1602 | ), |
1603 | name: "A", | 1603 | name: "A", |
1604 | kind: STRUCT_DEF, | 1604 | kind: STRUCT, |
1605 | container_name: None, | 1605 | container_name: None, |
1606 | description: Some( | 1606 | description: Some( |
1607 | "struct A", | 1607 | "struct A", |
@@ -1620,7 +1620,7 @@ fn main() { let s<|>t = (A(1), B(2), M::C(3) ); } | |||
1620 | 22..23, | 1620 | 22..23, |
1621 | ), | 1621 | ), |
1622 | name: "B", | 1622 | name: "B", |
1623 | kind: STRUCT_DEF, | 1623 | kind: STRUCT, |
1624 | container_name: None, | 1624 | container_name: None, |
1625 | description: Some( | 1625 | description: Some( |
1626 | "struct B", | 1626 | "struct B", |
@@ -1639,7 +1639,7 @@ fn main() { let s<|>t = (A(1), B(2), M::C(3) ); } | |||
1639 | 53..54, | 1639 | 53..54, |
1640 | ), | 1640 | ), |
1641 | name: "C", | 1641 | name: "C", |
1642 | kind: STRUCT_DEF, | 1642 | kind: STRUCT, |
1643 | container_name: None, | 1643 | container_name: None, |
1644 | description: Some( | 1644 | description: Some( |
1645 | "pub struct C", | 1645 | "pub struct C", |
@@ -1737,7 +1737,7 @@ fn main() { let s<|>t = foo(); } | |||
1737 | 23..24, | 1737 | 23..24, |
1738 | ), | 1738 | ), |
1739 | name: "S", | 1739 | name: "S", |
1740 | kind: STRUCT_DEF, | 1740 | kind: STRUCT, |
1741 | container_name: None, | 1741 | container_name: None, |
1742 | description: Some( | 1742 | description: Some( |
1743 | "struct S", | 1743 | "struct S", |
@@ -1877,7 +1877,7 @@ fn main() { let s<|>t = foo(); } | |||
1877 | 39..41, | 1877 | 39..41, |
1878 | ), | 1878 | ), |
1879 | name: "S1", | 1879 | name: "S1", |
1880 | kind: STRUCT_DEF, | 1880 | kind: STRUCT, |
1881 | container_name: None, | 1881 | container_name: None, |
1882 | description: Some( | 1882 | description: Some( |
1883 | "struct S1", | 1883 | "struct S1", |
@@ -1896,7 +1896,7 @@ fn main() { let s<|>t = foo(); } | |||
1896 | 52..54, | 1896 | 52..54, |
1897 | ), | 1897 | ), |
1898 | name: "S2", | 1898 | name: "S2", |
1899 | kind: STRUCT_DEF, | 1899 | kind: STRUCT, |
1900 | container_name: None, | 1900 | container_name: None, |
1901 | description: Some( | 1901 | description: Some( |
1902 | "struct S2", | 1902 | "struct S2", |
@@ -2011,7 +2011,7 @@ fn foo(ar<|>g: &impl Foo + Bar<S>) {} | |||
2011 | 36..37, | 2011 | 36..37, |
2012 | ), | 2012 | ), |
2013 | name: "S", | 2013 | name: "S", |
2014 | kind: STRUCT_DEF, | 2014 | kind: STRUCT, |
2015 | container_name: None, | 2015 | container_name: None, |
2016 | description: Some( | 2016 | description: Some( |
2017 | "struct S", | 2017 | "struct S", |
@@ -2068,7 +2068,7 @@ fn foo(ar<|>g: &impl Foo<S>) {} | |||
2068 | 23..24, | 2068 | 23..24, |
2069 | ), | 2069 | ), |
2070 | name: "S", | 2070 | name: "S", |
2071 | kind: STRUCT_DEF, | 2071 | kind: STRUCT, |
2072 | container_name: None, | 2072 | container_name: None, |
2073 | description: Some( | 2073 | description: Some( |
2074 | "struct S", | 2074 | "struct S", |
@@ -2111,7 +2111,7 @@ fn main() { let s<|>t = foo(); } | |||
2111 | 49..50, | 2111 | 49..50, |
2112 | ), | 2112 | ), |
2113 | name: "B", | 2113 | name: "B", |
2114 | kind: STRUCT_DEF, | 2114 | kind: STRUCT, |
2115 | container_name: None, | 2115 | container_name: None, |
2116 | description: Some( | 2116 | description: Some( |
2117 | "struct B", | 2117 | "struct B", |
@@ -2224,7 +2224,7 @@ fn foo(ar<|>g: &dyn Foo<S>) {} | |||
2224 | 23..24, | 2224 | 23..24, |
2225 | ), | 2225 | ), |
2226 | name: "S", | 2226 | name: "S", |
2227 | kind: STRUCT_DEF, | 2227 | kind: STRUCT, |
2228 | container_name: None, | 2228 | container_name: None, |
2229 | description: Some( | 2229 | description: Some( |
2230 | "struct S", | 2230 | "struct S", |
@@ -2284,7 +2284,7 @@ fn foo(a<|>rg: &impl ImplTrait<B<dyn DynTrait<B<S>>>>) {} | |||
2284 | 50..51, | 2284 | 50..51, |
2285 | ), | 2285 | ), |
2286 | name: "B", | 2286 | name: "B", |
2287 | kind: STRUCT_DEF, | 2287 | kind: STRUCT, |
2288 | container_name: None, | 2288 | container_name: None, |
2289 | description: Some( | 2289 | description: Some( |
2290 | "struct B", | 2290 | "struct B", |
@@ -2322,7 +2322,7 @@ fn foo(a<|>rg: &impl ImplTrait<B<dyn DynTrait<B<S>>>>) {} | |||
2322 | 65..66, | 2322 | 65..66, |
2323 | ), | 2323 | ), |
2324 | name: "S", | 2324 | name: "S", |
2325 | kind: STRUCT_DEF, | 2325 | kind: STRUCT, |
2326 | container_name: None, | 2326 | container_name: None, |
2327 | description: Some( | 2327 | description: Some( |
2328 | "struct S", | 2328 | "struct S", |
diff --git a/crates/ra_ide/src/references.rs b/crates/ra_ide/src/references.rs index d61ac271e..2a62dab6c 100644 --- a/crates/ra_ide/src/references.rs +++ b/crates/ra_ide/src/references.rs | |||
@@ -172,7 +172,7 @@ fn get_struct_def_name_for_struct_literal_search( | |||
172 | if let Some(name) = | 172 | if let Some(name) = |
173 | sema.find_node_at_offset_with_descend::<ast::Name>(&syntax, left.text_range().start()) | 173 | sema.find_node_at_offset_with_descend::<ast::Name>(&syntax, left.text_range().start()) |
174 | { | 174 | { |
175 | return name.syntax().ancestors().find_map(ast::StructDef::cast).and_then(|l| l.name()); | 175 | return name.syntax().ancestors().find_map(ast::Struct::cast).and_then(|l| l.name()); |
176 | } | 176 | } |
177 | if sema | 177 | if sema |
178 | .find_node_at_offset_with_descend::<ast::GenericParamList>( | 178 | .find_node_at_offset_with_descend::<ast::GenericParamList>( |
@@ -181,7 +181,7 @@ fn get_struct_def_name_for_struct_literal_search( | |||
181 | ) | 181 | ) |
182 | .is_some() | 182 | .is_some() |
183 | { | 183 | { |
184 | return left.ancestors().find_map(ast::StructDef::cast).and_then(|l| l.name()); | 184 | return left.ancestors().find_map(ast::Struct::cast).and_then(|l| l.name()); |
185 | } | 185 | } |
186 | } | 186 | } |
187 | None | 187 | None |
@@ -212,7 +212,7 @@ fn main() { | |||
212 | ); | 212 | ); |
213 | check_result( | 213 | check_result( |
214 | refs, | 214 | refs, |
215 | "Foo STRUCT_DEF FileId(1) 0..26 7..10 Other", | 215 | "Foo STRUCT FileId(1) 0..26 7..10 Other", |
216 | &["FileId(1) 101..104 StructLiteral"], | 216 | &["FileId(1) 101..104 StructLiteral"], |
217 | ); | 217 | ); |
218 | } | 218 | } |
@@ -230,7 +230,7 @@ struct Foo<|> {} | |||
230 | ); | 230 | ); |
231 | check_result( | 231 | check_result( |
232 | refs, | 232 | refs, |
233 | "Foo STRUCT_DEF FileId(1) 0..13 7..10 Other", | 233 | "Foo STRUCT FileId(1) 0..13 7..10 Other", |
234 | &["FileId(1) 41..44 Other", "FileId(1) 54..57 StructLiteral"], | 234 | &["FileId(1) 41..44 Other", "FileId(1) 54..57 StructLiteral"], |
235 | ); | 235 | ); |
236 | } | 236 | } |
@@ -248,7 +248,7 @@ struct Foo<T> <|>{} | |||
248 | ); | 248 | ); |
249 | check_result( | 249 | check_result( |
250 | refs, | 250 | refs, |
251 | "Foo STRUCT_DEF FileId(1) 0..16 7..10 Other", | 251 | "Foo STRUCT FileId(1) 0..16 7..10 Other", |
252 | &["FileId(1) 64..67 StructLiteral"], | 252 | &["FileId(1) 64..67 StructLiteral"], |
253 | ); | 253 | ); |
254 | } | 254 | } |
@@ -267,7 +267,7 @@ fn main() { | |||
267 | ); | 267 | ); |
268 | check_result( | 268 | check_result( |
269 | refs, | 269 | refs, |
270 | "Foo STRUCT_DEF FileId(1) 0..16 7..10 Other", | 270 | "Foo STRUCT FileId(1) 0..16 7..10 Other", |
271 | &["FileId(1) 54..57 StructLiteral"], | 271 | &["FileId(1) 54..57 StructLiteral"], |
272 | ); | 272 | ); |
273 | } | 273 | } |
@@ -431,7 +431,7 @@ fn f() { | |||
431 | let refs = analysis.find_all_refs(pos, None).unwrap().unwrap(); | 431 | let refs = analysis.find_all_refs(pos, None).unwrap().unwrap(); |
432 | check_result( | 432 | check_result( |
433 | refs, | 433 | refs, |
434 | "Foo STRUCT_DEF FileId(2) 17..51 28..31 Other", | 434 | "Foo STRUCT FileId(2) 17..51 28..31 Other", |
435 | &["FileId(1) 53..56 StructLiteral", "FileId(3) 79..82 StructLiteral"], | 435 | &["FileId(1) 53..56 StructLiteral", "FileId(3) 79..82 StructLiteral"], |
436 | ); | 436 | ); |
437 | } | 437 | } |
@@ -486,7 +486,7 @@ pub(super) struct Foo<|> { | |||
486 | let refs = analysis.find_all_refs(pos, None).unwrap().unwrap(); | 486 | let refs = analysis.find_all_refs(pos, None).unwrap().unwrap(); |
487 | check_result( | 487 | check_result( |
488 | refs, | 488 | refs, |
489 | "Foo STRUCT_DEF FileId(3) 0..41 18..21 Other", | 489 | "Foo STRUCT FileId(3) 0..41 18..21 Other", |
490 | &["FileId(2) 20..23 Other", "FileId(2) 47..50 StructLiteral"], | 490 | &["FileId(2) 20..23 Other", "FileId(2) 47..50 StructLiteral"], |
491 | ); | 491 | ); |
492 | } | 492 | } |
diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs index b0ab160ac..ba1fd6242 100644 --- a/crates/ra_ide/src/syntax_highlighting.rs +++ b/crates/ra_ide/src/syntax_highlighting.rs | |||
@@ -705,7 +705,7 @@ fn highlight_name_by_syntax(name: ast::Name) -> Highlight { | |||
705 | }; | 705 | }; |
706 | 706 | ||
707 | let tag = match parent.kind() { | 707 | let tag = match parent.kind() { |
708 | STRUCT_DEF => HighlightTag::Struct, | 708 | STRUCT => HighlightTag::Struct, |
709 | ENUM_DEF => HighlightTag::Enum, | 709 | ENUM_DEF => HighlightTag::Enum, |
710 | UNION => HighlightTag::Union, | 710 | UNION => HighlightTag::Union, |
711 | TRAIT_DEF => HighlightTag::Trait, | 711 | TRAIT_DEF => HighlightTag::Trait, |
diff --git a/crates/ra_ide_db/src/defs.rs b/crates/ra_ide_db/src/defs.rs index 11de05958..6a2180f6c 100644 --- a/crates/ra_ide_db/src/defs.rs +++ b/crates/ra_ide_db/src/defs.rs | |||
@@ -150,7 +150,7 @@ pub fn classify_name(sema: &Semantics<RootDatabase>, name: &ast::Name) -> Option | |||
150 | let def = sema.to_def(&it)?; | 150 | let def = sema.to_def(&it)?; |
151 | Some(NameClass::Definition(Definition::ModuleDef(def.into()))) | 151 | Some(NameClass::Definition(Definition::ModuleDef(def.into()))) |
152 | }, | 152 | }, |
153 | ast::StructDef(it) => { | 153 | ast::Struct(it) => { |
154 | let def: hir::Struct = sema.to_def(&it)?; | 154 | let def: hir::Struct = sema.to_def(&it)?; |
155 | Some(NameClass::Definition(Definition::ModuleDef(def.into()))) | 155 | Some(NameClass::Definition(Definition::ModuleDef(def.into()))) |
156 | }, | 156 | }, |
diff --git a/crates/ra_ide_db/src/symbol_index.rs b/crates/ra_ide_db/src/symbol_index.rs index b4e85b88e..da19f0f33 100644 --- a/crates/ra_ide_db/src/symbol_index.rs +++ b/crates/ra_ide_db/src/symbol_index.rs | |||
@@ -344,7 +344,7 @@ impl Query { | |||
344 | } | 344 | } |
345 | 345 | ||
346 | fn is_type(kind: SyntaxKind) -> bool { | 346 | fn is_type(kind: SyntaxKind) -> bool { |
347 | matches!(kind, STRUCT_DEF | ENUM_DEF | TRAIT_DEF | TYPE_ALIAS) | 347 | matches!(kind, STRUCT | ENUM_DEF | TRAIT_DEF | TYPE_ALIAS) |
348 | } | 348 | } |
349 | 349 | ||
350 | /// The actual data that is stored in the index. It should be as compact as | 350 | /// The actual data that is stored in the index. It should be as compact as |
@@ -398,7 +398,7 @@ fn to_symbol(node: &SyntaxNode) -> Option<(SmolStr, SyntaxNodePtr, TextRange)> { | |||
398 | match_ast! { | 398 | match_ast! { |
399 | match node { | 399 | match node { |
400 | ast::Fn(it) => decl(it), | 400 | ast::Fn(it) => decl(it), |
401 | ast::StructDef(it) => decl(it), | 401 | ast::Struct(it) => decl(it), |
402 | ast::EnumDef(it) => decl(it), | 402 | ast::EnumDef(it) => decl(it), |
403 | ast::TraitDef(it) => decl(it), | 403 | ast::TraitDef(it) => decl(it), |
404 | ast::Module(it) => decl(it), | 404 | ast::Module(it) => decl(it), |
diff --git a/crates/ra_mbe/src/syntax_bridge.rs b/crates/ra_mbe/src/syntax_bridge.rs index fc4133a67..5fc48507f 100644 --- a/crates/ra_mbe/src/syntax_bridge.rs +++ b/crates/ra_mbe/src/syntax_bridge.rs | |||
@@ -825,7 +825,7 @@ mod tests { | |||
825 | #[test] | 825 | #[test] |
826 | fn test_token_tree_multi_char_punct() { | 826 | fn test_token_tree_multi_char_punct() { |
827 | let source_file = ast::SourceFile::parse("struct Foo { a: x::Y }").ok().unwrap(); | 827 | let source_file = ast::SourceFile::parse("struct Foo { a: x::Y }").ok().unwrap(); |
828 | let struct_def = source_file.syntax().descendants().find_map(ast::StructDef::cast).unwrap(); | 828 | let struct_def = source_file.syntax().descendants().find_map(ast::Struct::cast).unwrap(); |
829 | let tt = ast_to_token_tree(&struct_def).unwrap().0; | 829 | let tt = ast_to_token_tree(&struct_def).unwrap().0; |
830 | token_tree_to_syntax_node(&tt, FragmentKind::Item).unwrap(); | 830 | token_tree_to_syntax_node(&tt, FragmentKind::Item).unwrap(); |
831 | } | 831 | } |
diff --git a/crates/ra_mbe/src/tests.rs b/crates/ra_mbe/src/tests.rs index d7b198458..21af06e73 100644 --- a/crates/ra_mbe/src/tests.rs +++ b/crates/ra_mbe/src/tests.rs | |||
@@ -490,7 +490,7 @@ fn test_expand_to_item_list() { | |||
490 | format!("{:#?}", tree).trim(), | 490 | format!("{:#?}", tree).trim(), |
491 | r#" | 491 | r#" |
492 | MACRO_ITEMS@0..40 | 492 | MACRO_ITEMS@0..40 |
493 | STRUCT_DEF@0..20 | 493 | STRUCT@0..20 |
494 | STRUCT_KW@0..6 "struct" | 494 | STRUCT_KW@0..6 "struct" |
495 | NAME@6..9 | 495 | NAME@6..9 |
496 | IDENT@6..9 "Foo" | 496 | IDENT@6..9 "Foo" |
@@ -506,7 +506,7 @@ MACRO_ITEMS@0..40 | |||
506 | NAME_REF@16..19 | 506 | NAME_REF@16..19 |
507 | IDENT@16..19 "u32" | 507 | IDENT@16..19 "u32" |
508 | R_CURLY@19..20 "}" | 508 | R_CURLY@19..20 "}" |
509 | STRUCT_DEF@20..40 | 509 | STRUCT@20..40 |
510 | STRUCT_KW@20..26 "struct" | 510 | STRUCT_KW@20..26 "struct" |
511 | NAME@26..29 | 511 | NAME@26..29 |
512 | IDENT@26..29 "Bar" | 512 | IDENT@26..29 "Bar" |
diff --git a/crates/ra_parser/src/grammar/items/adt.rs b/crates/ra_parser/src/grammar/items/adt.rs index ec06e2d45..2f5cfb6b6 100644 --- a/crates/ra_parser/src/grammar/items/adt.rs +++ b/crates/ra_parser/src/grammar/items/adt.rs | |||
@@ -5,7 +5,7 @@ use super::*; | |||
5 | pub(super) fn struct_def(p: &mut Parser, m: Marker) { | 5 | pub(super) fn struct_def(p: &mut Parser, m: Marker) { |
6 | assert!(p.at(T![struct])); | 6 | assert!(p.at(T![struct])); |
7 | p.bump(T![struct]); | 7 | p.bump(T![struct]); |
8 | struct_or_union(p, m, T![struct], STRUCT_DEF); | 8 | struct_or_union(p, m, T![struct], STRUCT); |
9 | } | 9 | } |
10 | 10 | ||
11 | pub(super) fn union_def(p: &mut Parser, m: Marker) { | 11 | pub(super) fn union_def(p: &mut Parser, m: Marker) { |
diff --git a/crates/ra_parser/src/syntax_kind/generated.rs b/crates/ra_parser/src/syntax_kind/generated.rs index 7efdeeac6..4fad765c7 100644 --- a/crates/ra_parser/src/syntax_kind/generated.rs +++ b/crates/ra_parser/src/syntax_kind/generated.rs | |||
@@ -1,7 +1,7 @@ | |||
1 | //! Generated file, do not edit by hand, see `xtask/src/codegen` | 1 | //! Generated file, do not edit by hand, see `xtask/src/codegen` |
2 | 2 | ||
3 | #![allow(bad_style, missing_docs, unreachable_pub)] | 3 | #![allow(bad_style, missing_docs, unreachable_pub)] |
4 | #[doc = r" The kind of syntax node, e.g. `IDENT`, `USE_KW`, or `STRUCT_DEF`."] | 4 | #[doc = r" The kind of syntax node, e.g. `IDENT`, `USE_KW`, or `STRUCT`."] |
5 | #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] | 5 | #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] |
6 | #[repr(u16)] | 6 | #[repr(u16)] |
7 | pub enum SyntaxKind { | 7 | pub enum SyntaxKind { |
@@ -123,7 +123,7 @@ pub enum SyntaxKind { | |||
123 | L_DOLLAR, | 123 | L_DOLLAR, |
124 | R_DOLLAR, | 124 | R_DOLLAR, |
125 | SOURCE_FILE, | 125 | SOURCE_FILE, |
126 | STRUCT_DEF, | 126 | STRUCT, |
127 | UNION, | 127 | UNION, |
128 | ENUM_DEF, | 128 | ENUM_DEF, |
129 | FN, | 129 | FN, |
diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs index 452e67c70..b69b6e85e 100644 --- a/crates/ra_syntax/src/ast.rs +++ b/crates/ra_syntax/src/ast.rs | |||
@@ -235,7 +235,7 @@ fn test_comments_preserve_trailing_whitespace() { | |||
235 | ) | 235 | ) |
236 | .ok() | 236 | .ok() |
237 | .unwrap(); | 237 | .unwrap(); |
238 | let def = file.syntax().descendants().find_map(StructDef::cast).unwrap(); | 238 | let def = file.syntax().descendants().find_map(Struct::cast).unwrap(); |
239 | assert_eq!( | 239 | assert_eq!( |
240 | "Representation of a Realm. \nIn the specification these are called Realm Records.", | 240 | "Representation of a Realm. \nIn the specification these are called Realm Records.", |
241 | def.doc_comment_text().unwrap() | 241 | def.doc_comment_text().unwrap() |
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index d153e8528..0fd3d4f1b 100644 --- a/crates/ra_syntax/src/ast/generated/nodes.rs +++ b/crates/ra_syntax/src/ast/generated/nodes.rs | |||
@@ -155,14 +155,14 @@ impl StaticDef { | |||
155 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } | 155 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
156 | } | 156 | } |
157 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 157 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
158 | pub struct StructDef { | 158 | pub struct Struct { |
159 | pub(crate) syntax: SyntaxNode, | 159 | pub(crate) syntax: SyntaxNode, |
160 | } | 160 | } |
161 | impl ast::AttrsOwner for StructDef {} | 161 | impl ast::AttrsOwner for Struct {} |
162 | impl ast::NameOwner for StructDef {} | 162 | impl ast::NameOwner for Struct {} |
163 | impl ast::VisibilityOwner for StructDef {} | 163 | impl ast::VisibilityOwner for Struct {} |
164 | impl ast::GenericParamsOwner for StructDef {} | 164 | impl ast::GenericParamsOwner for Struct {} |
165 | impl StructDef { | 165 | impl Struct { |
166 | pub fn struct_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![struct]) } | 166 | pub fn struct_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![struct]) } |
167 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } | 167 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
168 | pub fn field_list(&self) -> Option<FieldList> { support::child(&self.syntax) } | 168 | pub fn field_list(&self) -> Option<FieldList> { support::child(&self.syntax) } |
@@ -1281,7 +1281,7 @@ pub enum Item { | |||
1281 | MacroCall(MacroCall), | 1281 | MacroCall(MacroCall), |
1282 | Module(Module), | 1282 | Module(Module), |
1283 | StaticDef(StaticDef), | 1283 | StaticDef(StaticDef), |
1284 | StructDef(StructDef), | 1284 | Struct(Struct), |
1285 | TraitDef(TraitDef), | 1285 | TraitDef(TraitDef), |
1286 | TypeAlias(TypeAlias), | 1286 | TypeAlias(TypeAlias), |
1287 | Union(Union), | 1287 | Union(Union), |
@@ -1391,7 +1391,7 @@ impl ast::NameOwner for ExternItem {} | |||
1391 | impl ast::VisibilityOwner for ExternItem {} | 1391 | impl ast::VisibilityOwner for ExternItem {} |
1392 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1392 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1393 | pub enum AdtDef { | 1393 | pub enum AdtDef { |
1394 | StructDef(StructDef), | 1394 | Struct(Struct), |
1395 | EnumDef(EnumDef), | 1395 | EnumDef(EnumDef), |
1396 | Union(Union), | 1396 | Union(Union), |
1397 | } | 1397 | } |
@@ -1520,8 +1520,8 @@ impl AstNode for StaticDef { | |||
1520 | } | 1520 | } |
1521 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1521 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1522 | } | 1522 | } |
1523 | impl AstNode for StructDef { | 1523 | impl AstNode for Struct { |
1524 | fn can_cast(kind: SyntaxKind) -> bool { kind == STRUCT_DEF } | 1524 | fn can_cast(kind: SyntaxKind) -> bool { kind == STRUCT } |
1525 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1525 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1526 | if Self::can_cast(syntax.kind()) { | 1526 | if Self::can_cast(syntax.kind()) { |
1527 | Some(Self { syntax }) | 1527 | Some(Self { syntax }) |
@@ -2801,8 +2801,8 @@ impl From<Module> for Item { | |||
2801 | impl From<StaticDef> for Item { | 2801 | impl From<StaticDef> for Item { |
2802 | fn from(node: StaticDef) -> Item { Item::StaticDef(node) } | 2802 | fn from(node: StaticDef) -> Item { Item::StaticDef(node) } |
2803 | } | 2803 | } |
2804 | impl From<StructDef> for Item { | 2804 | impl From<Struct> for Item { |
2805 | fn from(node: StructDef) -> Item { Item::StructDef(node) } | 2805 | fn from(node: Struct) -> Item { Item::Struct(node) } |
2806 | } | 2806 | } |
2807 | impl From<TraitDef> for Item { | 2807 | impl From<TraitDef> for Item { |
2808 | fn from(node: TraitDef) -> Item { Item::TraitDef(node) } | 2808 | fn from(node: TraitDef) -> Item { Item::TraitDef(node) } |
@@ -2820,7 +2820,7 @@ impl AstNode for Item { | |||
2820 | fn can_cast(kind: SyntaxKind) -> bool { | 2820 | fn can_cast(kind: SyntaxKind) -> bool { |
2821 | match kind { | 2821 | match kind { |
2822 | CONST_DEF | ENUM_DEF | EXTERN_BLOCK | EXTERN_CRATE | FN | IMPL_DEF | MACRO_CALL | 2822 | CONST_DEF | ENUM_DEF | EXTERN_BLOCK | EXTERN_CRATE | FN | IMPL_DEF | MACRO_CALL |
2823 | | MODULE | STATIC_DEF | STRUCT_DEF | TRAIT_DEF | TYPE_ALIAS | UNION | USE => true, | 2823 | | MODULE | STATIC_DEF | STRUCT | TRAIT_DEF | TYPE_ALIAS | UNION | USE => true, |
2824 | _ => false, | 2824 | _ => false, |
2825 | } | 2825 | } |
2826 | } | 2826 | } |
@@ -2835,7 +2835,7 @@ impl AstNode for Item { | |||
2835 | MACRO_CALL => Item::MacroCall(MacroCall { syntax }), | 2835 | MACRO_CALL => Item::MacroCall(MacroCall { syntax }), |
2836 | MODULE => Item::Module(Module { syntax }), | 2836 | MODULE => Item::Module(Module { syntax }), |
2837 | STATIC_DEF => Item::StaticDef(StaticDef { syntax }), | 2837 | STATIC_DEF => Item::StaticDef(StaticDef { syntax }), |
2838 | STRUCT_DEF => Item::StructDef(StructDef { syntax }), | 2838 | STRUCT => Item::Struct(Struct { syntax }), |
2839 | TRAIT_DEF => Item::TraitDef(TraitDef { syntax }), | 2839 | TRAIT_DEF => Item::TraitDef(TraitDef { syntax }), |
2840 | TYPE_ALIAS => Item::TypeAlias(TypeAlias { syntax }), | 2840 | TYPE_ALIAS => Item::TypeAlias(TypeAlias { syntax }), |
2841 | UNION => Item::Union(Union { syntax }), | 2841 | UNION => Item::Union(Union { syntax }), |
@@ -2855,7 +2855,7 @@ impl AstNode for Item { | |||
2855 | Item::MacroCall(it) => &it.syntax, | 2855 | Item::MacroCall(it) => &it.syntax, |
2856 | Item::Module(it) => &it.syntax, | 2856 | Item::Module(it) => &it.syntax, |
2857 | Item::StaticDef(it) => &it.syntax, | 2857 | Item::StaticDef(it) => &it.syntax, |
2858 | Item::StructDef(it) => &it.syntax, | 2858 | Item::Struct(it) => &it.syntax, |
2859 | Item::TraitDef(it) => &it.syntax, | 2859 | Item::TraitDef(it) => &it.syntax, |
2860 | Item::TypeAlias(it) => &it.syntax, | 2860 | Item::TypeAlias(it) => &it.syntax, |
2861 | Item::Union(it) => &it.syntax, | 2861 | Item::Union(it) => &it.syntax, |
@@ -3372,8 +3372,8 @@ impl AstNode for ExternItem { | |||
3372 | } | 3372 | } |
3373 | } | 3373 | } |
3374 | } | 3374 | } |
3375 | impl From<StructDef> for AdtDef { | 3375 | impl From<Struct> for AdtDef { |
3376 | fn from(node: StructDef) -> AdtDef { AdtDef::StructDef(node) } | 3376 | fn from(node: Struct) -> AdtDef { AdtDef::Struct(node) } |
3377 | } | 3377 | } |
3378 | impl From<EnumDef> for AdtDef { | 3378 | impl From<EnumDef> for AdtDef { |
3379 | fn from(node: EnumDef) -> AdtDef { AdtDef::EnumDef(node) } | 3379 | fn from(node: EnumDef) -> AdtDef { AdtDef::EnumDef(node) } |
@@ -3384,13 +3384,13 @@ impl From<Union> for AdtDef { | |||
3384 | impl AstNode for AdtDef { | 3384 | impl AstNode for AdtDef { |
3385 | fn can_cast(kind: SyntaxKind) -> bool { | 3385 | fn can_cast(kind: SyntaxKind) -> bool { |
3386 | match kind { | 3386 | match kind { |
3387 | STRUCT_DEF | ENUM_DEF | UNION => true, | 3387 | STRUCT | ENUM_DEF | UNION => true, |
3388 | _ => false, | 3388 | _ => false, |
3389 | } | 3389 | } |
3390 | } | 3390 | } |
3391 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 3391 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
3392 | let res = match syntax.kind() { | 3392 | let res = match syntax.kind() { |
3393 | STRUCT_DEF => AdtDef::StructDef(StructDef { syntax }), | 3393 | STRUCT => AdtDef::Struct(Struct { syntax }), |
3394 | ENUM_DEF => AdtDef::EnumDef(EnumDef { syntax }), | 3394 | ENUM_DEF => AdtDef::EnumDef(EnumDef { syntax }), |
3395 | UNION => AdtDef::Union(Union { syntax }), | 3395 | UNION => AdtDef::Union(Union { syntax }), |
3396 | _ => return None, | 3396 | _ => return None, |
@@ -3399,7 +3399,7 @@ impl AstNode for AdtDef { | |||
3399 | } | 3399 | } |
3400 | fn syntax(&self) -> &SyntaxNode { | 3400 | fn syntax(&self) -> &SyntaxNode { |
3401 | match self { | 3401 | match self { |
3402 | AdtDef::StructDef(it) => &it.syntax, | 3402 | AdtDef::Struct(it) => &it.syntax, |
3403 | AdtDef::EnumDef(it) => &it.syntax, | 3403 | AdtDef::EnumDef(it) => &it.syntax, |
3404 | AdtDef::Union(it) => &it.syntax, | 3404 | AdtDef::Union(it) => &it.syntax, |
3405 | } | 3405 | } |
@@ -3510,7 +3510,7 @@ impl std::fmt::Display for StaticDef { | |||
3510 | std::fmt::Display::fmt(self.syntax(), f) | 3510 | std::fmt::Display::fmt(self.syntax(), f) |
3511 | } | 3511 | } |
3512 | } | 3512 | } |
3513 | impl std::fmt::Display for StructDef { | 3513 | impl std::fmt::Display for Struct { |
3514 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3514 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3515 | std::fmt::Display::fmt(self.syntax(), f) | 3515 | std::fmt::Display::fmt(self.syntax(), f) |
3516 | } | 3516 | } |
diff --git a/crates/ra_syntax/src/ast/node_ext.rs b/crates/ra_syntax/src/ast/node_ext.rs index ce11a7513..2299988ce 100644 --- a/crates/ra_syntax/src/ast/node_ext.rs +++ b/crates/ra_syntax/src/ast/node_ext.rs | |||
@@ -183,7 +183,7 @@ impl StructKind { | |||
183 | } | 183 | } |
184 | } | 184 | } |
185 | 185 | ||
186 | impl ast::StructDef { | 186 | impl ast::Struct { |
187 | pub fn kind(&self) -> StructKind { | 187 | pub fn kind(&self) -> StructKind { |
188 | StructKind::from_node(self) | 188 | StructKind::from_node(self) |
189 | } | 189 | } |
@@ -475,7 +475,7 @@ impl ast::TokenTree { | |||
475 | 475 | ||
476 | impl ast::DocCommentsOwner for ast::SourceFile {} | 476 | impl ast::DocCommentsOwner for ast::SourceFile {} |
477 | impl ast::DocCommentsOwner for ast::Fn {} | 477 | impl ast::DocCommentsOwner for ast::Fn {} |
478 | impl ast::DocCommentsOwner for ast::StructDef {} | 478 | impl ast::DocCommentsOwner for ast::Struct {} |
479 | impl ast::DocCommentsOwner for ast::Union {} | 479 | 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 {} |
diff --git a/crates/ra_syntax/src/parsing/text_tree_sink.rs b/crates/ra_syntax/src/parsing/text_tree_sink.rs index 0a1246c59..ef260ea59 100644 --- a/crates/ra_syntax/src/parsing/text_tree_sink.rs +++ b/crates/ra_syntax/src/parsing/text_tree_sink.rs | |||
@@ -146,8 +146,8 @@ 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_DEF | ENUM_DEF | ENUM_VARIANT | FN | 149 | MACRO_CALL | CONST_DEF | TYPE_ALIAS | STRUCT | ENUM_DEF | ENUM_VARIANT | FN | TRAIT_DEF |
150 | | TRAIT_DEF | 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(); |
153 | 153 | ||
diff --git a/crates/ra_syntax/test_data/parser/err/0000_struct_field_missing_comma.rast b/crates/ra_syntax/test_data/parser/err/0000_struct_field_missing_comma.rast index 93f6060ed..bbbf496c8 100644 --- a/crates/ra_syntax/test_data/parser/err/0000_struct_field_missing_comma.rast +++ b/crates/ra_syntax/test_data/parser/err/0000_struct_field_missing_comma.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..34 | 1 | SOURCE_FILE@0..34 |
2 | STRUCT_DEF@0..34 | 2 | STRUCT@0..34 |
3 | STRUCT_KW@0..6 "struct" | 3 | STRUCT_KW@0..6 "struct" |
4 | WHITESPACE@6..7 " " | 4 | WHITESPACE@6..7 " " |
5 | NAME@7..8 | 5 | NAME@7..8 |
diff --git a/crates/ra_syntax/test_data/parser/err/0001_item_recovery_in_file.rast b/crates/ra_syntax/test_data/parser/err/0001_item_recovery_in_file.rast index 7e2f429e1..6dc73bfdb 100644 --- a/crates/ra_syntax/test_data/parser/err/0001_item_recovery_in_file.rast +++ b/crates/ra_syntax/test_data/parser/err/0001_item_recovery_in_file.rast | |||
@@ -5,7 +5,7 @@ SOURCE_FILE@0..21 | |||
5 | ERROR@3..8 | 5 | ERROR@3..8 |
6 | MATCH_KW@3..8 "match" | 6 | MATCH_KW@3..8 "match" |
7 | WHITESPACE@8..10 "\n\n" | 7 | WHITESPACE@8..10 "\n\n" |
8 | STRUCT_DEF@10..21 | 8 | STRUCT@10..21 |
9 | STRUCT_KW@10..16 "struct" | 9 | STRUCT_KW@10..16 "struct" |
10 | WHITESPACE@16..17 " " | 10 | WHITESPACE@16..17 " " |
11 | NAME@17..18 | 11 | NAME@17..18 |
diff --git a/crates/ra_syntax/test_data/parser/err/0003_C++_semicolon.rast b/crates/ra_syntax/test_data/parser/err/0003_C++_semicolon.rast index e0f3916b3..7763fad84 100644 --- a/crates/ra_syntax/test_data/parser/err/0003_C++_semicolon.rast +++ b/crates/ra_syntax/test_data/parser/err/0003_C++_semicolon.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..40 | 1 | SOURCE_FILE@0..40 |
2 | STRUCT_DEF@0..39 | 2 | STRUCT@0..39 |
3 | STRUCT_KW@0..6 "struct" | 3 | STRUCT_KW@0..6 "struct" |
4 | WHITESPACE@6..7 " " | 4 | WHITESPACE@6..7 " " |
5 | NAME@7..8 | 5 | NAME@7..8 |
diff --git a/crates/ra_syntax/test_data/parser/err/0006_named_field_recovery.rast b/crates/ra_syntax/test_data/parser/err/0006_named_field_recovery.rast index ad9447761..5f85c3943 100644 --- a/crates/ra_syntax/test_data/parser/err/0006_named_field_recovery.rast +++ b/crates/ra_syntax/test_data/parser/err/0006_named_field_recovery.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..74 | 1 | SOURCE_FILE@0..74 |
2 | STRUCT_DEF@0..73 | 2 | STRUCT@0..73 |
3 | STRUCT_KW@0..6 "struct" | 3 | STRUCT_KW@0..6 "struct" |
4 | WHITESPACE@6..7 " " | 4 | WHITESPACE@6..7 " " |
5 | NAME@7..8 | 5 | NAME@7..8 |
diff --git a/crates/ra_syntax/test_data/parser/err/0007_stray_curly_in_file.rast b/crates/ra_syntax/test_data/parser/err/0007_stray_curly_in_file.rast index 2ae5bacea..560bfd751 100644 --- a/crates/ra_syntax/test_data/parser/err/0007_stray_curly_in_file.rast +++ b/crates/ra_syntax/test_data/parser/err/0007_stray_curly_in_file.rast | |||
@@ -2,7 +2,7 @@ SOURCE_FILE@0..31 | |||
2 | ERROR@0..1 | 2 | ERROR@0..1 |
3 | R_CURLY@0..1 "}" | 3 | R_CURLY@0..1 "}" |
4 | WHITESPACE@1..3 "\n\n" | 4 | WHITESPACE@1..3 "\n\n" |
5 | STRUCT_DEF@3..12 | 5 | STRUCT@3..12 |
6 | STRUCT_KW@3..9 "struct" | 6 | STRUCT_KW@3..9 "struct" |
7 | WHITESPACE@9..10 " " | 7 | WHITESPACE@9..10 " " |
8 | NAME@10..11 | 8 | NAME@10..11 |
diff --git a/crates/ra_syntax/test_data/parser/err/0009_broken_struct_type_parameter.rast b/crates/ra_syntax/test_data/parser/err/0009_broken_struct_type_parameter.rast index 10081a870..dacf71aa1 100644 --- a/crates/ra_syntax/test_data/parser/err/0009_broken_struct_type_parameter.rast +++ b/crates/ra_syntax/test_data/parser/err/0009_broken_struct_type_parameter.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..43 | 1 | SOURCE_FILE@0..43 |
2 | STRUCT_DEF@0..11 | 2 | STRUCT@0..11 |
3 | STRUCT_KW@0..6 "struct" | 3 | STRUCT_KW@0..6 "struct" |
4 | WHITESPACE@6..7 " " | 4 | WHITESPACE@6..7 " " |
5 | NAME@7..8 | 5 | NAME@7..8 |
@@ -38,7 +38,7 @@ SOURCE_FILE@0..43 | |||
38 | WHITESPACE@29..30 "\n" | 38 | WHITESPACE@29..30 "\n" |
39 | R_CURLY@30..31 "}" | 39 | R_CURLY@30..31 "}" |
40 | WHITESPACE@31..33 "\n\n" | 40 | WHITESPACE@31..33 "\n\n" |
41 | STRUCT_DEF@33..42 | 41 | STRUCT@33..42 |
42 | STRUCT_KW@33..39 "struct" | 42 | STRUCT_KW@33..39 "struct" |
43 | WHITESPACE@39..40 " " | 43 | WHITESPACE@39..40 " " |
44 | NAME@40..41 | 44 | NAME@40..41 |
diff --git a/crates/ra_syntax/test_data/parser/err/0011_extern_struct.rast b/crates/ra_syntax/test_data/parser/err/0011_extern_struct.rast index 87c54c32c..b02d390af 100644 --- a/crates/ra_syntax/test_data/parser/err/0011_extern_struct.rast +++ b/crates/ra_syntax/test_data/parser/err/0011_extern_struct.rast | |||
@@ -3,7 +3,7 @@ SOURCE_FILE@0..19 | |||
3 | ABI@0..6 | 3 | ABI@0..6 |
4 | EXTERN_KW@0..6 "extern" | 4 | EXTERN_KW@0..6 "extern" |
5 | WHITESPACE@6..7 " " | 5 | WHITESPACE@6..7 " " |
6 | STRUCT_DEF@7..18 | 6 | STRUCT@7..18 |
7 | STRUCT_KW@7..13 "struct" | 7 | STRUCT_KW@7..13 "struct" |
8 | WHITESPACE@13..14 " " | 8 | WHITESPACE@13..14 " " |
9 | NAME@14..17 | 9 | NAME@14..17 |
diff --git a/crates/ra_syntax/test_data/parser/err/0013_invalid_type.rast b/crates/ra_syntax/test_data/parser/err/0013_invalid_type.rast index c3591d25c..3eef848fc 100644 --- a/crates/ra_syntax/test_data/parser/err/0013_invalid_type.rast +++ b/crates/ra_syntax/test_data/parser/err/0013_invalid_type.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..86 | 1 | SOURCE_FILE@0..86 |
2 | STRUCT_DEF@0..72 | 2 | STRUCT@0..72 |
3 | VISIBILITY@0..3 | 3 | VISIBILITY@0..3 |
4 | PUB_KW@0..3 "pub" | 4 | PUB_KW@0..3 "pub" |
5 | WHITESPACE@3..4 " " | 5 | WHITESPACE@3..4 " " |
diff --git a/crates/ra_syntax/test_data/parser/err/0022_bad_exprs.rast b/crates/ra_syntax/test_data/parser/err/0022_bad_exprs.rast index 866f61113..02339d035 100644 --- a/crates/ra_syntax/test_data/parser/err/0022_bad_exprs.rast +++ b/crates/ra_syntax/test_data/parser/err/0022_bad_exprs.rast | |||
@@ -28,7 +28,7 @@ SOURCE_FILE@0..112 | |||
28 | ERROR@17..18 | 28 | ERROR@17..18 |
29 | COMMA@17..18 "," | 29 | COMMA@17..18 "," |
30 | WHITESPACE@18..19 " " | 30 | WHITESPACE@18..19 " " |
31 | STRUCT_DEF@19..26 | 31 | STRUCT@19..26 |
32 | STRUCT_KW@19..25 "struct" | 32 | STRUCT_KW@19..25 "struct" |
33 | ERROR@25..26 | 33 | ERROR@25..26 |
34 | COMMA@25..26 "," | 34 | COMMA@25..26 "," |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0007_type_param_bounds.rast b/crates/ra_syntax/test_data/parser/inline/ok/0007_type_param_bounds.rast index 49aca06b0..e95688f56 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0007_type_param_bounds.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0007_type_param_bounds.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..35 | 1 | SOURCE_FILE@0..35 |
2 | STRUCT_DEF@0..34 | 2 | STRUCT@0..34 |
3 | STRUCT_KW@0..6 "struct" | 3 | STRUCT_KW@0..6 "struct" |
4 | WHITESPACE@6..7 " " | 4 | WHITESPACE@6..7 " " |
5 | NAME@7..8 | 5 | NAME@7..8 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0022_crate_visibility.rast b/crates/ra_syntax/test_data/parser/inline/ok/0022_crate_visibility.rast index 1b810607e..50742cbcf 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0022_crate_visibility.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0022_crate_visibility.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..81 | 1 | SOURCE_FILE@0..81 |
2 | STRUCT_DEF@0..20 | 2 | STRUCT@0..20 |
3 | VISIBILITY@0..10 | 3 | VISIBILITY@0..10 |
4 | PUB_KW@0..3 "pub" | 4 | PUB_KW@0..3 "pub" |
5 | L_PAREN@3..4 "(" | 5 | L_PAREN@3..4 "(" |
@@ -12,7 +12,7 @@ SOURCE_FILE@0..81 | |||
12 | IDENT@18..19 "S" | 12 | IDENT@18..19 "S" |
13 | SEMICOLON@19..20 ";" | 13 | SEMICOLON@19..20 ";" |
14 | WHITESPACE@20..21 "\n" | 14 | WHITESPACE@20..21 "\n" |
15 | STRUCT_DEF@21..40 | 15 | STRUCT@21..40 |
16 | VISIBILITY@21..30 | 16 | VISIBILITY@21..30 |
17 | PUB_KW@21..24 "pub" | 17 | PUB_KW@21..24 "pub" |
18 | L_PAREN@24..25 "(" | 18 | L_PAREN@24..25 "(" |
@@ -25,7 +25,7 @@ SOURCE_FILE@0..81 | |||
25 | IDENT@38..39 "S" | 25 | IDENT@38..39 "S" |
26 | SEMICOLON@39..40 ";" | 26 | SEMICOLON@39..40 ";" |
27 | WHITESPACE@40..41 "\n" | 27 | WHITESPACE@40..41 "\n" |
28 | STRUCT_DEF@41..60 | 28 | STRUCT@41..60 |
29 | VISIBILITY@41..50 | 29 | VISIBILITY@41..50 |
30 | PUB_KW@41..44 "pub" | 30 | PUB_KW@41..44 "pub" |
31 | L_PAREN@44..45 "(" | 31 | L_PAREN@44..45 "(" |
@@ -38,7 +38,7 @@ SOURCE_FILE@0..81 | |||
38 | IDENT@58..59 "S" | 38 | IDENT@58..59 "S" |
39 | SEMICOLON@59..60 ";" | 39 | SEMICOLON@59..60 ";" |
40 | WHITESPACE@60..61 "\n" | 40 | WHITESPACE@60..61 "\n" |
41 | STRUCT_DEF@61..80 | 41 | STRUCT@61..80 |
42 | VISIBILITY@61..70 | 42 | VISIBILITY@61..70 |
43 | PUB_KW@61..64 "pub" | 43 | PUB_KW@61..64 "pub" |
44 | L_PAREN@64..65 "(" | 44 | L_PAREN@64..65 "(" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.rast b/crates/ra_syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.rast index a0ad07807..db5bd2849 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.rast | |||
@@ -16,7 +16,7 @@ SOURCE_FILE@0..71 | |||
16 | WHITESPACE@17..18 " " | 16 | WHITESPACE@17..18 " " |
17 | R_CURLY@18..19 "}" | 17 | R_CURLY@18..19 "}" |
18 | WHITESPACE@19..20 "\n" | 18 | WHITESPACE@19..20 "\n" |
19 | STRUCT_DEF@20..49 | 19 | STRUCT@20..49 |
20 | STRUCT_KW@20..26 "struct" | 20 | STRUCT_KW@20..26 "struct" |
21 | WHITESPACE@26..27 " " | 21 | WHITESPACE@26..27 " " |
22 | NAME@27..28 | 22 | NAME@27..28 |
@@ -41,7 +41,7 @@ SOURCE_FILE@0..71 | |||
41 | WHITESPACE@47..48 " " | 41 | WHITESPACE@47..48 " " |
42 | R_CURLY@48..49 "}" | 42 | R_CURLY@48..49 "}" |
43 | WHITESPACE@49..50 "\n" | 43 | WHITESPACE@49..50 "\n" |
44 | STRUCT_DEF@50..70 | 44 | STRUCT@50..70 |
45 | STRUCT_KW@50..56 "struct" | 45 | STRUCT_KW@50..56 "struct" |
46 | WHITESPACE@56..57 " " | 46 | WHITESPACE@56..57 " " |
47 | NAME@57..58 | 47 | NAME@57..58 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0054_record_field_attrs.rast b/crates/ra_syntax/test_data/parser/inline/ok/0054_record_field_attrs.rast index 775bc2869..9ae271817 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0054_record_field_attrs.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0054_record_field_attrs.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..64 | 1 | SOURCE_FILE@0..64 |
2 | STRUCT_DEF@0..63 | 2 | STRUCT@0..63 |
3 | STRUCT_KW@0..6 "struct" | 3 | STRUCT_KW@0..6 "struct" |
4 | WHITESPACE@6..7 " " | 4 | WHITESPACE@6..7 " " |
5 | NAME@7..8 | 5 | NAME@7..8 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0062_mod_contents.rast b/crates/ra_syntax/test_data/parser/inline/ok/0062_mod_contents.rast index f6417ab13..de8217064 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0062_mod_contents.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0062_mod_contents.rast | |||
@@ -57,7 +57,7 @@ SOURCE_FILE@0..70 | |||
57 | L_CURLY@57..58 "{" | 57 | L_CURLY@57..58 "{" |
58 | R_CURLY@58..59 "}" | 58 | R_CURLY@58..59 "}" |
59 | WHITESPACE@59..60 "\n" | 59 | WHITESPACE@59..60 "\n" |
60 | STRUCT_DEF@60..69 | 60 | STRUCT@60..69 |
61 | STRUCT_KW@60..66 "struct" | 61 | STRUCT_KW@60..66 "struct" |
62 | WHITESPACE@66..67 " " | 62 | WHITESPACE@66..67 " " |
63 | NAME@67..68 | 63 | NAME@67..68 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0083_struct_items.rast b/crates/ra_syntax/test_data/parser/inline/ok/0083_struct_items.rast index 0d9a36618..cdbc40fe0 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0083_struct_items.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0083_struct_items.rast | |||
@@ -1,12 +1,12 @@ | |||
1 | SOURCE_FILE@0..106 | 1 | SOURCE_FILE@0..106 |
2 | STRUCT_DEF@0..11 | 2 | STRUCT@0..11 |
3 | STRUCT_KW@0..6 "struct" | 3 | STRUCT_KW@0..6 "struct" |
4 | WHITESPACE@6..7 " " | 4 | WHITESPACE@6..7 " " |
5 | NAME@7..10 | 5 | NAME@7..10 |
6 | IDENT@7..10 "Foo" | 6 | IDENT@7..10 "Foo" |
7 | SEMICOLON@10..11 ";" | 7 | SEMICOLON@10..11 ";" |
8 | WHITESPACE@11..12 "\n" | 8 | WHITESPACE@11..12 "\n" |
9 | STRUCT_DEF@12..25 | 9 | STRUCT@12..25 |
10 | STRUCT_KW@12..18 "struct" | 10 | STRUCT_KW@12..18 "struct" |
11 | WHITESPACE@18..19 " " | 11 | WHITESPACE@18..19 " " |
12 | NAME@19..22 | 12 | NAME@19..22 |
@@ -16,7 +16,7 @@ SOURCE_FILE@0..106 | |||
16 | L_CURLY@23..24 "{" | 16 | L_CURLY@23..24 "{" |
17 | R_CURLY@24..25 "}" | 17 | R_CURLY@24..25 "}" |
18 | WHITESPACE@25..26 "\n" | 18 | WHITESPACE@25..26 "\n" |
19 | STRUCT_DEF@26..39 | 19 | STRUCT@26..39 |
20 | STRUCT_KW@26..32 "struct" | 20 | STRUCT_KW@26..32 "struct" |
21 | WHITESPACE@32..33 " " | 21 | WHITESPACE@32..33 " " |
22 | NAME@33..36 | 22 | NAME@33..36 |
@@ -26,7 +26,7 @@ SOURCE_FILE@0..106 | |||
26 | R_PAREN@37..38 ")" | 26 | R_PAREN@37..38 ")" |
27 | SEMICOLON@38..39 ";" | 27 | SEMICOLON@38..39 ";" |
28 | WHITESPACE@39..40 "\n" | 28 | WHITESPACE@39..40 "\n" |
29 | STRUCT_DEF@40..66 | 29 | STRUCT@40..66 |
30 | STRUCT_KW@40..46 "struct" | 30 | STRUCT_KW@40..46 "struct" |
31 | WHITESPACE@46..47 " " | 31 | WHITESPACE@46..47 " " |
32 | NAME@47..50 | 32 | NAME@47..50 |
@@ -50,7 +50,7 @@ SOURCE_FILE@0..106 | |||
50 | R_PAREN@64..65 ")" | 50 | R_PAREN@64..65 ")" |
51 | SEMICOLON@65..66 ";" | 51 | SEMICOLON@65..66 ";" |
52 | WHITESPACE@66..67 "\n" | 52 | WHITESPACE@66..67 "\n" |
53 | STRUCT_DEF@67..105 | 53 | STRUCT@67..105 |
54 | STRUCT_KW@67..73 "struct" | 54 | STRUCT_KW@67..73 "struct" |
55 | WHITESPACE@73..74 " " | 55 | WHITESPACE@73..74 " " |
56 | NAME@74..77 | 56 | NAME@74..77 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0090_type_param_default.rast b/crates/ra_syntax/test_data/parser/inline/ok/0090_type_param_default.rast index 1d24619c3..2ef026e37 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0090_type_param_default.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0090_type_param_default.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..19 | 1 | SOURCE_FILE@0..19 |
2 | STRUCT_DEF@0..18 | 2 | STRUCT@0..18 |
3 | STRUCT_KW@0..6 "struct" | 3 | STRUCT_KW@0..6 "struct" |
4 | WHITESPACE@6..7 " " | 4 | WHITESPACE@6..7 " " |
5 | NAME@7..8 | 5 | NAME@7..8 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0114_tuple_struct_where.rast b/crates/ra_syntax/test_data/parser/inline/ok/0114_tuple_struct_where.rast index 3c9af3d1f..0e1594dc4 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0114_tuple_struct_where.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0114_tuple_struct_where.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..53 | 1 | SOURCE_FILE@0..53 |
2 | STRUCT_DEF@0..33 | 2 | STRUCT@0..33 |
3 | STRUCT_KW@0..6 "struct" | 3 | STRUCT_KW@0..6 "struct" |
4 | WHITESPACE@6..7 " " | 4 | WHITESPACE@6..7 " " |
5 | NAME@7..11 | 5 | NAME@7..11 |
@@ -40,7 +40,7 @@ SOURCE_FILE@0..53 | |||
40 | IDENT@27..32 "Clone" | 40 | IDENT@27..32 "Clone" |
41 | SEMICOLON@32..33 ";" | 41 | SEMICOLON@32..33 ";" |
42 | WHITESPACE@33..34 "\n" | 42 | WHITESPACE@33..34 "\n" |
43 | STRUCT_DEF@34..52 | 43 | STRUCT@34..52 |
44 | STRUCT_KW@34..40 "struct" | 44 | STRUCT_KW@34..40 "struct" |
45 | WHITESPACE@40..41 " " | 45 | WHITESPACE@40..41 " " |
46 | NAME@41..45 | 46 | NAME@41..45 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0115_tuple_field_attrs.rast b/crates/ra_syntax/test_data/parser/inline/ok/0115_tuple_field_attrs.rast index 51812a4f2..4d09c9f50 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0115_tuple_field_attrs.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0115_tuple_field_attrs.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..60 | 1 | SOURCE_FILE@0..60 |
2 | STRUCT_DEF@0..59 | 2 | STRUCT@0..59 |
3 | STRUCT_KW@0..6 "struct" | 3 | STRUCT_KW@0..6 "struct" |
4 | WHITESPACE@6..7 " " | 4 | WHITESPACE@6..7 " " |
5 | NAME@7..8 | 5 | NAME@7..8 |
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 d92bf84f4..280f947ce 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 | |||
@@ -47,7 +47,7 @@ SOURCE_FILE@0..111 | |||
47 | R_CURLY@89..90 "}" | 47 | R_CURLY@89..90 "}" |
48 | SEMICOLON@90..91 ";" | 48 | SEMICOLON@90..91 ";" |
49 | WHITESPACE@91..96 "\n " | 49 | WHITESPACE@91..96 "\n " |
50 | STRUCT_DEF@96..107 | 50 | STRUCT@96..107 |
51 | STRUCT_KW@96..102 "struct" | 51 | STRUCT_KW@96..102 "struct" |
52 | WHITESPACE@102..103 " " | 52 | WHITESPACE@102..103 " " |
53 | NAME@103..104 | 53 | NAME@103..104 |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0147_const_param.rast b/crates/ra_syntax/test_data/parser/inline/ok/0147_const_param.rast index 6981ef971..9312eab65 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0147_const_param.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0147_const_param.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..24 | 1 | SOURCE_FILE@0..24 |
2 | STRUCT_DEF@0..23 | 2 | STRUCT@0..23 |
3 | STRUCT_KW@0..6 "struct" | 3 | STRUCT_KW@0..6 "struct" |
4 | WHITESPACE@6..7 " " | 4 | WHITESPACE@6..7 " " |
5 | NAME@7..8 | 5 | NAME@7..8 |
diff --git a/crates/ra_syntax/test_data/parser/ok/0001_struct_item.rast b/crates/ra_syntax/test_data/parser/ok/0001_struct_item.rast index c9d1af92f..a171fe7a8 100644 --- a/crates/ra_syntax/test_data/parser/ok/0001_struct_item.rast +++ b/crates/ra_syntax/test_data/parser/ok/0001_struct_item.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..32 | 1 | SOURCE_FILE@0..32 |
2 | STRUCT_DEF@0..31 | 2 | STRUCT@0..31 |
3 | STRUCT_KW@0..6 "struct" | 3 | STRUCT_KW@0..6 "struct" |
4 | WHITESPACE@6..7 " " | 4 | WHITESPACE@6..7 " " |
5 | NAME@7..8 | 5 | NAME@7..8 |
diff --git a/crates/ra_syntax/test_data/parser/ok/0002_struct_item_field.rast b/crates/ra_syntax/test_data/parser/ok/0002_struct_item_field.rast index 57fb7a329..362892b91 100644 --- a/crates/ra_syntax/test_data/parser/ok/0002_struct_item_field.rast +++ b/crates/ra_syntax/test_data/parser/ok/0002_struct_item_field.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..25 | 1 | SOURCE_FILE@0..25 |
2 | STRUCT_DEF@0..25 | 2 | STRUCT@0..25 |
3 | STRUCT_KW@0..6 "struct" | 3 | STRUCT_KW@0..6 "struct" |
4 | WHITESPACE@6..7 " " | 4 | WHITESPACE@6..7 " " |
5 | NAME@7..8 | 5 | NAME@7..8 |
diff --git a/crates/ra_syntax/test_data/parser/ok/0008_mod_item.rast b/crates/ra_syntax/test_data/parser/ok/0008_mod_item.rast index 60ded78d5..b2c1d791f 100644 --- a/crates/ra_syntax/test_data/parser/ok/0008_mod_item.rast +++ b/crates/ra_syntax/test_data/parser/ok/0008_mod_item.rast | |||
@@ -40,7 +40,7 @@ SOURCE_FILE@0..118 | |||
40 | WHITESPACE@41..46 "\n " | 40 | WHITESPACE@41..46 "\n " |
41 | R_CURLY@46..47 "}" | 41 | R_CURLY@46..47 "}" |
42 | WHITESPACE@47..52 "\n " | 42 | WHITESPACE@47..52 "\n " |
43 | STRUCT_DEF@52..63 | 43 | STRUCT@52..63 |
44 | STRUCT_KW@52..58 "struct" | 44 | STRUCT_KW@52..58 "struct" |
45 | WHITESPACE@58..59 " " | 45 | WHITESPACE@58..59 " " |
46 | NAME@59..60 | 46 | NAME@59..60 |
diff --git a/crates/ra_syntax/test_data/parser/ok/0016_struct_flavors.rast b/crates/ra_syntax/test_data/parser/ok/0016_struct_flavors.rast index 00b1b65be..b15f41dd7 100644 --- a/crates/ra_syntax/test_data/parser/ok/0016_struct_flavors.rast +++ b/crates/ra_syntax/test_data/parser/ok/0016_struct_flavors.rast | |||
@@ -1,12 +1,12 @@ | |||
1 | SOURCE_FILE@0..97 | 1 | SOURCE_FILE@0..97 |
2 | STRUCT_DEF@0..9 | 2 | STRUCT@0..9 |
3 | STRUCT_KW@0..6 "struct" | 3 | STRUCT_KW@0..6 "struct" |
4 | WHITESPACE@6..7 " " | 4 | WHITESPACE@6..7 " " |
5 | NAME@7..8 | 5 | NAME@7..8 |
6 | IDENT@7..8 "A" | 6 | IDENT@7..8 "A" |
7 | SEMICOLON@8..9 ";" | 7 | SEMICOLON@8..9 ";" |
8 | WHITESPACE@9..10 "\n" | 8 | WHITESPACE@9..10 "\n" |
9 | STRUCT_DEF@10..21 | 9 | STRUCT@10..21 |
10 | STRUCT_KW@10..16 "struct" | 10 | STRUCT_KW@10..16 "struct" |
11 | WHITESPACE@16..17 " " | 11 | WHITESPACE@16..17 " " |
12 | NAME@17..18 | 12 | NAME@17..18 |
@@ -16,7 +16,7 @@ SOURCE_FILE@0..97 | |||
16 | L_CURLY@19..20 "{" | 16 | L_CURLY@19..20 "{" |
17 | R_CURLY@20..21 "}" | 17 | R_CURLY@20..21 "}" |
18 | WHITESPACE@21..22 "\n" | 18 | WHITESPACE@21..22 "\n" |
19 | STRUCT_DEF@22..33 | 19 | STRUCT@22..33 |
20 | STRUCT_KW@22..28 "struct" | 20 | STRUCT_KW@22..28 "struct" |
21 | WHITESPACE@28..29 " " | 21 | WHITESPACE@28..29 " " |
22 | NAME@29..30 | 22 | NAME@29..30 |
@@ -26,7 +26,7 @@ SOURCE_FILE@0..97 | |||
26 | R_PAREN@31..32 ")" | 26 | R_PAREN@31..32 ")" |
27 | SEMICOLON@32..33 ";" | 27 | SEMICOLON@32..33 ";" |
28 | WHITESPACE@33..35 "\n\n" | 28 | WHITESPACE@33..35 "\n\n" |
29 | STRUCT_DEF@35..74 | 29 | STRUCT@35..74 |
30 | STRUCT_KW@35..41 "struct" | 30 | STRUCT_KW@35..41 "struct" |
31 | WHITESPACE@41..42 " " | 31 | WHITESPACE@41..42 " " |
32 | NAME@42..43 | 32 | NAME@42..43 |
@@ -63,7 +63,7 @@ SOURCE_FILE@0..97 | |||
63 | WHITESPACE@72..73 "\n" | 63 | WHITESPACE@72..73 "\n" |
64 | R_CURLY@73..74 "}" | 64 | R_CURLY@73..74 "}" |
65 | WHITESPACE@74..76 "\n\n" | 65 | WHITESPACE@74..76 "\n\n" |
66 | STRUCT_DEF@76..96 | 66 | STRUCT@76..96 |
67 | STRUCT_KW@76..82 "struct" | 67 | STRUCT_KW@76..82 "struct" |
68 | WHITESPACE@82..83 " " | 68 | WHITESPACE@82..83 " " |
69 | NAME@83..84 | 69 | NAME@83..84 |
diff --git a/crates/ra_syntax/test_data/parser/ok/0018_struct_type_params.rast b/crates/ra_syntax/test_data/parser/ok/0018_struct_type_params.rast index b757bd16d..630aa0708 100644 --- a/crates/ra_syntax/test_data/parser/ok/0018_struct_type_params.rast +++ b/crates/ra_syntax/test_data/parser/ok/0018_struct_type_params.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..290 | 1 | SOURCE_FILE@0..290 |
2 | STRUCT_DEF@0..13 | 2 | STRUCT@0..13 |
3 | STRUCT_KW@0..6 "struct" | 3 | STRUCT_KW@0..6 "struct" |
4 | WHITESPACE@6..7 " " | 4 | WHITESPACE@6..7 " " |
5 | NAME@7..9 | 5 | NAME@7..9 |
@@ -12,7 +12,7 @@ SOURCE_FILE@0..290 | |||
12 | R_ANGLE@11..12 ">" | 12 | R_ANGLE@11..12 ">" |
13 | SEMICOLON@12..13 ";" | 13 | SEMICOLON@12..13 ";" |
14 | WHITESPACE@13..14 "\n" | 14 | WHITESPACE@13..14 "\n" |
15 | STRUCT_DEF@14..32 | 15 | STRUCT@14..32 |
16 | STRUCT_KW@14..20 "struct" | 16 | STRUCT_KW@14..20 "struct" |
17 | WHITESPACE@20..21 " " | 17 | WHITESPACE@20..21 " " |
18 | NAME@21..23 | 18 | NAME@21..23 |
@@ -34,7 +34,7 @@ SOURCE_FILE@0..290 | |||
34 | R_PAREN@30..31 ")" | 34 | R_PAREN@30..31 ")" |
35 | SEMICOLON@31..32 ";" | 35 | SEMICOLON@31..32 ";" |
36 | WHITESPACE@32..33 "\n" | 36 | WHITESPACE@32..33 "\n" |
37 | STRUCT_DEF@33..56 | 37 | STRUCT@33..56 |
38 | STRUCT_KW@33..39 "struct" | 38 | STRUCT_KW@33..39 "struct" |
39 | WHITESPACE@39..40 " " | 39 | WHITESPACE@39..40 " " |
40 | NAME@40..42 | 40 | NAME@40..42 |
@@ -62,7 +62,7 @@ SOURCE_FILE@0..290 | |||
62 | WHITESPACE@54..55 " " | 62 | WHITESPACE@54..55 " " |
63 | R_CURLY@55..56 "}" | 63 | R_CURLY@55..56 "}" |
64 | WHITESPACE@56..58 "\n\n" | 64 | WHITESPACE@56..58 "\n\n" |
65 | STRUCT_DEF@58..70 | 65 | STRUCT@58..70 |
66 | STRUCT_KW@58..64 "struct" | 66 | STRUCT_KW@58..64 "struct" |
67 | WHITESPACE@64..65 " " | 67 | WHITESPACE@64..65 " " |
68 | NAME@65..67 | 68 | NAME@65..67 |
@@ -72,7 +72,7 @@ SOURCE_FILE@0..290 | |||
72 | R_ANGLE@68..69 ">" | 72 | R_ANGLE@68..69 ">" |
73 | SEMICOLON@69..70 ";" | 73 | SEMICOLON@69..70 ";" |
74 | WHITESPACE@70..71 "\n" | 74 | WHITESPACE@70..71 "\n" |
75 | STRUCT_DEF@71..85 | 75 | STRUCT@71..85 |
76 | STRUCT_KW@71..77 "struct" | 76 | STRUCT_KW@71..77 "struct" |
77 | WHITESPACE@77..78 " " | 77 | WHITESPACE@77..78 " " |
78 | NAME@78..80 | 78 | NAME@78..80 |
@@ -84,7 +84,7 @@ SOURCE_FILE@0..290 | |||
84 | R_ANGLE@83..84 ">" | 84 | R_ANGLE@83..84 ">" |
85 | SEMICOLON@84..85 ";" | 85 | SEMICOLON@84..85 ";" |
86 | WHITESPACE@85..86 "\n" | 86 | WHITESPACE@85..86 "\n" |
87 | STRUCT_DEF@86..101 | 87 | STRUCT@86..101 |
88 | STRUCT_KW@86..92 "struct" | 88 | STRUCT_KW@86..92 "struct" |
89 | WHITESPACE@92..93 " " | 89 | WHITESPACE@92..93 " " |
90 | NAME@93..95 | 90 | NAME@93..95 |
@@ -97,7 +97,7 @@ SOURCE_FILE@0..290 | |||
97 | R_ANGLE@99..100 ">" | 97 | R_ANGLE@99..100 ">" |
98 | SEMICOLON@100..101 ";" | 98 | SEMICOLON@100..101 ";" |
99 | WHITESPACE@101..102 "\n" | 99 | WHITESPACE@101..102 "\n" |
100 | STRUCT_DEF@102..120 | 100 | STRUCT@102..120 |
101 | STRUCT_KW@102..108 "struct" | 101 | STRUCT_KW@102..108 "struct" |
102 | WHITESPACE@108..109 " " | 102 | WHITESPACE@108..109 " " |
103 | NAME@109..111 | 103 | NAME@109..111 |
@@ -112,7 +112,7 @@ SOURCE_FILE@0..290 | |||
112 | R_ANGLE@118..119 ">" | 112 | R_ANGLE@118..119 ">" |
113 | SEMICOLON@119..120 ";" | 113 | SEMICOLON@119..120 ";" |
114 | WHITESPACE@120..121 "\n" | 114 | WHITESPACE@120..121 "\n" |
115 | STRUCT_DEF@121..142 | 115 | STRUCT@121..142 |
116 | STRUCT_KW@121..127 "struct" | 116 | STRUCT_KW@121..127 "struct" |
117 | WHITESPACE@127..128 " " | 117 | WHITESPACE@127..128 " " |
118 | NAME@128..130 | 118 | NAME@128..130 |
@@ -130,7 +130,7 @@ SOURCE_FILE@0..290 | |||
130 | R_ANGLE@140..141 ">" | 130 | R_ANGLE@140..141 ">" |
131 | SEMICOLON@141..142 ";" | 131 | SEMICOLON@141..142 ";" |
132 | WHITESPACE@142..143 "\n" | 132 | WHITESPACE@142..143 "\n" |
133 | STRUCT_DEF@143..166 | 133 | STRUCT@143..166 |
134 | STRUCT_KW@143..149 "struct" | 134 | STRUCT_KW@143..149 "struct" |
135 | WHITESPACE@149..150 " " | 135 | WHITESPACE@149..150 " " |
136 | NAME@150..152 | 136 | NAME@150..152 |
@@ -149,7 +149,7 @@ SOURCE_FILE@0..290 | |||
149 | R_ANGLE@164..165 ">" | 149 | R_ANGLE@164..165 ">" |
150 | SEMICOLON@165..166 ";" | 150 | SEMICOLON@165..166 ";" |
151 | WHITESPACE@166..167 "\n" | 151 | WHITESPACE@166..167 "\n" |
152 | STRUCT_DEF@167..183 | 152 | STRUCT@167..183 |
153 | STRUCT_KW@167..173 "struct" | 153 | STRUCT_KW@167..173 "struct" |
154 | WHITESPACE@173..174 " " | 154 | WHITESPACE@173..174 " " |
155 | NAME@174..177 | 155 | NAME@174..177 |
@@ -162,7 +162,7 @@ SOURCE_FILE@0..290 | |||
162 | R_ANGLE@181..182 ">" | 162 | R_ANGLE@181..182 ">" |
163 | SEMICOLON@182..183 ";" | 163 | SEMICOLON@182..183 ";" |
164 | WHITESPACE@183..184 "\n" | 164 | WHITESPACE@183..184 "\n" |
165 | STRUCT_DEF@184..203 | 165 | STRUCT@184..203 |
166 | STRUCT_KW@184..190 "struct" | 166 | STRUCT_KW@184..190 "struct" |
167 | WHITESPACE@190..191 " " | 167 | WHITESPACE@190..191 " " |
168 | NAME@191..194 | 168 | NAME@191..194 |
@@ -178,7 +178,7 @@ SOURCE_FILE@0..290 | |||
178 | R_ANGLE@201..202 ">" | 178 | R_ANGLE@201..202 ">" |
179 | SEMICOLON@202..203 ";" | 179 | SEMICOLON@202..203 ";" |
180 | WHITESPACE@203..204 "\n" | 180 | WHITESPACE@203..204 "\n" |
181 | STRUCT_DEF@204..233 | 181 | STRUCT@204..233 |
182 | STRUCT_KW@204..210 "struct" | 182 | STRUCT_KW@204..210 "struct" |
183 | WHITESPACE@210..211 " " | 183 | WHITESPACE@210..211 " " |
184 | NAME@211..214 | 184 | NAME@211..214 |
@@ -202,7 +202,7 @@ SOURCE_FILE@0..290 | |||
202 | R_ANGLE@231..232 ">" | 202 | R_ANGLE@231..232 ">" |
203 | SEMICOLON@232..233 ";" | 203 | SEMICOLON@232..233 ";" |
204 | WHITESPACE@233..235 "\n\n" | 204 | WHITESPACE@233..235 "\n\n" |
205 | STRUCT_DEF@235..249 | 205 | STRUCT@235..249 |
206 | STRUCT_KW@235..241 "struct" | 206 | STRUCT_KW@235..241 "struct" |
207 | WHITESPACE@241..242 " " | 207 | WHITESPACE@241..242 " " |
208 | NAME@242..245 | 208 | NAME@242..245 |
@@ -215,7 +215,7 @@ SOURCE_FILE@0..290 | |||
215 | R_ANGLE@247..248 ">" | 215 | R_ANGLE@247..248 ">" |
216 | SEMICOLON@248..249 ";" | 216 | SEMICOLON@248..249 ";" |
217 | WHITESPACE@249..250 "\n" | 217 | WHITESPACE@249..250 "\n" |
218 | STRUCT_DEF@250..267 | 218 | STRUCT@250..267 |
219 | STRUCT_KW@250..256 "struct" | 219 | STRUCT_KW@250..256 "struct" |
220 | WHITESPACE@256..257 " " | 220 | WHITESPACE@256..257 " " |
221 | NAME@257..260 | 221 | NAME@257..260 |
@@ -233,7 +233,7 @@ SOURCE_FILE@0..290 | |||
233 | R_ANGLE@265..266 ">" | 233 | R_ANGLE@265..266 ">" |
234 | SEMICOLON@266..267 ";" | 234 | SEMICOLON@266..267 ";" |
235 | WHITESPACE@267..268 "\n" | 235 | WHITESPACE@267..268 "\n" |
236 | STRUCT_DEF@268..289 | 236 | STRUCT@268..289 |
237 | STRUCT_KW@268..274 "struct" | 237 | STRUCT_KW@268..274 "struct" |
238 | WHITESPACE@274..275 " " | 238 | WHITESPACE@274..275 " " |
239 | NAME@275..278 | 239 | NAME@275..278 |
diff --git a/crates/ra_syntax/test_data/parser/ok/0020_type_param_bounds.rast b/crates/ra_syntax/test_data/parser/ok/0020_type_param_bounds.rast index 5100e6a48..9bdc50e1e 100644 --- a/crates/ra_syntax/test_data/parser/ok/0020_type_param_bounds.rast +++ b/crates/ra_syntax/test_data/parser/ok/0020_type_param_bounds.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..250 | 1 | SOURCE_FILE@0..250 |
2 | STRUCT_DEF@0..12 | 2 | STRUCT@0..12 |
3 | STRUCT_KW@0..6 "struct" | 3 | STRUCT_KW@0..6 "struct" |
4 | WHITESPACE@6..7 " " | 4 | WHITESPACE@6..7 " " |
5 | NAME@7..8 | 5 | NAME@7..8 |
@@ -12,7 +12,7 @@ SOURCE_FILE@0..250 | |||
12 | R_ANGLE@10..11 ">" | 12 | R_ANGLE@10..11 ">" |
13 | SEMICOLON@11..12 ";" | 13 | SEMICOLON@11..12 ";" |
14 | WHITESPACE@12..13 "\n" | 14 | WHITESPACE@12..13 "\n" |
15 | STRUCT_DEF@13..26 | 15 | STRUCT@13..26 |
16 | STRUCT_KW@13..19 "struct" | 16 | STRUCT_KW@13..19 "struct" |
17 | WHITESPACE@19..20 " " | 17 | WHITESPACE@19..20 " " |
18 | NAME@20..21 | 18 | NAME@20..21 |
@@ -27,7 +27,7 @@ SOURCE_FILE@0..250 | |||
27 | R_ANGLE@24..25 ">" | 27 | R_ANGLE@24..25 ">" |
28 | SEMICOLON@25..26 ";" | 28 | SEMICOLON@25..26 ";" |
29 | WHITESPACE@26..27 "\n" | 29 | WHITESPACE@26..27 "\n" |
30 | STRUCT_DEF@27..43 | 30 | STRUCT@27..43 |
31 | STRUCT_KW@27..33 "struct" | 31 | STRUCT_KW@27..33 "struct" |
32 | WHITESPACE@33..34 " " | 32 | WHITESPACE@33..34 " " |
33 | NAME@34..35 | 33 | NAME@34..35 |
@@ -45,7 +45,7 @@ SOURCE_FILE@0..250 | |||
45 | R_ANGLE@41..42 ">" | 45 | R_ANGLE@41..42 ">" |
46 | SEMICOLON@42..43 ";" | 46 | SEMICOLON@42..43 ";" |
47 | WHITESPACE@43..44 "\n" | 47 | WHITESPACE@43..44 "\n" |
48 | STRUCT_DEF@44..63 | 48 | STRUCT@44..63 |
49 | STRUCT_KW@44..50 "struct" | 49 | STRUCT_KW@44..50 "struct" |
50 | WHITESPACE@50..51 " " | 50 | WHITESPACE@50..51 " " |
51 | NAME@51..52 | 51 | NAME@51..52 |
@@ -66,7 +66,7 @@ SOURCE_FILE@0..250 | |||
66 | R_ANGLE@61..62 ">" | 66 | R_ANGLE@61..62 ">" |
67 | SEMICOLON@62..63 ";" | 67 | SEMICOLON@62..63 ";" |
68 | WHITESPACE@63..64 "\n" | 68 | WHITESPACE@63..64 "\n" |
69 | STRUCT_DEF@64..86 | 69 | STRUCT@64..86 |
70 | STRUCT_KW@64..70 "struct" | 70 | STRUCT_KW@64..70 "struct" |
71 | WHITESPACE@70..71 " " | 71 | WHITESPACE@70..71 " " |
72 | NAME@71..72 | 72 | NAME@71..72 |
@@ -90,7 +90,7 @@ SOURCE_FILE@0..250 | |||
90 | R_ANGLE@84..85 ">" | 90 | R_ANGLE@84..85 ">" |
91 | SEMICOLON@85..86 ";" | 91 | SEMICOLON@85..86 ";" |
92 | WHITESPACE@86..87 "\n" | 92 | WHITESPACE@86..87 "\n" |
93 | STRUCT_DEF@87..116 | 93 | STRUCT@87..116 |
94 | STRUCT_KW@87..93 "struct" | 94 | STRUCT_KW@87..93 "struct" |
95 | WHITESPACE@93..94 " " | 95 | WHITESPACE@93..94 " " |
96 | NAME@94..95 | 96 | NAME@94..95 |
@@ -122,7 +122,7 @@ SOURCE_FILE@0..250 | |||
122 | R_ANGLE@114..115 ">" | 122 | R_ANGLE@114..115 ">" |
123 | SEMICOLON@115..116 ";" | 123 | SEMICOLON@115..116 ";" |
124 | WHITESPACE@116..117 "\n" | 124 | WHITESPACE@116..117 "\n" |
125 | STRUCT_DEF@117..143 | 125 | STRUCT@117..143 |
126 | STRUCT_KW@117..123 "struct" | 126 | STRUCT_KW@117..123 "struct" |
127 | WHITESPACE@123..124 " " | 127 | WHITESPACE@123..124 " " |
128 | NAME@124..125 | 128 | NAME@124..125 |
@@ -153,7 +153,7 @@ SOURCE_FILE@0..250 | |||
153 | R_ANGLE@141..142 ">" | 153 | R_ANGLE@141..142 ">" |
154 | SEMICOLON@142..143 ";" | 154 | SEMICOLON@142..143 ";" |
155 | WHITESPACE@143..144 "\n" | 155 | WHITESPACE@143..144 "\n" |
156 | STRUCT_DEF@144..180 | 156 | STRUCT@144..180 |
157 | STRUCT_KW@144..150 "struct" | 157 | STRUCT_KW@144..150 "struct" |
158 | WHITESPACE@150..151 " " | 158 | WHITESPACE@150..151 " " |
159 | NAME@151..152 | 159 | NAME@151..152 |
@@ -194,7 +194,7 @@ SOURCE_FILE@0..250 | |||
194 | R_ANGLE@178..179 ">" | 194 | R_ANGLE@178..179 ">" |
195 | SEMICOLON@179..180 ";" | 195 | SEMICOLON@179..180 ";" |
196 | WHITESPACE@180..181 "\n" | 196 | WHITESPACE@180..181 "\n" |
197 | STRUCT_DEF@181..199 | 197 | STRUCT@181..199 |
198 | STRUCT_KW@181..187 "struct" | 198 | STRUCT_KW@181..187 "struct" |
199 | WHITESPACE@187..188 " " | 199 | WHITESPACE@187..188 " " |
200 | NAME@188..189 | 200 | NAME@188..189 |
@@ -217,7 +217,7 @@ SOURCE_FILE@0..250 | |||
217 | R_ANGLE@197..198 ">" | 217 | R_ANGLE@197..198 ">" |
218 | SEMICOLON@198..199 ";" | 218 | SEMICOLON@198..199 ";" |
219 | WHITESPACE@199..200 "\n" | 219 | WHITESPACE@199..200 "\n" |
220 | STRUCT_DEF@200..250 | 220 | STRUCT@200..250 |
221 | STRUCT_KW@200..206 "struct" | 221 | STRUCT_KW@200..206 "struct" |
222 | WHITESPACE@206..207 " " | 222 | WHITESPACE@206..207 " " |
223 | NAME@207..208 | 223 | NAME@207..208 |
diff --git a/crates/ra_syntax/test_data/parser/ok/0040_raw_struct_item_field.rast b/crates/ra_syntax/test_data/parser/ok/0040_raw_struct_item_field.rast index 0f0138c86..8cfc14f49 100644 --- a/crates/ra_syntax/test_data/parser/ok/0040_raw_struct_item_field.rast +++ b/crates/ra_syntax/test_data/parser/ok/0040_raw_struct_item_field.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@0..27 | 1 | SOURCE_FILE@0..27 |
2 | STRUCT_DEF@0..27 | 2 | STRUCT@0..27 |
3 | STRUCT_KW@0..6 "struct" | 3 | STRUCT_KW@0..6 "struct" |
4 | WHITESPACE@6..7 " " | 4 | WHITESPACE@6..7 " " |
5 | NAME@7..8 | 5 | NAME@7..8 |
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 4f0c68822..c4ffc0a3d 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 | |||
@@ -1,7 +1,7 @@ | |||
1 | SOURCE_FILE@0..199 | 1 | SOURCE_FILE@0..199 |
2 | COMMENT@0..60 "// https://github.com ..." | 2 | COMMENT@0..60 "// https://github.com ..." |
3 | WHITESPACE@60..62 "\n\n" | 3 | WHITESPACE@60..62 "\n\n" |
4 | STRUCT_DEF@62..73 | 4 | STRUCT@62..73 |
5 | STRUCT_KW@62..68 "struct" | 5 | STRUCT_KW@62..68 "struct" |
6 | WHITESPACE@68..69 " " | 6 | WHITESPACE@68..69 " " |
7 | NAME@69..72 | 7 | NAME@69..72 |
diff --git a/crates/ra_syntax/test_data/parser/ok/0043_complex_assignment.rast b/crates/ra_syntax/test_data/parser/ok/0043_complex_assignment.rast index 9c2ea3754..adc4a22e9 100644 --- a/crates/ra_syntax/test_data/parser/ok/0043_complex_assignment.rast +++ b/crates/ra_syntax/test_data/parser/ok/0043_complex_assignment.rast | |||
@@ -1,7 +1,7 @@ | |||
1 | SOURCE_FILE@0..160 | 1 | SOURCE_FILE@0..160 |
2 | COMMENT@0..60 "// https://github.com ..." | 2 | COMMENT@0..60 "// https://github.com ..." |
3 | WHITESPACE@60..62 "\n\n" | 3 | WHITESPACE@60..62 "\n\n" |
4 | STRUCT_DEF@62..90 | 4 | STRUCT@62..90 |
5 | STRUCT_KW@62..68 "struct" | 5 | STRUCT_KW@62..68 "struct" |
6 | WHITESPACE@68..69 " " | 6 | WHITESPACE@68..69 " " |
7 | NAME@69..73 | 7 | NAME@69..73 |
diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs index 6f9186127..cb11dffd0 100644 --- a/crates/rust-analyzer/src/handlers.rs +++ b/crates/rust-analyzer/src/handlers.rs | |||
@@ -925,7 +925,7 @@ pub(crate) fn handle_code_lens( | |||
925 | matches!( | 925 | matches!( |
926 | it.kind, | 926 | it.kind, |
927 | SyntaxKind::TRAIT_DEF | 927 | SyntaxKind::TRAIT_DEF |
928 | | SyntaxKind::STRUCT_DEF | 928 | | SyntaxKind::STRUCT |
929 | | SyntaxKind::ENUM_DEF | 929 | | SyntaxKind::ENUM_DEF |
930 | | SyntaxKind::UNION | 930 | | SyntaxKind::UNION |
931 | ) | 931 | ) |
diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs index f1373fd61..a09a74c41 100644 --- a/crates/rust-analyzer/src/to_proto.rs +++ b/crates/rust-analyzer/src/to_proto.rs | |||
@@ -32,7 +32,7 @@ pub(crate) fn range(line_index: &LineIndex, range: TextRange) -> lsp_types::Rang | |||
32 | pub(crate) fn symbol_kind(syntax_kind: SyntaxKind) -> lsp_types::SymbolKind { | 32 | pub(crate) fn symbol_kind(syntax_kind: SyntaxKind) -> lsp_types::SymbolKind { |
33 | match syntax_kind { | 33 | match syntax_kind { |
34 | SyntaxKind::FN => lsp_types::SymbolKind::Function, | 34 | SyntaxKind::FN => lsp_types::SymbolKind::Function, |
35 | SyntaxKind::STRUCT_DEF => lsp_types::SymbolKind::Struct, | 35 | SyntaxKind::STRUCT => lsp_types::SymbolKind::Struct, |
36 | SyntaxKind::ENUM_DEF => lsp_types::SymbolKind::Enum, | 36 | SyntaxKind::ENUM_DEF => lsp_types::SymbolKind::Enum, |
37 | SyntaxKind::ENUM_VARIANT => lsp_types::SymbolKind::EnumMember, | 37 | SyntaxKind::ENUM_VARIANT => lsp_types::SymbolKind::EnumMember, |
38 | SyntaxKind::TRAIT_DEF => lsp_types::SymbolKind::Interface, | 38 | SyntaxKind::TRAIT_DEF => lsp_types::SymbolKind::Interface, |