From 0970c3454baa0164df81a9ff665430d486687331 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 6 May 2020 16:01:47 +0200 Subject: Rename --- crates/ra_assists/src/assist_ctx.rs | 18 +++++++++--------- crates/ra_assists/src/lib.rs | 2 +- crates/ra_assists/src/tests.rs | 4 ++-- crates/ra_ide/src/lib.rs | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) (limited to 'crates') 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); pub(crate) struct AssistInfo { pub(crate) label: AssistLabel, pub(crate) group_label: Option, - pub(crate) action: Option, + pub(crate) source_change: Option, } impl AssistInfo { fn new(label: AssistLabel) -> AssistInfo { - AssistInfo { label, group_label: None, action: None } + AssistInfo { label, group_label: None, source_change: None } } - fn resolved(self, action: SourceChange) -> AssistInfo { - AssistInfo { action: Some(action), ..self } + fn resolved(self, source_change: SourceChange) -> AssistInfo { + AssistInfo { source_change: Some(source_change), ..self } } fn with_group(self, group_label: GroupLabel) -> AssistInfo { @@ -40,7 +40,7 @@ impl AssistInfo { pub(crate) fn into_resolved(self) -> Option { let label = self.label; - self.action.map(|action| ResolvedAssist { label, action }) + self.source_change.map(|source_change| ResolvedAssist { label, source_change }) } } @@ -104,12 +104,12 @@ impl<'a> AssistCtx<'a> { let change_label = label.label.clone(); let mut info = AssistInfo::new(label); if self.should_compute_edit { - let action = { + let source_change = { let mut edit = ActionBuilder::new(&self); f(&mut edit); edit.build(change_label, self.frange.file_id) }; - info = info.resolved(action) + info = info.resolved(source_change) }; Some(Assist(vec![info])) @@ -163,12 +163,12 @@ impl<'a> AssistGroup<'a> { let change_label = label.label.clone(); let mut info = AssistInfo::new(label).with_group(self.group.clone()); if self.ctx.should_compute_edit { - let action = { + let source_change = { let mut edit = ActionBuilder::new(&self.ctx); f(&mut edit); edit.build(change_label, self.ctx.frange.file_id) }; - info = info.resolved(action) + info = info.resolved(source_change) }; self.assists.push(info) diff --git a/crates/ra_assists/src/lib.rs b/crates/ra_assists/src/lib.rs index 8cd8f89c4..6e81ea8ee 100644 --- a/crates/ra_assists/src/lib.rs +++ b/crates/ra_assists/src/lib.rs @@ -59,7 +59,7 @@ impl AssistLabel { #[derive(Debug, Clone)] pub struct ResolvedAssist { pub label: AssistLabel, - pub action: SourceChange, + pub source_change: SourceChange, } #[derive(Debug, Clone, Copy)] diff --git a/crates/ra_assists/src/tests.rs b/crates/ra_assists/src/tests.rs index 572462bfc..17e3ece9f 100644 --- a/crates/ra_assists/src/tests.rs +++ b/crates/ra_assists/src/tests.rs @@ -57,7 +57,7 @@ fn check_doc_test(assist_id: &str, before: &str, after: &str) { }); let actual = { - let change = assist.action.source_file_edits.pop().unwrap(); + let change = assist.source_change.source_file_edits.pop().unwrap(); let mut actual = before.clone(); change.edit.apply(&mut actual); actual @@ -94,7 +94,7 @@ fn check(assist: Handler, before: &str, expected: ExpectedResult) { match (assist(assist_ctx), expected) { (Some(assist), ExpectedResult::After(after)) => { - let mut action = assist.0[0].action.clone().unwrap(); + let mut action = assist.0[0].source_change.clone().unwrap(); let change = action.source_file_edits.pop().unwrap(); let mut actual = db.file_text(change.file_id).as_ref().to_owned(); diff --git a/crates/ra_ide/src/lib.rs b/crates/ra_ide/src/lib.rs index 614029de4..737f87109 100644 --- a/crates/ra_ide/src/lib.rs +++ b/crates/ra_ide/src/lib.rs @@ -478,7 +478,7 @@ impl Analysis { id: assist.label.id, label: assist.label.label, group_label: assist.label.group.map(|it| it.0), - source_change: assist.action, + source_change: assist.source_change, }) .collect() }) -- cgit v1.2.3