mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
extend selection correctly handles commas in tuples
This commit is contained in:
parent
06a8deae4a
commit
8d65530843
@ -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…
Reference in New Issue
Block a user