aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/completion
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2018-12-29 23:03:52 +0000
committerFlorian Diebold <[email protected]>2019-01-04 18:14:52 +0000
commit0ad13b9477fc6b15cbfbd521a79ea97bc0e79953 (patch)
treedae217eb806c0b874039089e0c6f70ef5f331e4f /crates/ra_analysis/src/completion
parent6ab0e292d2f8302d4e051cdaa49dd440855c1348 (diff)
Add a test for self field completion
Needed to add a default crate graph in the analysis for that.
Diffstat (limited to 'crates/ra_analysis/src/completion')
-rw-r--r--crates/ra_analysis/src/completion/complete_dot.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/crates/ra_analysis/src/completion/complete_dot.rs b/crates/ra_analysis/src/completion/complete_dot.rs
index f24835d17..031d8b98f 100644
--- a/crates/ra_analysis/src/completion/complete_dot.rs
+++ b/crates/ra_analysis/src/completion/complete_dot.rs
@@ -73,6 +73,21 @@ mod tests {
73 } 73 }
74 74
75 #[test] 75 #[test]
76 fn test_struct_field_completion_self() {
77 check_ref_completion(
78 r"
79 struct A { the_field: u32 }
80 impl A {
81 fn foo(self) {
82 self.<|>
83 }
84 }
85 ",
86 r#"the_field"#,
87 );
88 }
89
90 #[test]
76 fn test_no_struct_field_completion_for_method_call() { 91 fn test_no_struct_field_completion_for_method_call() {
77 check_ref_completion( 92 check_ref_completion(
78 r" 93 r"