aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/add_impl.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-02-24 12:52:44 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-02-24 12:52:44 +0000
commit043991662c648d86876be44bc3405ee3a60c37a1 (patch)
tree45fcbfb58cce8650f67ce4f41e1b5564ef49bfb3 /crates/ra_assists/src/add_impl.rs
parentf6f160391db945a0dcc2f73b38926d6919f7c566 (diff)
parentc110e72a115bbec36413bd440812dfe9194c58e2 (diff)
Merge #889
889: Refactor assits r=matklad a=matklad * assign unique IDs to assists so that clients could do custom stuff * specify kinds for assists, * make introduce_variable a `refactoring.extract` and make it available only when expression is selected * introduce marks to assists Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/add_impl.rs')
-rw-r--r--crates/ra_assists/src/add_impl.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_assists/src/add_impl.rs b/crates/ra_assists/src/add_impl.rs
index b40b9cc0c..b292f188d 100644
--- a/crates/ra_assists/src/add_impl.rs
+++ b/crates/ra_assists/src/add_impl.rs
@@ -5,12 +5,12 @@ use ra_syntax::{
5 TextUnit, 5 TextUnit,
6}; 6};
7 7
8use crate::{AssistCtx, Assist}; 8use crate::{AssistCtx, Assist, AssistId};
9 9
10pub(crate) fn add_impl(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> { 10pub(crate) fn add_impl(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> {
11 let nominal = ctx.node_at_offset::<ast::NominalDef>()?; 11 let nominal = ctx.node_at_offset::<ast::NominalDef>()?;
12 let name = nominal.name()?; 12 let name = nominal.name()?;
13 ctx.add_action("add impl", |edit| { 13 ctx.add_action(AssistId("add_impl"), "add impl", |edit| {
14 edit.target(nominal.syntax().range()); 14 edit.target(nominal.syntax().range());
15 let type_params = nominal.type_param_list(); 15 let type_params = nominal.type_param_list();
16 let start_offset = nominal.syntax().range().end(); 16 let start_offset = nominal.syntax().range().end();