aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/change_visibility.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_assists/src/change_visibility.rs')
-rw-r--r--crates/ra_assists/src/change_visibility.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ra_assists/src/change_visibility.rs b/crates/ra_assists/src/change_visibility.rs
index c63470726..620f534b5 100644
--- a/crates/ra_assists/src/change_visibility.rs
+++ b/crates/ra_assists/src/change_visibility.rs
@@ -1,8 +1,9 @@
1use hir::db::HirDatabase; 1use hir::db::HirDatabase;
2use ra_syntax::{ 2use ra_syntax::{
3 T,
3 AstNode, SyntaxNode, TextUnit, 4 AstNode, SyntaxNode, TextUnit,
4 ast::{self, VisibilityOwner, NameOwner}, 5 ast::{self, VisibilityOwner, NameOwner},
5 SyntaxKind::{VISIBILITY, FN_KW, MOD_KW, STRUCT_KW, ENUM_KW, TRAIT_KW, FN_DEF, MODULE, STRUCT_DEF, ENUM_DEF, TRAIT_DEF, IDENT, WHITESPACE, COMMENT, ATTR}, 6 SyntaxKind::{VISIBILITY, FN_DEF, MODULE, STRUCT_DEF, ENUM_DEF, TRAIT_DEF, IDENT, WHITESPACE, COMMENT, ATTR},
6}; 7};
7 8
8use crate::{AssistCtx, Assist, AssistId}; 9use crate::{AssistCtx, Assist, AssistId};
@@ -16,7 +17,7 @@ pub(crate) fn change_visibility(ctx: AssistCtx<impl HirDatabase>) -> Option<Assi
16 17
17fn add_vis(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> { 18fn add_vis(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> {
18 let item_keyword = ctx.token_at_offset().find(|leaf| match leaf.kind() { 19 let item_keyword = ctx.token_at_offset().find(|leaf| match leaf.kind() {
19 FN_KW | MOD_KW | STRUCT_KW | ENUM_KW | TRAIT_KW => true, 20 T![fn] | T![mod] | T![struct] | T![enum] | T![trait] => true,
20 _ => false, 21 _ => false,
21 }); 22 });
22 23