File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ impl<'a> AssistCtx<'a> {
100
100
label : impl Into < String > ,
101
101
f : impl FnOnce ( & mut ActionBuilder ) ,
102
102
) -> Option < Assist > {
103
- let label = AssistLabel :: new ( label. into ( ) , id ) ;
103
+ let label = AssistLabel :: new ( id , label. into ( ) ) ;
104
104
105
105
let mut info = AssistInfo :: new ( label) ;
106
106
if self . should_compute_edit {
@@ -157,7 +157,7 @@ impl<'a> AssistGroup<'a> {
157
157
label : impl Into < String > ,
158
158
f : impl FnOnce ( & mut ActionBuilder ) ,
159
159
) {
160
- let label = AssistLabel :: new ( label. into ( ) , id ) ;
160
+ let label = AssistLabel :: new ( id , label. into ( ) ) ;
161
161
162
162
let mut info = AssistInfo :: new ( label) . with_group ( GroupLabel ( self . group_name . clone ( ) ) ) ;
163
163
if self . ctx . should_compute_edit {
Original file line number Diff line number Diff line change @@ -32,16 +32,16 @@ pub struct AssistId(pub &'static str);
32
32
33
33
#[ derive( Debug , Clone ) ]
34
34
pub struct AssistLabel {
35
+ pub id : AssistId ,
35
36
/// Short description of the assist, as shown in the UI.
36
37
pub label : String ,
37
- pub id : AssistId ,
38
38
}
39
39
40
40
#[ derive( Clone , Debug ) ]
41
41
pub struct GroupLabel ( pub String ) ;
42
42
43
43
impl AssistLabel {
44
- pub ( crate ) fn new ( label : String , id : AssistId ) -> AssistLabel {
44
+ pub ( crate ) fn new ( id : AssistId , label : String ) -> AssistLabel {
45
45
// FIXME: make fields private, so that this invariant can't be broken
46
46
assert ! ( label. starts_with( |c: char | c. is_uppercase( ) ) ) ;
47
47
AssistLabel { label, id }
You can’t perform that action at this time.
0 commit comments