mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-16 01:38:13 +00:00
Merge #3233
3233: Extend selection handles commas in tuple pats r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
61fdcc5ded
1 changed files with 27 additions and 0 deletions
|
@ -44,6 +44,7 @@ fn try_extend_selection(
|
|||
ARRAY_EXPR,
|
||||
TUPLE_EXPR,
|
||||
TUPLE_TYPE,
|
||||
TUPLE_PAT,
|
||||
WHERE_CLAUSE,
|
||||
];
|
||||
|
||||
|
@ -611,6 +612,32 @@ fn main() { let var = (
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_extend_selection_on_tuple_pat() {
|
||||
do_check(
|
||||
r#"fn main() { let (krate, _crate_def_map<|>, module_id) = var; }"#,
|
||||
&["_crate_def_map", "_crate_def_map, ", "(krate, _crate_def_map, module_id)"],
|
||||
);
|
||||
// white space variations
|
||||
do_check(
|
||||
r#"fn main() { let (krate,_crate<|>_def_map,module_id) = var; }"#,
|
||||
&["_crate_def_map", "_crate_def_map,", "(krate,_crate_def_map,module_id)"],
|
||||
);
|
||||
do_check(
|
||||
r#"
|
||||
fn main() { let (
|
||||
krate,
|
||||
_crate_def_map<|>,
|
||||
module_id
|
||||
) = var; }"#,
|
||||
&[
|
||||
"_crate_def_map",
|
||||
"_crate_def_map,",
|
||||
"(\n krate,\n _crate_def_map,\n module_id\n)",
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn extend_selection_inside_macros() {
|
||||
do_check(
|
||||
|
|
Loading…
Reference in a new issue