aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_completion/src/completions/unqualified_path.rs
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2021-06-21 13:59:49 +0100
committerLukas Wirth <[email protected]>2021-06-21 14:00:53 +0100
commitb9d85f55b7a0a2159971b42bb5dae71efbfeada4 (patch)
treeebfd374c1ae86a02cb9e51769d36f03fdeaf5977 /crates/ide_completion/src/completions/unqualified_path.rs
parentf835279b3ae41644e9568187b4468cd9d9e84eca (diff)
Move out completion type position tests
Diffstat (limited to 'crates/ide_completion/src/completions/unqualified_path.rs')
-rw-r--r--crates/ide_completion/src/completions/unqualified_path.rs97
1 files changed, 0 insertions, 97 deletions
diff --git a/crates/ide_completion/src/completions/unqualified_path.rs b/crates/ide_completion/src/completions/unqualified_path.rs
index 819fa3a43..380c1e079 100644
--- a/crates/ide_completion/src/completions/unqualified_path.rs
+++ b/crates/ide_completion/src/completions/unqualified_path.rs
@@ -113,28 +113,6 @@ mod tests {
113 } 113 }
114 114
115 #[test] 115 #[test]
116 fn dont_complete_values_in_type_pos() {
117 check(
118 r#"
119const FOO: () = ();
120static BAR: () = ();
121enum Foo {
122 Bar
123}
124struct Baz;
125fn foo() {
126 let local = ();
127 let _: $0;
128}
129"#,
130 expect![[r#"
131 en Foo
132 st Baz
133 "#]],
134 );
135 }
136
137 #[test]
138 fn completes_bindings_from_let() { 116 fn completes_bindings_from_let() {
139 check( 117 check(
140 r#" 118 r#"
@@ -239,29 +217,6 @@ fn main() {
239 } 217 }
240 218
241 #[test] 219 #[test]
242 fn completes_generic_params_in_struct() {
243 check(
244 r#"struct S<T> { x: $0}"#,
245 expect![[r#"
246 sp Self
247 tp T
248 st S<…>
249 "#]],
250 );
251 }
252
253 #[test]
254 fn completes_self_in_enum() {
255 check(
256 r#"enum X { Y($0) }"#,
257 expect![[r#"
258 sp Self
259 en X
260 "#]],
261 );
262 }
263
264 #[test]
265 fn completes_module_items() { 220 fn completes_module_items() {
266 check( 221 check(
267 r#" 222 r#"
@@ -315,19 +270,6 @@ mod m {
315 } 270 }
316 271
317 #[test] 272 #[test]
318 fn completes_return_type() {
319 check(
320 r#"
321struct Foo;
322fn x() -> $0
323"#,
324 expect![[r#"
325 st Foo
326 "#]],
327 );
328 }
329
330 #[test]
331 fn dont_show_both_completions_for_shadowing() { 273 fn dont_show_both_completions_for_shadowing() {
332 check( 274 check(
333 r#" 275 r#"
@@ -509,19 +451,6 @@ fn foo() { $0 }
509 } 451 }
510 452
511 #[test] 453 #[test]
512 fn completes_macros_as_type() {
513 check(
514 r#"
515macro_rules! foo { () => {} }
516fn main() { let x: $0 }
517"#,
518 expect![[r#"
519 ma foo!(…) macro_rules! foo
520 "#]],
521 );
522 }
523
524 #[test]
525 fn completes_macros_as_stmt() { 454 fn completes_macros_as_stmt() {
526 check( 455 check(
527 r#" 456 r#"
@@ -666,30 +595,4 @@ fn f() {}
666 expect![[""]], 595 expect![[""]],
667 ) 596 )
668 } 597 }
669
670 #[test]
671 fn completes_types_and_const_in_arg_list() {
672 check(
673 r#"
674enum Bar {
675 Baz
676}
677trait Foo {
678 type Bar;
679}
680
681const CONST: () = ();
682
683fn foo<T: Foo<$0>, const CONST_PARAM: usize>(_: T) {}
684"#,
685 expect![[r#"
686 ta Bar = type Bar;
687 tp T
688 cp CONST_PARAM
689 tt Foo
690 en Bar
691 ct CONST
692 "#]],
693 );
694 }
695} 598}