diff options
Diffstat (limited to 'crates/ra_ide/src/completion/complete_path.rs')
-rw-r--r-- | crates/ra_ide/src/completion/complete_path.rs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/crates/ra_ide/src/completion/complete_path.rs b/crates/ra_ide/src/completion/complete_path.rs index 65b3bf6e6..3db17f15f 100644 --- a/crates/ra_ide/src/completion/complete_path.rs +++ b/crates/ra_ide/src/completion/complete_path.rs | |||
@@ -1005,4 +1005,36 @@ mod tests { | |||
1005 | "### | 1005 | "### |
1006 | ); | 1006 | ); |
1007 | } | 1007 | } |
1008 | |||
1009 | #[test] | ||
1010 | fn completes_hashmap_new() { | ||
1011 | assert_debug_snapshot!( | ||
1012 | do_reference_completion( | ||
1013 | r" | ||
1014 | struct RandomState; | ||
1015 | struct HashMap<K, V, S = RandomState> {} | ||
1016 | |||
1017 | impl<K, V> HashMap<K, V, RandomState> { | ||
1018 | pub fn new() -> HashMap<K, V, RandomState> { } | ||
1019 | } | ||
1020 | fn foo() { | ||
1021 | HashMap::<|> | ||
1022 | } | ||
1023 | " | ||
1024 | ), | ||
1025 | @r###" | ||
1026 | [ | ||
1027 | CompletionItem { | ||
1028 | label: "new()", | ||
1029 | source_range: [292; 292), | ||
1030 | delete: [292; 292), | ||
1031 | insert: "new()$0", | ||
1032 | kind: Function, | ||
1033 | lookup: "new", | ||
1034 | detail: "pub fn new() -> HashMap<K, V, RandomState>", | ||
1035 | }, | ||
1036 | ] | ||
1037 | "### | ||
1038 | ); | ||
1039 | } | ||
1008 | } | 1040 | } |