aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_completion/src/tests
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2021-06-21 14:14:28 +0100
committerLukas Wirth <[email protected]>2021-06-21 14:14:28 +0100
commit0729913525a55cad3ffe9876c1eb05f7b880d22d (patch)
tree7ce7b744bb168f245f201a95b19b584479d93eda /crates/ide_completion/src/tests
parentb9d85f55b7a0a2159971b42bb5dae71efbfeada4 (diff)
Various keyword completion fixes
Diffstat (limited to 'crates/ide_completion/src/tests')
-rw-r--r--crates/ide_completion/src/tests/type_pos.rs16
1 files changed, 4 insertions, 12 deletions
diff --git a/crates/ide_completion/src/tests/type_pos.rs b/crates/ide_completion/src/tests/type_pos.rs
index 2bfecdd08..1ab47b27e 100644
--- a/crates/ide_completion/src/tests/type_pos.rs
+++ b/crates/ide_completion/src/tests/type_pos.rs
@@ -23,7 +23,6 @@ macro_rules! makro {}
23 23
24#[test] 24#[test]
25fn record_field_ty() { 25fn record_field_ty() {
26 // FIXME: pub shouldnt show up here
27 check_with( 26 check_with(
28 r#" 27 r#"
29struct Foo<'lt, T, const C: usize> { 28struct Foo<'lt, T, const C: usize> {
@@ -31,8 +30,6 @@ struct Foo<'lt, T, const C: usize> {
31} 30}
32"#, 31"#,
33 expect![[r#" 32 expect![[r#"
34 kw pub(crate)
35 kw pub
36 sp Self 33 sp Self
37 tp T 34 tp T
38 tt Trait 35 tt Trait
@@ -42,7 +39,7 @@ struct Foo<'lt, T, const C: usize> {
42 md module 39 md module
43 st Foo<…> 40 st Foo<…>
44 st Unit 41 st Unit
45 ma makro!(…) macro_rules! makro 42 ma makro!(…) macro_rules! makro
46 bt u32 43 bt u32
47 "#]], 44 "#]],
48 ) 45 )
@@ -50,12 +47,13 @@ struct Foo<'lt, T, const C: usize> {
50 47
51#[test] 48#[test]
52fn tuple_struct_field() { 49fn tuple_struct_field() {
53 // FIXME: pub should show up here
54 check_with( 50 check_with(
55 r#" 51 r#"
56struct Foo<'lt, T, const C: usize>(f$0); 52struct Foo<'lt, T, const C: usize>(f$0);
57"#, 53"#,
58 expect![[r#" 54 expect![[r#"
55 kw pub(crate)
56 kw pub
59 sp Self 57 sp Self
60 tp T 58 tp T
61 tt Trait 59 tt Trait
@@ -65,7 +63,7 @@ struct Foo<'lt, T, const C: usize>(f$0);
65 md module 63 md module
66 st Foo<…> 64 st Foo<…>
67 st Unit 65 st Unit
68 ma makro!(…) macro_rules! makro 66 ma makro!(…) macro_rules! makro
69 bt u32 67 bt u32
70 "#]], 68 "#]],
71 ) 69 )
@@ -73,13 +71,11 @@ struct Foo<'lt, T, const C: usize>(f$0);
73 71
74#[test] 72#[test]
75fn fn_return_type() { 73fn fn_return_type() {
76 // FIXME: return shouldnt show up here
77 check_with( 74 check_with(
78 r#" 75 r#"
79fn x<'lt, T, const C: usize>() -> $0 76fn x<'lt, T, const C: usize>() -> $0
80"#, 77"#,
81 expect![[r#" 78 expect![[r#"
82 kw return
83 tp T 79 tp T
84 tt Trait 80 tt Trait
85 en Enum 81 en Enum
@@ -95,7 +91,6 @@ fn x<'lt, T, const C: usize>() -> $0
95 91
96#[test] 92#[test]
97fn body_type_pos() { 93fn body_type_pos() {
98 // FIXME: return shouldnt show up here
99 check_with( 94 check_with(
100 r#" 95 r#"
101fn foo<'lt, T, const C: usize>() { 96fn foo<'lt, T, const C: usize>() {
@@ -104,7 +99,6 @@ fn foo<'lt, T, const C: usize>() {
104} 99}
105"#, 100"#,
106 expect![[r#" 101 expect![[r#"
107 kw return
108 tp T 102 tp T
109 tt Trait 103 tt Trait
110 en Enum 104 en Enum
@@ -136,7 +130,6 @@ fn foo<'lt, T, const C: usize>() {
136 130
137#[test] 131#[test]
138fn completes_types_and_const_in_arg_list() { 132fn completes_types_and_const_in_arg_list() {
139 // FIXME: return shouldnt show up here
140 // FIXME: we should complete the lifetime here for now 133 // FIXME: we should complete the lifetime here for now
141 check_with( 134 check_with(
142 r#" 135 r#"
@@ -147,7 +140,6 @@ trait Trait2 {
147fn foo<'lt, T: Trait2<$0>, const CONST_PARAM: usize>(_: T) {} 140fn foo<'lt, T: Trait2<$0>, const CONST_PARAM: usize>(_: T) {}
148"#, 141"#,
149 expect![[r#" 142 expect![[r#"
150 kw return
151 ta Foo = type Foo; 143 ta Foo = type Foo;
152 tp T 144 tp T
153 cp CONST_PARAM 145 cp CONST_PARAM