Skip to content

Commit 0970c34

Browse files
committed
Rename
1 parent fdd4df9 commit 0970c34

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

crates/ra_assists/src/assist_ctx.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ pub(crate) struct Assist(pub(crate) Vec<AssistInfo>);
2222
pub(crate) struct AssistInfo {
2323
pub(crate) label: AssistLabel,
2424
pub(crate) group_label: Option<GroupLabel>,
25-
pub(crate) action: Option<SourceChange>,
25+
pub(crate) source_change: Option<SourceChange>,
2626
}
2727

2828
impl AssistInfo {
2929
fn new(label: AssistLabel) -> AssistInfo {
30-
AssistInfo { label, group_label: None, action: None }
30+
AssistInfo { label, group_label: None, source_change: None }
3131
}
3232

33-
fn resolved(self, action: SourceChange) -> AssistInfo {
34-
AssistInfo { action: Some(action), ..self }
33+
fn resolved(self, source_change: SourceChange) -> AssistInfo {
34+
AssistInfo { source_change: Some(source_change), ..self }
3535
}
3636

3737
fn with_group(self, group_label: GroupLabel) -> AssistInfo {
@@ -40,7 +40,7 @@ impl AssistInfo {
4040

4141
pub(crate) fn into_resolved(self) -> Option<ResolvedAssist> {
4242
let label = self.label;
43-
self.action.map(|action| ResolvedAssist { label, action })
43+
self.source_change.map(|source_change| ResolvedAssist { label, source_change })
4444
}
4545
}
4646

@@ -104,12 +104,12 @@ impl<'a> AssistCtx<'a> {
104104
let change_label = label.label.clone();
105105
let mut info = AssistInfo::new(label);
106106
if self.should_compute_edit {
107-
let action = {
107+
let source_change = {
108108
let mut edit = ActionBuilder::new(&self);
109109
f(&mut edit);
110110
edit.build(change_label, self.frange.file_id)
111111
};
112-
info = info.resolved(action)
112+
info = info.resolved(source_change)
113113
};
114114

115115
Some(Assist(vec![info]))
@@ -163,12 +163,12 @@ impl<'a> AssistGroup<'a> {
163163
let change_label = label.label.clone();
164164
let mut info = AssistInfo::new(label).with_group(self.group.clone());
165165
if self.ctx.should_compute_edit {
166-
let action = {
166+
let source_change = {
167167
let mut edit = ActionBuilder::new(&self.ctx);
168168
f(&mut edit);
169169
edit.build(change_label, self.ctx.frange.file_id)
170170
};
171-
info = info.resolved(action)
171+
info = info.resolved(source_change)
172172
};
173173

174174
self.assists.push(info)

crates/ra_assists/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ impl AssistLabel {
5959
#[derive(Debug, Clone)]
6060
pub struct ResolvedAssist {
6161
pub label: AssistLabel,
62-
pub action: SourceChange,
62+
pub source_change: SourceChange,
6363
}
6464

6565
#[derive(Debug, Clone, Copy)]

crates/ra_assists/src/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ fn check_doc_test(assist_id: &str, before: &str, after: &str) {
5757
});
5858

5959
let actual = {
60-
let change = assist.action.source_file_edits.pop().unwrap();
60+
let change = assist.source_change.source_file_edits.pop().unwrap();
6161
let mut actual = before.clone();
6262
change.edit.apply(&mut actual);
6363
actual
@@ -94,7 +94,7 @@ fn check(assist: Handler, before: &str, expected: ExpectedResult) {
9494

9595
match (assist(assist_ctx), expected) {
9696
(Some(assist), ExpectedResult::After(after)) => {
97-
let mut action = assist.0[0].action.clone().unwrap();
97+
let mut action = assist.0[0].source_change.clone().unwrap();
9898
let change = action.source_file_edits.pop().unwrap();
9999

100100
let mut actual = db.file_text(change.file_id).as_ref().to_owned();

crates/ra_ide/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ impl Analysis {
478478
id: assist.label.id,
479479
label: assist.label.label,
480480
group_label: assist.label.group.map(|it| it.0),
481-
source_change: assist.action,
481+
source_change: assist.source_change,
482482
})
483483
.collect()
484484
})

0 commit comments

Comments
 (0)