aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/assist_ctx.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-02-08 11:49:43 +0000
committerAleksey Kladov <[email protected]>2019-02-08 11:49:43 +0000
commit12e3b4c70b5ef23b2fdfc197296d483680e125f9 (patch)
tree71baa0e0a62f9f6b61450501c5f821f67badf9e4 /crates/ra_assists/src/assist_ctx.rs
parent5cb1d41a30d25cbe136402644bf5434dd667f1e5 (diff)
reformat the world
Diffstat (limited to 'crates/ra_assists/src/assist_ctx.rs')
-rw-r--r--crates/ra_assists/src/assist_ctx.rs16
1 files changed, 3 insertions, 13 deletions
diff --git a/crates/ra_assists/src/assist_ctx.rs b/crates/ra_assists/src/assist_ctx.rs
index 6d09bde52..0bf640241 100644
--- a/crates/ra_assists/src/assist_ctx.rs
+++ b/crates/ra_assists/src/assist_ctx.rs
@@ -69,12 +69,7 @@ impl<'a, DB: HirDatabase> AssistCtx<'a, DB> {
69 F: FnOnce(AssistCtx<DB>) -> T, 69 F: FnOnce(AssistCtx<DB>) -> T,
70 { 70 {
71 let source_file = &db.parse(frange.file_id); 71 let source_file = &db.parse(frange.file_id);
72 let ctx = AssistCtx { 72 let ctx = AssistCtx { db, frange, source_file, should_compute_edit };
73 db,
74 frange,
75 source_file,
76 should_compute_edit,
77 };
78 f(ctx) 73 f(ctx)
79 } 74 }
80 75
@@ -83,9 +78,7 @@ impl<'a, DB: HirDatabase> AssistCtx<'a, DB> {
83 label: impl Into<String>, 78 label: impl Into<String>,
84 f: impl FnOnce(&mut AssistBuilder), 79 f: impl FnOnce(&mut AssistBuilder),
85 ) -> Option<Assist> { 80 ) -> Option<Assist> {
86 let label = AssistLabel { 81 let label = AssistLabel { label: label.into() };
87 label: label.into(),
88 };
89 if !self.should_compute_edit { 82 if !self.should_compute_edit {
90 return Some(Assist::Unresolved(label)); 83 return Some(Assist::Unresolved(label));
91 } 84 }
@@ -146,9 +139,6 @@ impl AssistBuilder {
146 } 139 }
147 140
148 fn build(self) -> AssistAction { 141 fn build(self) -> AssistAction {
149 AssistAction { 142 AssistAction { edit: self.edit.finish(), cursor_position: self.cursor_position }
150 edit: self.edit.finish(),
151 cursor_position: self.cursor_position,
152 }
153 } 143 }
154} 144}