From 1142112c70b705f59b7d559d9d72cdc831865158 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 14:51:08 +0200 Subject: Rename FnDef -> Fn --- crates/ra_ide/src/references.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/ra_ide/src/references.rs') diff --git a/crates/ra_ide/src/references.rs b/crates/ra_ide/src/references.rs index fe1c074d1..8d3452a83 100644 --- a/crates/ra_ide/src/references.rs +++ b/crates/ra_ide/src/references.rs @@ -376,7 +376,7 @@ impl Foo { } "#, ); - check_result(refs, "f FN_DEF FileId(1) 27..43 30..31 Other", &[]); + check_result(refs, "f FN FileId(1) 27..43 30..31 Other", &[]); } #[test] @@ -514,7 +514,7 @@ pub(super) struct Foo<|> { let refs = analysis.find_all_refs(pos, None).unwrap().unwrap(); check_result( refs, - "quux FN_DEF FileId(1) 19..35 26..30 Other", + "quux FN FileId(1) 19..35 26..30 Other", &["FileId(2) 16..20 StructLiteral", "FileId(3) 16..20 StructLiteral"], ); @@ -522,7 +522,7 @@ pub(super) struct Foo<|> { analysis.find_all_refs(pos, Some(SearchScope::single_file(bar))).unwrap().unwrap(); check_result( refs, - "quux FN_DEF FileId(1) 19..35 26..30 Other", + "quux FN FileId(1) 19..35 26..30 Other", &["FileId(3) 16..20 StructLiteral"], ); } @@ -619,7 +619,7 @@ fn main() { ); check_result( refs, - "new FN_DEF FileId(1) 54..101 61..64 Other", + "new FN FileId(1) 54..101 61..64 Other", &["FileId(1) 146..149 StructLiteral"], ); } @@ -646,7 +646,7 @@ fn main() { let refs = analysis.find_all_refs(pos, None).unwrap().unwrap(); check_result( refs, - "f FN_DEF FileId(1) 26..35 29..30 Other", + "f FN FileId(1) 26..35 29..30 Other", &["FileId(2) 11..12 Other", "FileId(2) 28..29 StructLiteral"], ); } -- cgit v1.2.3 From 28ef4c375a9f56d69daf885504aea3df7012bb81 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 15:36:21 +0200 Subject: Rename TypeParamList -> GenericParamList --- crates/ra_ide/src/references.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_ide/src/references.rs') diff --git a/crates/ra_ide/src/references.rs b/crates/ra_ide/src/references.rs index 8d3452a83..94d03a07f 100644 --- a/crates/ra_ide/src/references.rs +++ b/crates/ra_ide/src/references.rs @@ -175,7 +175,7 @@ fn get_struct_def_name_for_struct_literal_search( return name.syntax().ancestors().find_map(ast::StructDef::cast).and_then(|l| l.name()); } if sema - .find_node_at_offset_with_descend::( + .find_node_at_offset_with_descend::( &syntax, left.text_range().start(), ) -- cgit v1.2.3 From 0a9e3ccc262fbcbd4cdaab30384f8cb71584544b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 16:49:13 +0200 Subject: Rename FieldDef -> Field --- crates/ra_ide/src/references.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_ide/src/references.rs') diff --git a/crates/ra_ide/src/references.rs b/crates/ra_ide/src/references.rs index 94d03a07f..d61ac271e 100644 --- a/crates/ra_ide/src/references.rs +++ b/crates/ra_ide/src/references.rs @@ -361,7 +361,7 @@ fn main(s: Foo) { ); check_result( refs, - "spam RECORD_FIELD_DEF FileId(1) 17..30 21..25 Other", + "spam RECORD_FIELD FileId(1) 17..30 21..25 Other", &["FileId(1) 67..71 Other Read"], ); } @@ -580,7 +580,7 @@ fn foo() { ); check_result( refs, - "f RECORD_FIELD_DEF FileId(1) 15..21 15..16 Other", + "f RECORD_FIELD FileId(1) 15..21 15..16 Other", &["FileId(1) 55..56 Other Read", "FileId(1) 68..69 Other Write"], ); } -- cgit v1.2.3 From 216a5344c8ef3c3e430d2761dc8b1a7b60250a15 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 17:50:40 +0200 Subject: Rename StructDef -> Struct --- crates/ra_ide/src/references.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'crates/ra_ide/src/references.rs') 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( if let Some(name) = sema.find_node_at_offset_with_descend::(&syntax, left.text_range().start()) { - return name.syntax().ancestors().find_map(ast::StructDef::cast).and_then(|l| l.name()); + return name.syntax().ancestors().find_map(ast::Struct::cast).and_then(|l| l.name()); } if sema .find_node_at_offset_with_descend::( @@ -181,7 +181,7 @@ fn get_struct_def_name_for_struct_literal_search( ) .is_some() { - return left.ancestors().find_map(ast::StructDef::cast).and_then(|l| l.name()); + return left.ancestors().find_map(ast::Struct::cast).and_then(|l| l.name()); } } None @@ -212,7 +212,7 @@ fn main() { ); check_result( refs, - "Foo STRUCT_DEF FileId(1) 0..26 7..10 Other", + "Foo STRUCT FileId(1) 0..26 7..10 Other", &["FileId(1) 101..104 StructLiteral"], ); } @@ -230,7 +230,7 @@ struct Foo<|> {} ); check_result( refs, - "Foo STRUCT_DEF FileId(1) 0..13 7..10 Other", + "Foo STRUCT FileId(1) 0..13 7..10 Other", &["FileId(1) 41..44 Other", "FileId(1) 54..57 StructLiteral"], ); } @@ -248,7 +248,7 @@ struct Foo <|>{} ); check_result( refs, - "Foo STRUCT_DEF FileId(1) 0..16 7..10 Other", + "Foo STRUCT FileId(1) 0..16 7..10 Other", &["FileId(1) 64..67 StructLiteral"], ); } @@ -267,7 +267,7 @@ fn main() { ); check_result( refs, - "Foo STRUCT_DEF FileId(1) 0..16 7..10 Other", + "Foo STRUCT FileId(1) 0..16 7..10 Other", &["FileId(1) 54..57 StructLiteral"], ); } @@ -431,7 +431,7 @@ fn f() { let refs = analysis.find_all_refs(pos, None).unwrap().unwrap(); check_result( refs, - "Foo STRUCT_DEF FileId(2) 17..51 28..31 Other", + "Foo STRUCT FileId(2) 17..51 28..31 Other", &["FileId(1) 53..56 StructLiteral", "FileId(3) 79..82 StructLiteral"], ); } @@ -486,7 +486,7 @@ pub(super) struct Foo<|> { let refs = analysis.find_all_refs(pos, None).unwrap().unwrap(); check_result( refs, - "Foo STRUCT_DEF FileId(3) 0..41 18..21 Other", + "Foo STRUCT FileId(3) 0..41 18..21 Other", &["FileId(2) 20..23 Other", "FileId(2) 47..50 StructLiteral"], ); } -- cgit v1.2.3 From 1766aae145c6925a33e427f2fe6ef2a56c301665 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 17:56:53 +0200 Subject: Rename EnumVariant -> Variant --- crates/ra_ide/src/references.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_ide/src/references.rs') diff --git a/crates/ra_ide/src/references.rs b/crates/ra_ide/src/references.rs index 2a62dab6c..519e4bf1a 100644 --- a/crates/ra_ide/src/references.rs +++ b/crates/ra_ide/src/references.rs @@ -390,7 +390,7 @@ enum Foo { } "#, ); - check_result(refs, "B ENUM_VARIANT FileId(1) 22..23 22..23 Other", &[]); + check_result(refs, "B VARIANT FileId(1) 22..23 22..23 Other", &[]); } #[test] -- cgit v1.2.3 From 98181087984157e27faba0b969e384f3c62c39d5 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 20:09:09 +0200 Subject: Rename BindPat -> IdentPat --- crates/ra_ide/src/references.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'crates/ra_ide/src/references.rs') diff --git a/crates/ra_ide/src/references.rs b/crates/ra_ide/src/references.rs index 519e4bf1a..cf456630a 100644 --- a/crates/ra_ide/src/references.rs +++ b/crates/ra_ide/src/references.rs @@ -150,7 +150,7 @@ fn decl_access(def: &Definition, syntax: &SyntaxNode, range: TextRange) -> Optio let stmt = find_node_at_offset::(syntax, range.start())?; if stmt.initializer().is_some() { let pat = stmt.pat()?; - if let ast::Pat::BindPat(it) = pat { + if let ast::Pat::IdentPat(it) = pat { if it.mut_token().is_some() { return Some(ReferenceAccess::Write); } @@ -290,7 +290,7 @@ fn main() { ); check_result( refs, - "i BIND_PAT FileId(1) 24..25 Other Write", + "i IDENT_PAT FileId(1) 24..25 Other Write", &[ "FileId(1) 50..51 Other Write", "FileId(1) 54..55 Other Read", @@ -316,7 +316,7 @@ fn bar() { ); check_result( refs, - "spam BIND_PAT FileId(1) 19..23 Other", + "spam IDENT_PAT FileId(1) 19..23 Other", &["FileId(1) 34..38 Other Read", "FileId(1) 41..45 Other Read"], ); } @@ -330,7 +330,7 @@ fn foo(i : u32) -> u32 { } "#, ); - check_result(refs, "i BIND_PAT FileId(1) 7..8 Other", &["FileId(1) 29..30 Other Read"]); + check_result(refs, "i IDENT_PAT FileId(1) 7..8 Other", &["FileId(1) 29..30 Other Read"]); } #[test] @@ -342,7 +342,7 @@ fn foo(i<|> : u32) -> u32 { } "#, ); - check_result(refs, "i BIND_PAT FileId(1) 7..8 Other", &["FileId(1) 29..30 Other Read"]); + check_result(refs, "i IDENT_PAT FileId(1) 7..8 Other", &["FileId(1) 29..30 Other Read"]); } #[test] @@ -559,7 +559,7 @@ fn foo() { ); check_result( refs, - "i BIND_PAT FileId(1) 23..24 Other Write", + "i IDENT_PAT FileId(1) 23..24 Other Write", &["FileId(1) 34..35 Other Write", "FileId(1) 38..39 Other Read"], ); } @@ -595,7 +595,7 @@ fn foo() { } "#, ); - check_result(refs, "i BIND_PAT FileId(1) 19..20 Other", &["FileId(1) 26..27 Other Write"]); + check_result(refs, "i IDENT_PAT FileId(1) 19..20 Other", &["FileId(1) 26..27 Other Write"]); } #[test] -- cgit v1.2.3