aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/assist_ctx.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_assists/src/assist_ctx.rs')
-rw-r--r--crates/ra_assists/src/assist_ctx.rs16
1 files changed, 2 insertions, 14 deletions
diff --git a/crates/ra_assists/src/assist_ctx.rs b/crates/ra_assists/src/assist_ctx.rs
index f32072dbd..b2381bd97 100644
--- a/crates/ra_assists/src/assist_ctx.rs
+++ b/crates/ra_assists/src/assist_ctx.rs
@@ -69,23 +69,11 @@ impl<'a> Clone for AssistCtx<'a> {
69} 69}
70 70
71impl<'a> AssistCtx<'a> { 71impl<'a> AssistCtx<'a> {
72 pub(crate) fn with_ctx<F, T>( 72 pub fn new(db: &RootDatabase, frange: FileRange, should_compute_edit: bool) -> AssistCtx {
73 db: &RootDatabase,
74 frange: FileRange,
75 should_compute_edit: bool,
76 f: F,
77 ) -> T
78 where
79 F: FnOnce(AssistCtx) -> T,
80 {
81 let parse = db.parse(frange.file_id); 73 let parse = db.parse(frange.file_id);
82 74 AssistCtx { db, frange, source_file: parse.tree(), should_compute_edit }
83 let ctx = AssistCtx { db, frange, source_file: parse.tree(), should_compute_edit };
84 f(ctx)
85 } 75 }
86}
87 76
88impl<'a> AssistCtx<'a> {
89 pub(crate) fn add_assist( 77 pub(crate) fn add_assist(
90 self, 78 self,
91 id: AssistId, 79 id: AssistId,