diff options
author | Aleksey Kladov <[email protected]> | 2020-07-30 17:17:28 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-07-30 17:17:28 +0100 |
commit | c83467796b6c7365ea4f41900d74444384a9e618 (patch) | |
tree | 6eb770e4c9751813cc0530e7c645fed8914eed12 /crates/ra_assists/src | |
parent | b2cdb0b22631a66a00be25ba4b2e9c0b34ff426a (diff) |
Finalize Trait grammar
Diffstat (limited to 'crates/ra_assists/src')
-rw-r--r-- | crates/ra_assists/src/handlers/change_visibility.rs | 4 | ||||
-rw-r--r-- | crates/ra_assists/src/handlers/move_bounds.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_assists/src/handlers/change_visibility.rs b/crates/ra_assists/src/handlers/change_visibility.rs index 76144d7d2..724daa93f 100644 --- a/crates/ra_assists/src/handlers/change_visibility.rs +++ b/crates/ra_assists/src/handlers/change_visibility.rs | |||
@@ -1,7 +1,7 @@ | |||
1 | use ra_syntax::{ | 1 | use ra_syntax::{ |
2 | ast::{self, NameOwner, VisibilityOwner}, | 2 | ast::{self, NameOwner, VisibilityOwner}, |
3 | AstNode, | 3 | AstNode, |
4 | SyntaxKind::{CONST, ENUM, FN, MODULE, STATIC, STRUCT, TRAIT_DEF, VISIBILITY}, | 4 | SyntaxKind::{CONST, ENUM, FN, MODULE, STATIC, STRUCT, TRAIT, VISIBILITY}, |
5 | T, | 5 | T, |
6 | }; | 6 | }; |
7 | use test_utils::mark; | 7 | use test_utils::mark; |
@@ -36,7 +36,7 @@ fn add_vis(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { | |||
36 | 36 | ||
37 | let (offset, target) = if let Some(keyword) = item_keyword { | 37 | let (offset, target) = if let Some(keyword) = item_keyword { |
38 | let parent = keyword.parent(); | 38 | let parent = keyword.parent(); |
39 | let def_kws = vec![CONST, STATIC, FN, MODULE, STRUCT, ENUM, TRAIT_DEF]; | 39 | let def_kws = vec![CONST, STATIC, FN, MODULE, STRUCT, ENUM, TRAIT]; |
40 | // Parent is not a definition, can't add visibility | 40 | // Parent is not a definition, can't add visibility |
41 | if !def_kws.iter().any(|&def_kw| def_kw == parent.kind()) { | 41 | if !def_kws.iter().any(|&def_kw| def_kw == parent.kind()) { |
42 | return None; | 42 | return None; |
diff --git a/crates/ra_assists/src/handlers/move_bounds.rs b/crates/ra_assists/src/handlers/move_bounds.rs index 84ac75fa8..fd1d87423 100644 --- a/crates/ra_assists/src/handlers/move_bounds.rs +++ b/crates/ra_assists/src/handlers/move_bounds.rs | |||
@@ -38,7 +38,7 @@ pub(crate) fn move_bounds_to_where_clause(acc: &mut Assists, ctx: &AssistContext | |||
38 | let anchor = match_ast! { | 38 | let anchor = match_ast! { |
39 | match parent { | 39 | match parent { |
40 | ast::Fn(it) => it.body()?.syntax().clone().into(), | 40 | ast::Fn(it) => it.body()?.syntax().clone().into(), |
41 | ast::TraitDef(it) => it.assoc_item_list()?.syntax().clone().into(), | 41 | ast::Trait(it) => it.assoc_item_list()?.syntax().clone().into(), |
42 | ast::ImplDef(it) => it.assoc_item_list()?.syntax().clone().into(), | 42 | ast::ImplDef(it) => it.assoc_item_list()?.syntax().clone().into(), |
43 | ast::Enum(it) => it.variant_list()?.syntax().clone().into(), | 43 | ast::Enum(it) => it.variant_list()?.syntax().clone().into(), |
44 | ast::Struct(it) => { | 44 | ast::Struct(it) => { |