mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
Merge #1972
1972: extend selection correctly handles commas in tuples r=matklad a=matklad Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
b976772566
1 changed files with 3 additions and 0 deletions
|
@ -32,6 +32,7 @@ fn try_extend_selection(root: &SyntaxNode, range: TextRange) -> Option<TextRange
|
|||
PARAM_LIST,
|
||||
ARG_LIST,
|
||||
ARRAY_EXPR,
|
||||
TUPLE_EXPR,
|
||||
];
|
||||
|
||||
if range.is_empty() {
|
||||
|
@ -245,6 +246,8 @@ mod tests {
|
|||
do_check(r#"const FOO: [usize; 2] = [ 22 , 33<|>];"#, &["33", ", 33"]);
|
||||
do_check(r#"const FOO: [usize; 2] = [ 22 , 33<|> ,];"#, &["33", ", 33"]);
|
||||
|
||||
do_check(r#"fn main() { (1, 2<|>) }"#, &["2", ", 2", "(1, 2)"]);
|
||||
|
||||
do_check(
|
||||
r#"
|
||||
const FOO: [usize; 2] = [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue