diff options
Diffstat (limited to 'crates/ra_assists/src/assist_ctx.rs')
-rw-r--r-- | crates/ra_assists/src/assist_ctx.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/crates/ra_assists/src/assist_ctx.rs b/crates/ra_assists/src/assist_ctx.rs index 77275156c..af6756d17 100644 --- a/crates/ra_assists/src/assist_ctx.rs +++ b/crates/ra_assists/src/assist_ctx.rs | |||
@@ -22,16 +22,16 @@ pub(crate) struct Assist(pub(crate) Vec<AssistInfo>); | |||
22 | pub(crate) struct AssistInfo { | 22 | pub(crate) struct AssistInfo { |
23 | pub(crate) label: AssistLabel, | 23 | pub(crate) label: AssistLabel, |
24 | pub(crate) group_label: Option<GroupLabel>, | 24 | pub(crate) group_label: Option<GroupLabel>, |
25 | pub(crate) action: Option<SourceChange>, | 25 | pub(crate) source_change: Option<SourceChange>, |
26 | } | 26 | } |
27 | 27 | ||
28 | impl AssistInfo { | 28 | impl AssistInfo { |
29 | fn new(label: AssistLabel) -> AssistInfo { | 29 | fn new(label: AssistLabel) -> AssistInfo { |
30 | AssistInfo { label, group_label: None, action: None } | 30 | AssistInfo { label, group_label: None, source_change: None } |
31 | } | 31 | } |
32 | 32 | ||
33 | fn resolved(self, action: SourceChange) -> AssistInfo { | 33 | fn resolved(self, source_change: SourceChange) -> AssistInfo { |
34 | AssistInfo { action: Some(action), ..self } | 34 | AssistInfo { source_change: Some(source_change), ..self } |
35 | } | 35 | } |
36 | 36 | ||
37 | fn with_group(self, group_label: GroupLabel) -> AssistInfo { | 37 | fn with_group(self, group_label: GroupLabel) -> AssistInfo { |
@@ -40,7 +40,7 @@ impl AssistInfo { | |||
40 | 40 | ||
41 | pub(crate) fn into_resolved(self) -> Option<ResolvedAssist> { | 41 | pub(crate) fn into_resolved(self) -> Option<ResolvedAssist> { |
42 | let label = self.label; | 42 | let label = self.label; |
43 | self.action.map(|action| ResolvedAssist { label, action }) | 43 | self.source_change.map(|source_change| ResolvedAssist { label, source_change }) |
44 | } | 44 | } |
45 | } | 45 | } |
46 | 46 | ||
@@ -104,12 +104,12 @@ impl<'a> AssistCtx<'a> { | |||
104 | let change_label = label.label.clone(); | 104 | let change_label = label.label.clone(); |
105 | let mut info = AssistInfo::new(label); | 105 | let mut info = AssistInfo::new(label); |
106 | if self.should_compute_edit { | 106 | if self.should_compute_edit { |
107 | let action = { | 107 | let source_change = { |
108 | let mut edit = ActionBuilder::new(&self); | 108 | let mut edit = ActionBuilder::new(&self); |
109 | f(&mut edit); | 109 | f(&mut edit); |
110 | edit.build(change_label, self.frange.file_id) | 110 | edit.build(change_label, self.frange.file_id) |
111 | }; | 111 | }; |
112 | info = info.resolved(action) | 112 | info = info.resolved(source_change) |
113 | }; | 113 | }; |
114 | 114 | ||
115 | Some(Assist(vec![info])) | 115 | Some(Assist(vec![info])) |
@@ -163,12 +163,12 @@ impl<'a> AssistGroup<'a> { | |||
163 | let change_label = label.label.clone(); | 163 | let change_label = label.label.clone(); |
164 | let mut info = AssistInfo::new(label).with_group(self.group.clone()); | 164 | let mut info = AssistInfo::new(label).with_group(self.group.clone()); |
165 | if self.ctx.should_compute_edit { | 165 | if self.ctx.should_compute_edit { |
166 | let action = { | 166 | let source_change = { |
167 | let mut edit = ActionBuilder::new(&self.ctx); | 167 | let mut edit = ActionBuilder::new(&self.ctx); |
168 | f(&mut edit); | 168 | f(&mut edit); |
169 | edit.build(change_label, self.ctx.frange.file_id) | 169 | edit.build(change_label, self.ctx.frange.file_id) |
170 | }; | 170 | }; |
171 | info = info.resolved(action) | 171 | info = info.resolved(source_change) |
172 | }; | 172 | }; |
173 | 173 | ||
174 | self.assists.push(info) | 174 | self.assists.push(info) |