diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-07-30 16:51:06 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-30 16:51:06 +0100 |
commit | 97df465391f50521c5102474d7e0ee2ea61ef48e (patch) | |
tree | 2bda021d9fafc6af927ebfbcafd31537496bd53c /crates | |
parent | 0c8944314cb323416c8ad6ad27347ca056c5a91c (diff) | |
parent | 216a5344c8ef3c3e430d2761dc8b1a7b60250a15 (diff) |
Merge #5602
5602: Rename StructDef -> Struct r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
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 | [email protected] | 492 | [email protected] |
493 | STRUCT_DEF@0..20 | 493 | [email protected] |
494 | [email protected] "struct" | 494 | [email protected] "struct" |
495 | [email protected] | 495 | [email protected] |
496 | [email protected] "Foo" | 496 | [email protected] "Foo" |
@@ -506,7 +506,7 @@ [email protected] | |||
506 | [email protected] | 506 | [email protected] |
507 | [email protected] "u32" | 507 | [email protected] "u32" |
508 | [email protected] "}" | 508 | [email protected] "}" |
509 | STRUCT_DEF@20..40 | 509 | [email protected] |
510 | [email protected] "struct" | 510 | [email protected] "struct" |
511 | [email protected] | 511 | [email protected] |
512 | [email protected] "Bar" | 512 | [email protected] "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 | [email protected] | 1 | [email protected] |
2 | STRUCT_DEF@0..34 | 2 | [email protected] |
3 | [email protected] "struct" | 3 | [email protected] "struct" |
4 | [email protected] " " | 4 | [email protected] " " |
5 | [email protected] | 5 | [email protected] |
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 @@ [email protected] | |||
5 | [email protected] | 5 | [email protected] |
6 | [email protected] "match" | 6 | [email protected] "match" |
7 | [email protected] "\n\n" | 7 | [email protected] "\n\n" |
8 | STRUCT_DEF@10..21 | 8 | [email protected] |
9 | [email protected] "struct" | 9 | [email protected] "struct" |
10 | [email protected] " " | 10 | [email protected] " " |
11 | [email protected] | 11 | [email protected] |
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 | [email protected] | 1 | [email protected] |
2 | STRUCT_DEF@0..39 | 2 | [email protected] |
3 | [email protected] "struct" | 3 | [email protected] "struct" |
4 | [email protected] " " | 4 | [email protected] " " |
5 | [email protected] | 5 | [email protected] |
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 | [email protected] | 1 | [email protected] |
2 | STRUCT_DEF@0..73 | 2 | [email protected] |
3 | [email protected] "struct" | 3 | [email protected] "struct" |
4 | [email protected] " " | 4 | [email protected] " " |
5 | [email protected] | 5 | [email protected] |
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 @@ [email protected] | |||
2 | [email protected] | 2 | [email protected] |
3 | [email protected] "}" | 3 | [email protected] "}" |
4 | [email protected] "\n\n" | 4 | [email protected] "\n\n" |
5 | STRUCT_DEF@3..12 | 5 | [email protected] |
6 | [email protected] "struct" | 6 | [email protected] "struct" |
7 | [email protected] " " | 7 | [email protected] " " |
8 | [email protected] | 8 | [email protected] |
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 | [email protected] | 1 | [email protected] |
2 | STRUCT_DEF@0..11 | 2 | [email protected] |
3 | [email protected] "struct" | 3 | [email protected] "struct" |
4 | [email protected] " " | 4 | [email protected] " " |
5 | [email protected] | 5 | [email protected] |
@@ -38,7 +38,7 @@ [email protected] | |||
38 | [email protected] "\n" | 38 | [email protected] "\n" |
39 | [email protected] "}" | 39 | [email protected] "}" |
40 | [email protected] "\n\n" | 40 | [email protected] "\n\n" |
41 | STRUCT_DEF@33..42 | 41 | [email protected] |
42 | [email protected] "struct" | 42 | [email protected] "struct" |
43 | [email protected] " " | 43 | [email protected] " " |
44 | [email protected] | 44 | [email protected] |
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 @@ [email protected] | |||
3 | [email protected] | 3 | [email protected] |
4 | [email protected] "extern" | 4 | [email protected] "extern" |
5 | [email protected] " " | 5 | [email protected] " " |
6 | STRUCT_DEF@7..18 | 6 | [email protected] |
7 | [email protected] "struct" | 7 | [email protected] "struct" |
8 | [email protected] " " | 8 | [email protected] " " |
9 | [email protected] | 9 | [email protected] |
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 | [email protected] | 1 | [email protected] |
2 | STRUCT_DEF@0..72 | 2 | [email protected] |
3 | [email protected] | 3 | [email protected] |
4 | [email protected] "pub" | 4 | [email protected] "pub" |
5 | [email protected] " " | 5 | [email protected] " " |
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 @@ [email protected] | |||
28 | [email protected] | 28 | [email protected] |
29 | [email protected] "," | 29 | [email protected] "," |
30 | [email protected] " " | 30 | [email protected] " " |
31 | STRUCT_DEF@19..26 | 31 | [email protected] |
32 | [email protected] "struct" | 32 | [email protected] "struct" |
33 | [email protected] | 33 | [email protected] |
34 | [email protected] "," | 34 | [email protected] "," |
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 | [email protected] | 1 | [email protected] |
2 | STRUCT_DEF@0..34 | 2 | [email protected] |
3 | [email protected] "struct" | 3 | [email protected] "struct" |
4 | [email protected] " " | 4 | [email protected] " " |
5 | [email protected] | 5 | [email protected] |
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 | [email protected] | 1 | [email protected] |
2 | STRUCT_DEF@0..20 | 2 | [email protected] |
3 | [email protected] | 3 | [email protected] |
4 | [email protected] "pub" | 4 | [email protected] "pub" |
5 | [email protected] "(" | 5 | [email protected] "(" |
@@ -12,7 +12,7 @@ [email protected] | |||
12 | [email protected] "S" | 12 | [email protected] "S" |
13 | [email protected] ";" | 13 | [email protected] ";" |
14 | [email protected] "\n" | 14 | [email protected] "\n" |
15 | STRUCT_DEF@21..40 | 15 | [email protected] |
16 | [email protected] | 16 | [email protected] |
17 | [email protected] "pub" | 17 | [email protected] "pub" |
18 | [email protected] "(" | 18 | [email protected] "(" |
@@ -25,7 +25,7 @@ [email protected] | |||
25 | [email protected] "S" | 25 | [email protected] "S" |
26 | [email protected] ";" | 26 | [email protected] ";" |
27 | [email protected] "\n" | 27 | [email protected] "\n" |
28 | STRUCT_DEF@41..60 | 28 | [email protected] |
29 | [email protected] | 29 | [email protected] |
30 | [email protected] "pub" | 30 | [email protected] "pub" |
31 | [email protected] "(" | 31 | [email protected] "(" |
@@ -38,7 +38,7 @@ [email protected] | |||
38 | [email protected] "S" | 38 | [email protected] "S" |
39 | [email protected] ";" | 39 | [email protected] ";" |
40 | [email protected] "\n" | 40 | [email protected] "\n" |
41 | STRUCT_DEF@61..80 | 41 | [email protected] |
42 | [email protected] | 42 | [email protected] |
43 | [email protected] "pub" | 43 | [email protected] "pub" |
44 | [email protected] "(" | 44 | [email protected] "(" |
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 @@ [email protected] | |||
16 | [email protected] " " | 16 | [email protected] " " |
17 | [email protected] "}" | 17 | [email protected] "}" |
18 | [email protected] "\n" | 18 | [email protected] "\n" |
19 | STRUCT_DEF@20..49 | 19 | [email protected] |
20 | [email protected] "struct" | 20 | [email protected] "struct" |
21 | [email protected] " " | 21 | [email protected] " " |
22 | [email protected] | 22 | [email protected] |
@@ -41,7 +41,7 @@ [email protected] | |||
41 | [email protected] " " | 41 | [email protected] " " |
42 | [email protected] "}" | 42 | [email protected] "}" |
43 | [email protected] "\n" | 43 | [email protected] "\n" |
44 | STRUCT_DEF@50..70 | 44 | [email protected] |
45 | [email protected] "struct" | 45 | [email protected] "struct" |
46 | [email protected] " " | 46 | [email protected] " " |
47 | [email protected] | 47 | [email protected] |
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 | [email protected] | 1 | [email protected] |
2 | STRUCT_DEF@0..63 | 2 | [email protected] |
3 | [email protected] "struct" | 3 | [email protected] "struct" |
4 | [email protected] " " | 4 | [email protected] " " |
5 | [email protected] | 5 | [email protected] |
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 @@ [email protected] | |||
57 | [email protected] "{" | 57 | [email protected] "{" |
58 | [email protected] "}" | 58 | [email protected] "}" |
59 | [email protected] "\n" | 59 | [email protected] "\n" |
60 | STRUCT_DEF@60..69 | 60 | [email protected] |
61 | [email protected] "struct" | 61 | [email protected] "struct" |
62 | [email protected] " " | 62 | [email protected] " " |
63 | [email protected] | 63 | [email protected] |
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 | [email protected] | 1 | [email protected] |
2 | STRUCT_DEF@0..11 | 2 | [email protected] |
3 | [email protected] "struct" | 3 | [email protected] "struct" |
4 | [email protected] " " | 4 | [email protected] " " |
5 | [email protected] | 5 | [email protected] |
6 | [email protected] "Foo" | 6 | [email protected] "Foo" |
7 | [email protected] ";" | 7 | [email protected] ";" |
8 | [email protected] "\n" | 8 | [email protected] "\n" |
9 | STRUCT_DEF@12..25 | 9 | [email protected] |
10 | [email protected] "struct" | 10 | [email protected] "struct" |
11 | [email protected] " " | 11 | [email protected] " " |
12 | [email protected] | 12 | [email protected] |
@@ -16,7 +16,7 @@ [email protected] | |||
16 | [email protected] "{" | 16 | [email protected] "{" |
17 | [email protected] "}" | 17 | [email protected] "}" |
18 | [email protected] "\n" | 18 | [email protected] "\n" |
19 | STRUCT_DEF@26..39 | 19 | [email protected] |
20 | [email protected] "struct" | 20 | [email protected] "struct" |
21 | [email protected] " " | 21 | [email protected] " " |
22 | [email protected] | 22 | [email protected] |
@@ -26,7 +26,7 @@ [email protected] | |||
26 | [email protected] ")" | 26 | [email protected] ")" |
27 | [email protected] ";" | 27 | [email protected] ";" |
28 | [email protected] "\n" | 28 | [email protected] "\n" |
29 | STRUCT_DEF@40..66 | 29 | [email protected] |
30 | [email protected] "struct" | 30 | [email protected] "struct" |
31 | [email protected] " " | 31 | [email protected] " " |
32 | [email protected] | 32 | [email protected] |
@@ -50,7 +50,7 @@ [email protected] | |||
50 | [email protected] ")" | 50 | [email protected] ")" |
51 | [email protected] ";" | 51 | [email protected] ";" |
52 | [email protected] "\n" | 52 | [email protected] "\n" |
53 | STRUCT_DEF@67..105 | 53 | [email protected] |
54 | [email protected] "struct" | 54 | [email protected] "struct" |
55 | [email protected] " " | 55 | [email protected] " " |
56 | [email protected] | 56 | [email protected] |
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 | [email protected] | 1 | [email protected] |
2 | STRUCT_DEF@0..18 | 2 | [email protected] |
3 | [email protected] "struct" | 3 | [email protected] "struct" |
4 | [email protected] " " | 4 | [email protected] " " |
5 | [email protected] | 5 | [email protected] |
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 | [email protected] | 1 | [email protected] |
2 | STRUCT_DEF@0..33 | 2 | [email protected] |
3 | [email protected] "struct" | 3 | [email protected] "struct" |
4 | [email protected] " " | 4 | [email protected] " " |
5 | [email protected] | 5 | [email protected] |
@@ -40,7 +40,7 @@ [email protected] | |||
40 | [email protected] "Clone" | 40 | [email protected] "Clone" |
41 | [email protected] ";" | 41 | [email protected] ";" |
42 | [email protected] "\n" | 42 | [email protected] "\n" |
43 | STRUCT_DEF@34..52 | 43 | [email protected] |
44 | [email protected] "struct" | 44 | [email protected] "struct" |
45 | [email protected] " " | 45 | [email protected] " " |
46 | [email protected] | 46 | [email protected] |
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 | [email protected] | 1 | [email protected] |
2 | STRUCT_DEF@0..59 | 2 | [email protected] |
3 | [email protected] "struct" | 3 | [email protected] "struct" |
4 | [email protected] " " | 4 | [email protected] " " |
5 | [email protected] | 5 | [email protected] |
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 @@ [email protected] | |||
47 | [email protected] "}" | 47 | [email protected] "}" |
48 | [email protected] ";" | 48 | [email protected] ";" |
49 | [email protected] "\n " | 49 | [email protected] "\n " |
50 | STRUCT_DEF@96..107 | 50 | [email protected] |
51 | [email protected] "struct" | 51 | [email protected] "struct" |
52 | [email protected] " " | 52 | [email protected] " " |
53 | [email protected] | 53 | [email protected] |
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 | [email protected] | 1 | [email protected] |
2 | STRUCT_DEF@0..23 | 2 | [email protected] |
3 | [email protected] "struct" | 3 | [email protected] "struct" |
4 | [email protected] " " | 4 | [email protected] " " |
5 | [email protected] | 5 | [email protected] |
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 | [email protected] | 1 | [email protected] |
2 | STRUCT_DEF@0..31 | 2 | [email protected] |
3 | [email protected] "struct" | 3 | [email protected] "struct" |
4 | [email protected] " " | 4 | [email protected] " " |
5 | [email protected] | 5 | [email protected] |
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 | [email protected] | 1 | [email protected] |
2 | STRUCT_DEF@0..25 | 2 | [email protected] |
3 | [email protected] "struct" | 3 | [email protected] "struct" |
4 | [email protected] " " | 4 | [email protected] " " |
5 | [email protected] | 5 | [email protected] |
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 @@ [email protected] | |||
40 | [email protected] "\n " | 40 | [email protected] "\n " |
41 | [email protected] "}" | 41 | [email protected] "}" |
42 | [email protected] "\n " | 42 | [email protected] "\n " |
43 | STRUCT_DEF@52..63 | 43 | [email protected] |
44 | [email protected] "struct" | 44 | [email protected] "struct" |
45 | [email protected] " " | 45 | [email protected] " " |
46 | [email protected] | 46 | [email protected] |
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 | [email protected] | 1 | [email protected] |
2 | STRUCT_DEF@0..9 | 2 | [email protected] |
3 | [email protected] "struct" | 3 | [email protected] "struct" |
4 | [email protected] " " | 4 | [email protected] " " |
5 | [email protected] | 5 | [email protected] |
6 | [email protected] "A" | 6 | [email protected] "A" |
7 | [email protected] ";" | 7 | [email protected] ";" |
8 | [email protected] "\n" | 8 | [email protected] "\n" |
9 | STRUCT_DEF@10..21 | 9 | [email protected] |
10 | [email protected] "struct" | 10 | [email protected] "struct" |
11 | [email protected] " " | 11 | [email protected] " " |
12 | [email protected] | 12 | [email protected] |
@@ -16,7 +16,7 @@ [email protected] | |||
16 | [email protected] "{" | 16 | [email protected] "{" |
17 | [email protected] "}" | 17 | [email protected] "}" |
18 | [email protected] "\n" | 18 | [email protected] "\n" |
19 | STRUCT_DEF@22..33 | 19 | [email protected] |
20 | [email protected] "struct" | 20 | [email protected] "struct" |
21 | [email protected] " " | 21 | [email protected] " " |
22 | [email protected] | 22 | [email protected] |
@@ -26,7 +26,7 @@ [email protected] | |||
26 | [email protected] ")" | 26 | [email protected] ")" |
27 | [email protected] ";" | 27 | [email protected] ";" |
28 | [email protected] "\n\n" | 28 | [email protected] "\n\n" |
29 | STRUCT_DEF@35..74 | 29 | [email protected] |
30 | [email protected] "struct" | 30 | [email protected] "struct" |
31 | [email protected] " " | 31 | [email protected] " " |
32 | [email protected] | 32 | [email protected] |
@@ -63,7 +63,7 @@ [email protected] | |||
63 | [email protected] "\n" | 63 | [email protected] "\n" |
64 | [email protected] "}" | 64 | [email protected] "}" |
65 | [email protected] "\n\n" | 65 | [email protected] "\n\n" |
66 | STRUCT_DEF@76..96 | 66 | [email protected] |
67 | [email protected] "struct" | 67 | [email protected] "struct" |
68 | [email protected] " " | 68 | [email protected] " " |
69 | [email protected] | 69 | [email protected] |
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 | [email protected] | 1 | [email protected] |
2 | STRUCT_DEF@0..13 | 2 | [email protected] |
3 | [email protected] "struct" | 3 | [email protected] "struct" |
4 | [email protected] " " | 4 | [email protected] " " |
5 | [email protected] | 5 | [email protected] |
@@ -12,7 +12,7 @@ [email protected] | |||
12 | [email protected] ">" | 12 | [email protected] ">" |
13 | [email protected] ";" | 13 | [email protected] ";" |
14 | [email protected] "\n" | 14 | [email protected] "\n" |
15 | STRUCT_DEF@14..32 | 15 | [email protected] |
16 | [email protected] "struct" | 16 | [email protected] "struct" |
17 | [email protected] " " | 17 | [email protected] " " |
18 | [email protected] | 18 | [email protected] |
@@ -34,7 +34,7 @@ [email protected] | |||
34 | [email protected] ")" | 34 | [email protected] ")" |
35 | [email protected] ";" | 35 | [email protected] ";" |
36 | [email protected] "\n" | 36 | [email protected] "\n" |
37 | STRUCT_DEF@33..56 | 37 | [email protected] |
38 | [email protected] "struct" | 38 | [email protected] "struct" |
39 | [email protected] " " | 39 | [email protected] " " |
40 | [email protected] | 40 | [email protected] |
@@ -62,7 +62,7 @@ [email protected] | |||
62 | [email protected] " " | 62 | [email protected] " " |
63 | [email protected] "}" | 63 | [email protected] "}" |
64 | [email protected] "\n\n" | 64 | [email protected] "\n\n" |
65 | STRUCT_DEF@58..70 | 65 | [email protected] |
66 | [email protected] "struct" | 66 | [email protected] "struct" |
67 | [email protected] " " | 67 | [email protected] " " |
68 | [email protected] | 68 | [email protected] |
@@ -72,7 +72,7 @@ [email protected] | |||
72 | [email protected] ">" | 72 | [email protected] ">" |
73 | [email protected] ";" | 73 | [email protected] ";" |
74 | [email protected] "\n" | 74 | [email protected] "\n" |
75 | STRUCT_DEF@71..85 | 75 | [email protected] |
76 | [email protected] "struct" | 76 | [email protected] "struct" |
77 | [email protected] " " | 77 | [email protected] " " |
78 | [email protected] | 78 | [email protected] |
@@ -84,7 +84,7 @@ [email protected] | |||
84 | [email protected] ">" | 84 | [email protected] ">" |
85 | [email protected] ";" | 85 | [email protected] ";" |
86 | [email protected] "\n" | 86 | [email protected] "\n" |
87 | STRUCT_DEF@86..101 | 87 | [email protected] |
88 | [email protected] "struct" | 88 | [email protected] "struct" |
89 | [email protected] " " | 89 | [email protected] " " |
90 | [email protected] | 90 | [email protected] |
@@ -97,7 +97,7 @@ [email protected] | |||
97 | [email protected] ">" | 97 | [email protected] ">" |
98 | [email protected] ";" | 98 | [email protected] ";" |
99 | [email protected] "\n" | 99 | [email protected] "\n" |
100 | STRUCT_DEF@102..120 | 100 | [email protected] |
101 | [email protected] "struct" | 101 | [email protected] "struct" |
102 | [email protected] " " | 102 | [email protected] " " |
103 | [email protected] | 103 | [email protected] |
@@ -112,7 +112,7 @@ [email protected] | |||
112 | [email protected] ">" | 112 | [email protected] ">" |
113 | [email protected] ";" | 113 | [email protected] ";" |
114 | [email protected] "\n" | 114 | [email protected] "\n" |
115 | STRUCT_DEF@121..142 | 115 | [email protected] |
116 | [email protected] "struct" | 116 | [email protected] "struct" |
117 | [email protected] " " | 117 | [email protected] " " |
118 | [email protected] | 118 | [email protected] |
@@ -130,7 +130,7 @@ [email protected] | |||
130 | [email protected] ">" | 130 | [email protected] ">" |
131 | [email protected] ";" | 131 | [email protected] ";" |
132 | [email protected] "\n" | 132 | [email protected] "\n" |
133 | STRUCT_DEF@143..166 | 133 | [email protected] |
134 | [email protected] "struct" | 134 | [email protected] "struct" |
135 | [email protected] " " | 135 | [email protected] " " |
136 | [email protected] | 136 | [email protected] |
@@ -149,7 +149,7 @@ [email protected] | |||
149 | [email protected] ">" | 149 | [email protected] ">" |
150 | [email protected] ";" | 150 | [email protected] ";" |
151 | [email protected] "\n" | 151 | [email protected] "\n" |
152 | STRUCT_DEF@167..183 | 152 | [email protected] |
153 | [email protected] "struct" | 153 | [email protected] "struct" |
154 | [email protected] " " | 154 | [email protected] " " |
155 | [email protected] | 155 | [email protected] |
@@ -162,7 +162,7 @@ [email protected] | |||
162 | [email protected] ">" | 162 | [email protected] ">" |
163 | [email protected] ";" | 163 | [email protected] ";" |
164 | [email protected] "\n" | 164 | [email protected] "\n" |
165 | STRUCT_DEF@184..203 | 165 | [email protected] |
166 | [email protected] "struct" | 166 | [email protected] "struct" |
167 | [email protected] " " | 167 | [email protected] " " |
168 | [email protected] | 168 | [email protected] |
@@ -178,7 +178,7 @@ [email protected] | |||
178 | [email protected] ">" | 178 | [email protected] ">" |
179 | [email protected] ";" | 179 | [email protected] ";" |
180 | [email protected] "\n" | 180 | [email protected] "\n" |
181 | STRUCT_DEF@204..233 | 181 | [email protected] |
182 | [email protected] "struct" | 182 | [email protected] "struct" |
183 | [email protected] " " | 183 | [email protected] " " |
184 | [email protected] | 184 | [email protected] |
@@ -202,7 +202,7 @@ [email protected] | |||
202 | [email protected] ">" | 202 | [email protected] ">" |
203 | [email protected] ";" | 203 | [email protected] ";" |
204 | [email protected] "\n\n" | 204 | [email protected] "\n\n" |
205 | STRUCT_DEF@235..249 | 205 | [email protected] |
206 | [email protected] "struct" | 206 | [email protected] "struct" |
207 | [email protected] " " | 207 | [email protected] " " |
208 | [email protected] | 208 | [email protected] |
@@ -215,7 +215,7 @@ [email protected] | |||
215 | [email protected] ">" | 215 | [email protected] ">" |
216 | [email protected] ";" | 216 | [email protected] ";" |
217 | [email protected] "\n" | 217 | [email protected] "\n" |
218 | STRUCT_DEF@250..267 | 218 | [email protected] |
219 | [email protected] "struct" | 219 | [email protected] "struct" |
220 | [email protected] " " | 220 | [email protected] " " |
221 | [email protected] | 221 | [email protected] |
@@ -233,7 +233,7 @@ [email protected] | |||
233 | [email protected] ">" | 233 | [email protected] ">" |
234 | [email protected] ";" | 234 | [email protected] ";" |
235 | [email protected] "\n" | 235 | [email protected] "\n" |
236 | STRUCT_DEF@268..289 | 236 | [email protected] |
237 | [email protected] "struct" | 237 | [email protected] "struct" |
238 | [email protected] " " | 238 | [email protected] " " |
239 | [email protected] | 239 | [email protected] |
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 | [email protected] | 1 | [email protected] |
2 | STRUCT_DEF@0..12 | 2 | [email protected] |
3 | [email protected] "struct" | 3 | [email protected] "struct" |
4 | [email protected] " " | 4 | [email protected] " " |
5 | [email protected] | 5 | [email protected] |
@@ -12,7 +12,7 @@ [email protected] | |||
12 | [email protected] ">" | 12 | [email protected] ">" |
13 | [email protected] ";" | 13 | [email protected] ";" |
14 | [email protected] "\n" | 14 | [email protected] "\n" |
15 | STRUCT_DEF@13..26 | 15 | [email protected] |
16 | [email protected] "struct" | 16 | [email protected] "struct" |
17 | [email protected] " " | 17 | [email protected] " " |
18 | [email protected] | 18 | [email protected] |
@@ -27,7 +27,7 @@ [email protected] | |||
27 | [email protected] ">" | 27 | [email protected] ">" |
28 | [email protected] ";" | 28 | [email protected] ";" |
29 | [email protected] "\n" | 29 | [email protected] "\n" |
30 | STRUCT_DEF@27..43 | 30 | [email protected] |
31 | [email protected] "struct" | 31 | [email protected] "struct" |
32 | [email protected] " " | 32 | [email protected] " " |
33 | [email protected] | 33 | [email protected] |
@@ -45,7 +45,7 @@ [email protected] | |||
45 | [email protected] ">" | 45 | [email protected] ">" |
46 | [email protected] ";" | 46 | [email protected] ";" |
47 | [email protected] "\n" | 47 | [email protected] "\n" |
48 | STRUCT_DEF@44..63 | 48 | [email protected] |
49 | [email protected] "struct" | 49 | [email protected] "struct" |
50 | [email protected] " " | 50 | [email protected] " " |
51 | [email protected] | 51 | [email protected] |
@@ -66,7 +66,7 @@ [email protected] | |||
66 | [email protected] ">" | 66 | [email protected] ">" |
67 | [email protected] ";" | 67 | [email protected] ";" |
68 | [email protected] "\n" | 68 | [email protected] "\n" |
69 | STRUCT_DEF@64..86 | 69 | [email protected] |
70 | [email protected] "struct" | 70 | [email protected] "struct" |
71 | [email protected] " " | 71 | [email protected] " " |
72 | [email protected] | 72 | [email protected] |
@@ -90,7 +90,7 @@ [email protected] | |||
90 | [email protected] ">" | 90 | [email protected] ">" |
91 | [email protected] ";" | 91 | [email protected] ";" |
92 | [email protected] "\n" | 92 | [email protected] "\n" |
93 | STRUCT_DEF@87..116 | 93 | [email protected] |
94 | [email protected] "struct" | 94 | [email protected] "struct" |
95 | [email protected] " " | 95 | [email protected] " " |
96 | [email protected] | 96 | [email protected] |
@@ -122,7 +122,7 @@ [email protected] | |||
122 | [email protected] ">" | 122 | [email protected] ">" |
123 | [email protected] ";" | 123 | [email protected] ";" |
124 | [email protected] "\n" | 124 | [email protected] "\n" |
125 | STRUCT_DEF@117..143 | 125 | [email protected] |
126 | [email protected] "struct" | 126 | [email protected] "struct" |
127 | [email protected] " " | 127 | [email protected] " " |
128 | [email protected] | 128 | [email protected] |
@@ -153,7 +153,7 @@ [email protected] | |||
153 | [email protected] ">" | 153 | [email protected] ">" |
154 | [email protected] ";" | 154 | [email protected] ";" |
155 | [email protected] "\n" | 155 | [email protected] "\n" |
156 | STRUCT_DEF@144..180 | 156 | [email protected] |
157 | [email protected] "struct" | 157 | [email protected] "struct" |
158 | [email protected] " " | 158 | [email protected] " " |
159 | [email protected] | 159 | [email protected] |
@@ -194,7 +194,7 @@ [email protected] | |||
194 | [email protected] ">" | 194 | [email protected] ">" |
195 | [email protected] ";" | 195 | [email protected] ";" |
196 | [email protected] "\n" | 196 | [email protected] "\n" |
197 | STRUCT_DEF@181..199 | 197 | [email protected] |
198 | [email protected] "struct" | 198 | [email protected] "struct" |
199 | [email protected] " " | 199 | [email protected] " " |
200 | [email protected] | 200 | [email protected] |
@@ -217,7 +217,7 @@ [email protected] | |||
217 | [email protected] ">" | 217 | [email protected] ">" |
218 | [email protected] ";" | 218 | [email protected] ";" |
219 | [email protected] "\n" | 219 | [email protected] "\n" |
220 | STRUCT_DEF@200..250 | 220 | [email protected] |
221 | [email protected] "struct" | 221 | [email protected] "struct" |
222 | [email protected] " " | 222 | [email protected] " " |
223 | [email protected] | 223 | [email protected] |
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 | [email protected] | 1 | [email protected] |
2 | STRUCT_DEF@0..27 | 2 | [email protected] |
3 | [email protected] "struct" | 3 | [email protected] "struct" |
4 | [email protected] " " | 4 | [email protected] " " |
5 | [email protected] | 5 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/ok/0042_ufcs_call_list.rast b/crates/ra_syntax/test_data/parser/ok/0042_ufcs_call_list.rast index 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 | [email protected] | 1 | [email protected] |
2 | [email protected] "// https://github.com ..." | 2 | [email protected] "// https://github.com ..." |
3 | [email protected] "\n\n" | 3 | [email protected] "\n\n" |
4 | STRUCT_DEF@62..73 | 4 | [email protected] |
5 | [email protected] "struct" | 5 | [email protected] "struct" |
6 | [email protected] " " | 6 | [email protected] " " |
7 | [email protected] | 7 | [email protected] |
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 | [email protected] | 1 | [email protected] |
2 | [email protected] "// https://github.com ..." | 2 | [email protected] "// https://github.com ..." |
3 | [email protected] "\n\n" | 3 | [email protected] "\n\n" |
4 | STRUCT_DEF@62..90 | 4 | [email protected] |
5 | [email protected] "struct" | 5 | [email protected] "struct" |
6 | [email protected] " " | 6 | [email protected] " " |
7 | [email protected] | 7 | [email protected] |
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, |