aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-10-09 09:26:31 +0100
committerGitHub <[email protected]>2019-10-09 09:26:31 +0100
commitb97677256607d8c6f03707d62265c6b3ccb34600 (patch)
treec99825a2d9ec27ddf2c148ffab4d592c7b5b333c /crates/ra_ide_api/src
parentd5a6cac3357f22dea2e630e17d0f091988cdd558 (diff)
parent8d65530843749e566655b7347b49a1debdc7d948 (diff)
Merge #1972
1972: extend selection correctly handles commas in tuples r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
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] = [