@@ -8,7 +8,7 @@ use crate::{
8
8
AssistContext , AssistId , AssistKind , Assists ,
9
9
} ;
10
10
11
- // Assist: generate_enum_match_method
11
+ // Assist: generate_enum_is_method
12
12
//
13
13
// Generate an `is_` method for an enum variant.
14
14
//
@@ -34,7 +34,7 @@ use crate::{
34
34
// }
35
35
// }
36
36
// ```
37
- pub ( crate ) fn generate_enum_match_method ( acc : & mut Assists , ctx : & AssistContext ) -> Option < ( ) > {
37
+ pub ( crate ) fn generate_enum_is_method ( acc : & mut Assists , ctx : & AssistContext ) -> Option < ( ) > {
38
38
let variant = ctx. find_node_at_offset :: < ast:: Variant > ( ) ?;
39
39
let variant_name = variant. name ( ) ?;
40
40
let parent_enum = variant. parent_enum ( ) ;
@@ -55,7 +55,7 @@ pub(crate) fn generate_enum_match_method(acc: &mut Assists, ctx: &AssistContext)
55
55
56
56
let target = variant. syntax ( ) . text_range ( ) ;
57
57
acc. add (
58
- AssistId ( "generate_enum_match_method " , AssistKind :: Generate ) ,
58
+ AssistId ( "generate_enum_is_method " , AssistKind :: Generate ) ,
59
59
"Generate an `is_` method for an enum variant" ,
60
60
target,
61
61
|builder| {
@@ -100,13 +100,13 @@ mod tests {
100
100
use super :: * ;
101
101
102
102
fn check_not_applicable ( ra_fixture : & str ) {
103
- check_assist_not_applicable ( generate_enum_match_method , ra_fixture)
103
+ check_assist_not_applicable ( generate_enum_is_method , ra_fixture)
104
104
}
105
105
106
106
#[ test]
107
107
fn test_generate_enum_match_from_variant ( ) {
108
108
check_assist (
109
- generate_enum_match_method ,
109
+ generate_enum_is_method ,
110
110
r#"
111
111
enum Variant {
112
112
Undefined,
@@ -162,7 +162,7 @@ enum Variant {
162
162
#[ test]
163
163
fn test_generate_enum_match_from_variant_with_one_variant ( ) {
164
164
check_assist (
165
- generate_enum_match_method ,
165
+ generate_enum_is_method ,
166
166
r#"enum Variant { Undefi$0ned }"# ,
167
167
r#"
168
168
enum Variant { Undefined }
@@ -179,7 +179,7 @@ impl Variant {
179
179
#[ test]
180
180
fn test_generate_enum_match_from_variant_with_visibility_marker ( ) {
181
181
check_assist (
182
- generate_enum_match_method ,
182
+ generate_enum_is_method ,
183
183
r#"
184
184
pub(crate) enum Variant {
185
185
Undefined,
@@ -204,7 +204,7 @@ impl Variant {
204
204
#[ test]
205
205
fn test_multiple_generate_enum_match_from_variant ( ) {
206
206
check_assist (
207
- generate_enum_match_method ,
207
+ generate_enum_is_method ,
208
208
r#"
209
209
enum Variant {
210
210
Undefined,
0 commit comments