diff options
author | Aleksey Kladov <[email protected]> | 2020-07-30 16:50:40 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-07-30 16:50:40 +0100 |
commit | 216a5344c8ef3c3e430d2761dc8b1a7b60250a15 (patch) | |
tree | 2bda021d9fafc6af927ebfbcafd31537496bd53c /crates/ra_ide | |
parent | 1ae4721c9cfea746fce59a816b1c266bf373d6cf (diff) |
Rename StructDef -> Struct
Diffstat (limited to 'crates/ra_ide')
-rw-r--r-- | crates/ra_ide/src/display/navigation_target.rs | 4 | ||||
-rw-r--r-- | crates/ra_ide/src/display/short_label.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide/src/file_structure.rs | 4 | ||||
-rw-r--r-- | crates/ra_ide/src/goto_implementation.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide/src/hover.rs | 34 | ||||
-rw-r--r-- | crates/ra_ide/src/references.rs | 16 | ||||
-rw-r--r-- | crates/ra_ide/src/syntax_highlighting.rs | 2 |
7 files changed, 32 insertions, 32 deletions
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, |