Skip to content

Commit 00a615b

Browse files
committed
Add pub(super) along with pub(crate) and pub as a completion keyword
1 parent b21f15a commit 00a615b

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

crates/ide_completion/src/completions/keyword.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ pub(crate) fn complete_expr_keyword(acc: &mut Completions, ctx: &CompletionConte
6464
&& (expects_item || ctx.expects_non_trait_assoc_item() || ctx.expect_field())
6565
{
6666
add_keyword("pub(crate)", "pub(crate)");
67+
add_keyword("pub(super)", "pub(super)");
6768
add_keyword("pub", "pub");
6869
}
6970

crates/ide_completion/src/tests/item.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ fn after_struct_name() {
8787
r"struct Struct $0",
8888
expect![[r##"
8989
kw pub(crate)
90+
kw pub(super)
9091
kw pub
9192
kw unsafe
9293
kw fn
@@ -120,6 +121,7 @@ fn after_fn_name() {
120121
r"fn func() $0",
121122
expect![[r##"
122123
kw pub(crate)
124+
kw pub(super)
123125
kw pub
124126
kw unsafe
125127
kw fn
@@ -157,6 +159,7 @@ struct Foo {
157159
"#,
158160
expect![[r#"
159161
kw pub(crate)
162+
kw pub(super)
160163
kw pub
161164
"#]],
162165
)

crates/ide_completion/src/tests/item_list.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ fn in_mod_item_list() {
1414
r#"mod tests { $0 }"#,
1515
expect![[r##"
1616
kw pub(crate)
17+
kw pub(super)
1718
kw pub
1819
kw unsafe
1920
kw fn
@@ -45,6 +46,7 @@ fn in_source_file_item_list() {
4546
r#"$0"#,
4647
expect![[r##"
4748
kw pub(crate)
49+
kw pub(super)
4850
kw pub
4951
kw unsafe
5052
kw fn
@@ -77,6 +79,7 @@ fn in_item_list_after_attr() {
7779
r#"#[attr] $0"#,
7880
expect![[r#"
7981
kw pub(crate)
82+
kw pub(super)
8083
kw pub
8184
kw unsafe
8285
kw fn
@@ -161,6 +164,7 @@ fn in_impl_assoc_item_list() {
161164
r#"impl Struct { $0 }"#,
162165
expect![[r##"
163166
kw pub(crate)
167+
kw pub(super)
164168
kw pub
165169
kw unsafe
166170
kw fn
@@ -181,6 +185,7 @@ fn in_impl_assoc_item_list_after_attr() {
181185
r#"impl Struct { #[attr] $0 }"#,
182186
expect![[r#"
183187
kw pub(crate)
188+
kw pub(super)
184189
kw pub
185190
kw unsafe
186191
kw fn
@@ -230,6 +235,7 @@ impl Test for () {
230235
"#,
231236
expect![[r##"
232237
kw pub(crate)
238+
kw pub(super)
233239
kw pub
234240
kw unsafe
235241
kw fn

crates/ide_completion/src/tests/type_pos.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ struct Foo<'lt, T, const C: usize>(f$0);
4444
"#,
4545
expect![[r##"
4646
kw pub(crate)
47+
kw pub(super)
4748
kw pub
4849
kw self
4950
kw super

0 commit comments

Comments
 (0)