diff options
Diffstat (limited to 'crates/ra_assists/src/assists/change_visibility.rs')
-rw-r--r-- | crates/ra_assists/src/assists/change_visibility.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/crates/ra_assists/src/assists/change_visibility.rs b/crates/ra_assists/src/assists/change_visibility.rs index df92c6b67..88118cdf7 100644 --- a/crates/ra_assists/src/assists/change_visibility.rs +++ b/crates/ra_assists/src/assists/change_visibility.rs | |||
@@ -1,5 +1,3 @@ | |||
1 | //! FIXME: write short doc here | ||
2 | |||
3 | use hir::db::HirDatabase; | 1 | use hir::db::HirDatabase; |
4 | use ra_syntax::{ | 2 | use ra_syntax::{ |
5 | ast::{self, NameOwner, VisibilityOwner}, | 3 | ast::{self, NameOwner, VisibilityOwner}, |
@@ -13,6 +11,17 @@ use ra_syntax::{ | |||
13 | 11 | ||
14 | use crate::{Assist, AssistCtx, AssistId}; | 12 | use crate::{Assist, AssistCtx, AssistId}; |
15 | 13 | ||
14 | // Assist: change_visibility | ||
15 | // | ||
16 | // Adds or changes existing visibility specifier. | ||
17 | // | ||
18 | // ``` | ||
19 | // fn<|> frobnicate() {} | ||
20 | // ``` | ||
21 | // -> | ||
22 | // ``` | ||
23 | // pub(crate) fn frobnicate() {} | ||
24 | // ``` | ||
16 | pub(crate) fn change_visibility(ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> { | 25 | pub(crate) fn change_visibility(ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> { |
17 | if let Some(vis) = ctx.node_at_offset::<ast::Visibility>() { | 26 | if let Some(vis) = ctx.node_at_offset::<ast::Visibility>() { |
18 | return change_vis(ctx, vis); | 27 | return change_vis(ctx, vis); |