aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/references.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src/references.rs')
-rw-r--r--crates/ra_ide/src/references.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/ra_ide/src/references.rs b/crates/ra_ide/src/references.rs
index 519e4bf1a..cf456630a 100644
--- a/crates/ra_ide/src/references.rs
+++ b/crates/ra_ide/src/references.rs
@@ -150,7 +150,7 @@ fn decl_access(def: &Definition, syntax: &SyntaxNode, range: TextRange) -> Optio
150 let stmt = find_node_at_offset::<ast::LetStmt>(syntax, range.start())?; 150 let stmt = find_node_at_offset::<ast::LetStmt>(syntax, range.start())?;
151 if stmt.initializer().is_some() { 151 if stmt.initializer().is_some() {
152 let pat = stmt.pat()?; 152 let pat = stmt.pat()?;
153 if let ast::Pat::BindPat(it) = pat { 153 if let ast::Pat::IdentPat(it) = pat {
154 if it.mut_token().is_some() { 154 if it.mut_token().is_some() {
155 return Some(ReferenceAccess::Write); 155 return Some(ReferenceAccess::Write);
156 } 156 }
@@ -290,7 +290,7 @@ fn main() {
290 ); 290 );
291 check_result( 291 check_result(
292 refs, 292 refs,
293 "i BIND_PAT FileId(1) 24..25 Other Write", 293 "i IDENT_PAT FileId(1) 24..25 Other Write",
294 &[ 294 &[
295 "FileId(1) 50..51 Other Write", 295 "FileId(1) 50..51 Other Write",
296 "FileId(1) 54..55 Other Read", 296 "FileId(1) 54..55 Other Read",
@@ -316,7 +316,7 @@ fn bar() {
316 ); 316 );
317 check_result( 317 check_result(
318 refs, 318 refs,
319 "spam BIND_PAT FileId(1) 19..23 Other", 319 "spam IDENT_PAT FileId(1) 19..23 Other",
320 &["FileId(1) 34..38 Other Read", "FileId(1) 41..45 Other Read"], 320 &["FileId(1) 34..38 Other Read", "FileId(1) 41..45 Other Read"],
321 ); 321 );
322 } 322 }
@@ -330,7 +330,7 @@ fn foo(i : u32) -> u32 {
330} 330}
331"#, 331"#,
332 ); 332 );
333 check_result(refs, "i BIND_PAT FileId(1) 7..8 Other", &["FileId(1) 29..30 Other Read"]); 333 check_result(refs, "i IDENT_PAT FileId(1) 7..8 Other", &["FileId(1) 29..30 Other Read"]);
334 } 334 }
335 335
336 #[test] 336 #[test]
@@ -342,7 +342,7 @@ fn foo(i<|> : u32) -> u32 {
342} 342}
343"#, 343"#,
344 ); 344 );
345 check_result(refs, "i BIND_PAT FileId(1) 7..8 Other", &["FileId(1) 29..30 Other Read"]); 345 check_result(refs, "i IDENT_PAT FileId(1) 7..8 Other", &["FileId(1) 29..30 Other Read"]);
346 } 346 }
347 347
348 #[test] 348 #[test]
@@ -559,7 +559,7 @@ fn foo() {
559 ); 559 );
560 check_result( 560 check_result(
561 refs, 561 refs,
562 "i BIND_PAT FileId(1) 23..24 Other Write", 562 "i IDENT_PAT FileId(1) 23..24 Other Write",
563 &["FileId(1) 34..35 Other Write", "FileId(1) 38..39 Other Read"], 563 &["FileId(1) 34..35 Other Write", "FileId(1) 38..39 Other Read"],
564 ); 564 );
565 } 565 }
@@ -595,7 +595,7 @@ fn foo() {
595} 595}
596"#, 596"#,
597 ); 597 );
598 check_result(refs, "i BIND_PAT FileId(1) 19..20 Other", &["FileId(1) 26..27 Other Write"]); 598 check_result(refs, "i IDENT_PAT FileId(1) 19..20 Other", &["FileId(1) 26..27 Other Write"]);
599 } 599 }
600 600
601 #[test] 601 #[test]