mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
Change <|> to $0 - Rebase
This commit is contained in:
parent
171c3c08fe
commit
72b9a4fbd3
110 changed files with 1745 additions and 1765 deletions
|
@ -20,7 +20,7 @@ pub(crate) fn has_trait_parent(element: SyntaxElement) -> bool {
|
|||
}
|
||||
#[test]
|
||||
fn test_has_trait_parent() {
|
||||
check_pattern_is_applicable(r"trait A { f<|> }", has_trait_parent);
|
||||
check_pattern_is_applicable(r"trait A { f$0 }", has_trait_parent);
|
||||
}
|
||||
|
||||
pub(crate) fn has_impl_parent(element: SyntaxElement) -> bool {
|
||||
|
@ -32,7 +32,7 @@ pub(crate) fn has_impl_parent(element: SyntaxElement) -> bool {
|
|||
}
|
||||
#[test]
|
||||
fn test_has_impl_parent() {
|
||||
check_pattern_is_applicable(r"impl A { f<|> }", has_impl_parent);
|
||||
check_pattern_is_applicable(r"impl A { f$0 }", has_impl_parent);
|
||||
}
|
||||
|
||||
pub(crate) fn inside_impl_trait_block(element: SyntaxElement) -> bool {
|
||||
|
@ -47,10 +47,10 @@ pub(crate) fn inside_impl_trait_block(element: SyntaxElement) -> bool {
|
|||
}
|
||||
#[test]
|
||||
fn test_inside_impl_trait_block() {
|
||||
check_pattern_is_applicable(r"impl Foo for Bar { f<|> }", inside_impl_trait_block);
|
||||
check_pattern_is_applicable(r"impl Foo for Bar { fn f<|> }", inside_impl_trait_block);
|
||||
check_pattern_is_not_applicable(r"impl A { f<|> }", inside_impl_trait_block);
|
||||
check_pattern_is_not_applicable(r"impl A { fn f<|> }", inside_impl_trait_block);
|
||||
check_pattern_is_applicable(r"impl Foo for Bar { f$0 }", inside_impl_trait_block);
|
||||
check_pattern_is_applicable(r"impl Foo for Bar { fn f$0 }", inside_impl_trait_block);
|
||||
check_pattern_is_not_applicable(r"impl A { f$0 }", inside_impl_trait_block);
|
||||
check_pattern_is_not_applicable(r"impl A { fn f$0 }", inside_impl_trait_block);
|
||||
}
|
||||
|
||||
pub(crate) fn has_field_list_parent(element: SyntaxElement) -> bool {
|
||||
|
@ -58,8 +58,8 @@ pub(crate) fn has_field_list_parent(element: SyntaxElement) -> bool {
|
|||
}
|
||||
#[test]
|
||||
fn test_has_field_list_parent() {
|
||||
check_pattern_is_applicable(r"struct Foo { f<|> }", has_field_list_parent);
|
||||
check_pattern_is_applicable(r"struct Foo { f<|> pub f: i32}", has_field_list_parent);
|
||||
check_pattern_is_applicable(r"struct Foo { f$0 }", has_field_list_parent);
|
||||
check_pattern_is_applicable(r"struct Foo { f$0 pub f: i32}", has_field_list_parent);
|
||||
}
|
||||
|
||||
pub(crate) fn has_block_expr_parent(element: SyntaxElement) -> bool {
|
||||
|
@ -67,7 +67,7 @@ pub(crate) fn has_block_expr_parent(element: SyntaxElement) -> bool {
|
|||
}
|
||||
#[test]
|
||||
fn test_has_block_expr_parent() {
|
||||
check_pattern_is_applicable(r"fn my_fn() { let a = 2; f<|> }", has_block_expr_parent);
|
||||
check_pattern_is_applicable(r"fn my_fn() { let a = 2; f$0 }", has_block_expr_parent);
|
||||
}
|
||||
|
||||
pub(crate) fn has_bind_pat_parent(element: SyntaxElement) -> bool {
|
||||
|
@ -75,8 +75,8 @@ pub(crate) fn has_bind_pat_parent(element: SyntaxElement) -> bool {
|
|||
}
|
||||
#[test]
|
||||
fn test_has_bind_pat_parent() {
|
||||
check_pattern_is_applicable(r"fn my_fn(m<|>) {}", has_bind_pat_parent);
|
||||
check_pattern_is_applicable(r"fn my_fn() { let m<|> }", has_bind_pat_parent);
|
||||
check_pattern_is_applicable(r"fn my_fn(m$0) {}", has_bind_pat_parent);
|
||||
check_pattern_is_applicable(r"fn my_fn() { let m$0 }", has_bind_pat_parent);
|
||||
}
|
||||
|
||||
pub(crate) fn has_ref_parent(element: SyntaxElement) -> bool {
|
||||
|
@ -86,8 +86,8 @@ pub(crate) fn has_ref_parent(element: SyntaxElement) -> bool {
|
|||
}
|
||||
#[test]
|
||||
fn test_has_ref_parent() {
|
||||
check_pattern_is_applicable(r"fn my_fn(&m<|>) {}", has_ref_parent);
|
||||
check_pattern_is_applicable(r"fn my() { let &m<|> }", has_ref_parent);
|
||||
check_pattern_is_applicable(r"fn my_fn(&m$0) {}", has_ref_parent);
|
||||
check_pattern_is_applicable(r"fn my() { let &m$0 }", has_ref_parent);
|
||||
}
|
||||
|
||||
pub(crate) fn has_item_list_or_source_file_parent(element: SyntaxElement) -> bool {
|
||||
|
@ -99,8 +99,8 @@ pub(crate) fn has_item_list_or_source_file_parent(element: SyntaxElement) -> boo
|
|||
}
|
||||
#[test]
|
||||
fn test_has_item_list_or_source_file_parent() {
|
||||
check_pattern_is_applicable(r"i<|>", has_item_list_or_source_file_parent);
|
||||
check_pattern_is_applicable(r"mod foo { f<|> }", has_item_list_or_source_file_parent);
|
||||
check_pattern_is_applicable(r"i$0", has_item_list_or_source_file_parent);
|
||||
check_pattern_is_applicable(r"mod foo { f$0 }", has_item_list_or_source_file_parent);
|
||||
}
|
||||
|
||||
pub(crate) fn is_match_arm(element: SyntaxElement) -> bool {
|
||||
|
@ -112,7 +112,7 @@ pub(crate) fn is_match_arm(element: SyntaxElement) -> bool {
|
|||
}
|
||||
#[test]
|
||||
fn test_is_match_arm() {
|
||||
check_pattern_is_applicable(r"fn my_fn() { match () { () => m<|> } }", is_match_arm);
|
||||
check_pattern_is_applicable(r"fn my_fn() { match () { () => m$0 } }", is_match_arm);
|
||||
}
|
||||
|
||||
pub(crate) fn unsafe_is_prev(element: SyntaxElement) -> bool {
|
||||
|
@ -124,7 +124,7 @@ pub(crate) fn unsafe_is_prev(element: SyntaxElement) -> bool {
|
|||
}
|
||||
#[test]
|
||||
fn test_unsafe_is_prev() {
|
||||
check_pattern_is_applicable(r"unsafe i<|>", unsafe_is_prev);
|
||||
check_pattern_is_applicable(r"unsafe i$0", unsafe_is_prev);
|
||||
}
|
||||
|
||||
pub(crate) fn if_is_prev(element: SyntaxElement) -> bool {
|
||||
|
@ -144,11 +144,11 @@ pub(crate) fn fn_is_prev(element: SyntaxElement) -> bool {
|
|||
}
|
||||
#[test]
|
||||
fn test_fn_is_prev() {
|
||||
check_pattern_is_applicable(r"fn l<|>", fn_is_prev);
|
||||
check_pattern_is_applicable(r"fn l$0", fn_is_prev);
|
||||
}
|
||||
|
||||
/// Check if the token previous to the previous one is `for`.
|
||||
/// For example, `for _ i<|>` => true.
|
||||
/// For example, `for _ i$0` => true.
|
||||
pub(crate) fn for_is_prev2(element: SyntaxElement) -> bool {
|
||||
element
|
||||
.into_token()
|
||||
|
@ -159,12 +159,12 @@ pub(crate) fn for_is_prev2(element: SyntaxElement) -> bool {
|
|||
}
|
||||
#[test]
|
||||
fn test_for_is_prev2() {
|
||||
check_pattern_is_applicable(r"for i i<|>", for_is_prev2);
|
||||
check_pattern_is_applicable(r"for i i$0", for_is_prev2);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_if_is_prev() {
|
||||
check_pattern_is_applicable(r"if l<|>", if_is_prev);
|
||||
check_pattern_is_applicable(r"if l$0", if_is_prev);
|
||||
}
|
||||
|
||||
pub(crate) fn has_trait_as_prev_sibling(element: SyntaxElement) -> bool {
|
||||
|
@ -172,7 +172,7 @@ pub(crate) fn has_trait_as_prev_sibling(element: SyntaxElement) -> bool {
|
|||
}
|
||||
#[test]
|
||||
fn test_has_trait_as_prev_sibling() {
|
||||
check_pattern_is_applicable(r"trait A w<|> {}", has_trait_as_prev_sibling);
|
||||
check_pattern_is_applicable(r"trait A w$0 {}", has_trait_as_prev_sibling);
|
||||
}
|
||||
|
||||
pub(crate) fn has_impl_as_prev_sibling(element: SyntaxElement) -> bool {
|
||||
|
@ -180,7 +180,7 @@ pub(crate) fn has_impl_as_prev_sibling(element: SyntaxElement) -> bool {
|
|||
}
|
||||
#[test]
|
||||
fn test_has_impl_as_prev_sibling() {
|
||||
check_pattern_is_applicable(r"impl A w<|> {}", has_impl_as_prev_sibling);
|
||||
check_pattern_is_applicable(r"impl A w$0 {}", has_impl_as_prev_sibling);
|
||||
}
|
||||
|
||||
pub(crate) fn is_in_loop_body(element: SyntaxElement) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue