diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-07-29 18:40:56 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-29 18:40:56 +0100 |
commit | 17126b9827dcec89bbe07add455a4ad893db58fa (patch) | |
tree | 9b355311e2b9261c125f2c3a2a0f205b9d8e5da7 /crates/ra_assists/src | |
parent | 2dfda0b984c45946b9a4148bd848350deac544f2 (diff) | |
parent | 76202a2c7371a6930db7b83af75c0f5a8ae1d061 (diff) |
Merge #5573
5573: Rename NomialDef -> AdtDef r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_assists/src')
-rw-r--r-- | crates/ra_assists/src/handlers/generate_derive.rs | 4 | ||||
-rw-r--r-- | crates/ra_assists/src/handlers/generate_impl.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_assists/src/handlers/generate_derive.rs b/crates/ra_assists/src/handlers/generate_derive.rs index 6ccf39900..90ece9fab 100644 --- a/crates/ra_assists/src/handlers/generate_derive.rs +++ b/crates/ra_assists/src/handlers/generate_derive.rs | |||
@@ -26,7 +26,7 @@ use crate::{AssistContext, AssistId, AssistKind, Assists}; | |||
26 | // ``` | 26 | // ``` |
27 | pub(crate) fn generate_derive(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { | 27 | pub(crate) fn generate_derive(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { |
28 | let cap = ctx.config.snippet_cap?; | 28 | let cap = ctx.config.snippet_cap?; |
29 | let nominal = ctx.find_node_at_offset::<ast::NominalDef>()?; | 29 | let nominal = ctx.find_node_at_offset::<ast::AdtDef>()?; |
30 | let node_start = derive_insertion_offset(&nominal)?; | 30 | let node_start = derive_insertion_offset(&nominal)?; |
31 | let target = nominal.syntax().text_range(); | 31 | let target = nominal.syntax().text_range(); |
32 | acc.add( | 32 | acc.add( |
@@ -58,7 +58,7 @@ pub(crate) fn generate_derive(acc: &mut Assists, ctx: &AssistContext) -> Option< | |||
58 | } | 58 | } |
59 | 59 | ||
60 | // Insert `derive` after doc comments. | 60 | // Insert `derive` after doc comments. |
61 | fn derive_insertion_offset(nominal: &ast::NominalDef) -> Option<TextSize> { | 61 | fn derive_insertion_offset(nominal: &ast::AdtDef) -> Option<TextSize> { |
62 | let non_ws_child = nominal | 62 | let non_ws_child = nominal |
63 | .syntax() | 63 | .syntax() |
64 | .children_with_tokens() | 64 | .children_with_tokens() |
diff --git a/crates/ra_assists/src/handlers/generate_impl.rs b/crates/ra_assists/src/handlers/generate_impl.rs index cbbac1d7f..42eb4defa 100644 --- a/crates/ra_assists/src/handlers/generate_impl.rs +++ b/crates/ra_assists/src/handlers/generate_impl.rs | |||
@@ -23,7 +23,7 @@ use crate::{AssistContext, AssistId, AssistKind, Assists}; | |||
23 | // } | 23 | // } |
24 | // ``` | 24 | // ``` |
25 | pub(crate) fn generate_impl(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { | 25 | pub(crate) fn generate_impl(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { |
26 | let nominal = ctx.find_node_at_offset::<ast::NominalDef>()?; | 26 | let nominal = ctx.find_node_at_offset::<ast::AdtDef>()?; |
27 | let name = nominal.name()?; | 27 | let name = nominal.name()?; |
28 | let target = nominal.syntax().text_range(); | 28 | let target = nominal.syntax().text_range(); |
29 | acc.add( | 29 | acc.add( |