aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-10-09 09:26:09 +0100
committerAleksey Kladov <[email protected]>2019-10-09 09:26:09 +0100
commit8d65530843749e566655b7347b49a1debdc7d948 (patch)
tree540675dd5b9b10a497d3a38c6db3fa7b23f087a8 /crates/ra_ide_api/src
parent06a8deae4a29949f438d66c54eed4e016ac35432 (diff)
extend selection correctly handles commas in tuples
Diffstat (limited to 'crates/ra_ide_api/src')
-rw-r--r--crates/ra_ide_api/src/extend_selection.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/ra_ide_api/src/extend_selection.rs b/crates/ra_ide_api/src/extend_selection.rs
index 33fefb541..602757e92 100644
--- a/crates/ra_ide_api/src/extend_selection.rs
+++ b/crates/ra_ide_api/src/extend_selection.rs
@@ -32,6 +32,7 @@ fn try_extend_selection(root: &SyntaxNode, range: TextRange) -> Option<TextRange
32 PARAM_LIST, 32 PARAM_LIST,
33 ARG_LIST, 33 ARG_LIST,
34 ARRAY_EXPR, 34 ARRAY_EXPR,
35 TUPLE_EXPR,
35 ]; 36 ];
36 37
37 if range.is_empty() { 38 if range.is_empty() {
@@ -245,6 +246,8 @@ mod tests {
245 do_check(r#"const FOO: [usize; 2] = [ 22 , 33<|>];"#, &["33", ", 33"]); 246 do_check(r#"const FOO: [usize; 2] = [ 22 , 33<|>];"#, &["33", ", 33"]);
246 do_check(r#"const FOO: [usize; 2] = [ 22 , 33<|> ,];"#, &["33", ", 33"]); 247 do_check(r#"const FOO: [usize; 2] = [ 22 , 33<|> ,];"#, &["33", ", 33"]);
247 248
249 do_check(r#"fn main() { (1, 2<|>) }"#, &["2", ", 2", "(1, 2)"]);
250
248 do_check( 251 do_check(
249 r#" 252 r#"
250const FOO: [usize; 2] = [ 253const FOO: [usize; 2] = [