aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-03-13 08:36:38 +0000
committerGitHub <[email protected]>2020-03-13 08:36:38 +0000
commit56590097ed71374902f1e1c44cde487db4e3ab4f (patch)
treed8e1aece9d2bbd4fa12a841a834da2889806bf8a
parentbe3cf01c15cd48877046e675f4a0ff31b8a08798 (diff)
parent9297f4d991c5738c0d08c3818c6a387525cb05ce (diff)
Merge #3572
3572: Add test for completion of unresolved items r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
-rw-r--r--crates/ra_ide/src/completion/complete_scope.rs34
1 files changed, 34 insertions, 0 deletions
diff --git a/crates/ra_ide/src/completion/complete_scope.rs b/crates/ra_ide/src/completion/complete_scope.rs
index ed55baa64..5ffff5a1c 100644
--- a/crates/ra_ide/src/completion/complete_scope.rs
+++ b/crates/ra_ide/src/completion/complete_scope.rs
@@ -867,4 +867,38 @@ mod tests {
867 "### 867 "###
868 ); 868 );
869 } 869 }
870
871 #[test]
872 fn completes_unresolved_uses() {
873 assert_debug_snapshot!(
874 do_reference_completion(
875 r"
876 use spam::Quux;
877
878 fn main() {
879 <|>
880 }
881 "
882 ),
883 @r###"
884 [
885 CompletionItem {
886 label: "Quux",
887 source_range: [82; 82),
888 delete: [82; 82),
889 insert: "Quux",
890 },
891 CompletionItem {
892 label: "main()",
893 source_range: [82; 82),
894 delete: [82; 82),
895 insert: "main()$0",
896 kind: Function,
897 lookup: "main",
898 detail: "fn main()",
899 },
900 ]
901 "###
902 );
903 }
870} 904}