From f67586066d5299c11ee69823a6dfd3148eaa5ec7 Mon Sep 17 00:00:00 2001 From: Domantas Jadenkus Date: Sun, 14 Feb 2021 11:09:56 +0200 Subject: rename existing assist to generate_enum_is_method --- .../src/handlers/generate_enum_match_method.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'crates/ide_assists/src/handlers') diff --git a/crates/ide_assists/src/handlers/generate_enum_match_method.rs b/crates/ide_assists/src/handlers/generate_enum_match_method.rs index aeb887e71..3a7177dbf 100644 --- a/crates/ide_assists/src/handlers/generate_enum_match_method.rs +++ b/crates/ide_assists/src/handlers/generate_enum_match_method.rs @@ -8,7 +8,7 @@ use crate::{ AssistContext, AssistId, AssistKind, Assists, }; -// Assist: generate_enum_match_method +// Assist: generate_enum_is_method // // Generate an `is_` method for an enum variant. // @@ -34,7 +34,7 @@ use crate::{ // } // } // ``` -pub(crate) fn generate_enum_match_method(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { +pub(crate) fn generate_enum_is_method(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { let variant = ctx.find_node_at_offset::()?; let variant_name = variant.name()?; let parent_enum = variant.parent_enum(); @@ -55,7 +55,7 @@ pub(crate) fn generate_enum_match_method(acc: &mut Assists, ctx: &AssistContext) let target = variant.syntax().text_range(); acc.add( - AssistId("generate_enum_match_method", AssistKind::Generate), + AssistId("generate_enum_is_method", AssistKind::Generate), "Generate an `is_` method for an enum variant", target, |builder| { @@ -100,13 +100,13 @@ mod tests { use super::*; fn check_not_applicable(ra_fixture: &str) { - check_assist_not_applicable(generate_enum_match_method, ra_fixture) + check_assist_not_applicable(generate_enum_is_method, ra_fixture) } #[test] fn test_generate_enum_match_from_variant() { check_assist( - generate_enum_match_method, + generate_enum_is_method, r#" enum Variant { Undefined, @@ -162,7 +162,7 @@ enum Variant { #[test] fn test_generate_enum_match_from_variant_with_one_variant() { check_assist( - generate_enum_match_method, + generate_enum_is_method, r#"enum Variant { Undefi$0ned }"#, r#" enum Variant { Undefined } @@ -179,7 +179,7 @@ impl Variant { #[test] fn test_generate_enum_match_from_variant_with_visibility_marker() { check_assist( - generate_enum_match_method, + generate_enum_is_method, r#" pub(crate) enum Variant { Undefined, @@ -204,7 +204,7 @@ impl Variant { #[test] fn test_multiple_generate_enum_match_from_variant() { check_assist( - generate_enum_match_method, + generate_enum_is_method, r#" enum Variant { Undefined, -- cgit v1.2.3