From b98c16a034620913f3dbc67bd3f48ad2686face7 Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Sun, 28 Jun 2020 18:36:05 -0400 Subject: Categorize assists --- crates/ra_assists/src/assist_context.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'crates/ra_assists/src/assist_context.rs') diff --git a/crates/ra_assists/src/assist_context.rs b/crates/ra_assists/src/assist_context.rs index 3640bb4d2..c35d0254a 100644 --- a/crates/ra_assists/src/assist_context.rs +++ b/crates/ra_assists/src/assist_context.rs @@ -19,7 +19,7 @@ use ra_text_edit::TextEditBuilder; use crate::{ assist_config::{AssistConfig, SnippetCap}, - Assist, AssistId, GroupLabel, ResolvedAssist, + Assist, AssistId, AssistKind, GroupLabel, ResolvedAssist, }; /// `AssistContext` allows to apply an assist or check if it could be applied. @@ -135,22 +135,24 @@ impl Assists { pub(crate) fn add( &mut self, id: AssistId, + kind: AssistKind, label: impl Into, target: TextRange, f: impl FnOnce(&mut AssistBuilder), ) -> Option<()> { - let label = Assist::new(id, label.into(), None, target); + let label = Assist::new(id, kind, label.into(), None, target); self.add_impl(label, f) } pub(crate) fn add_group( &mut self, group: &GroupLabel, id: AssistId, + kind: AssistKind, label: impl Into, target: TextRange, f: impl FnOnce(&mut AssistBuilder), ) -> Option<()> { - let label = Assist::new(id, label.into(), Some(group.clone()), target); + let label = Assist::new(id, kind, label.into(), Some(group.clone()), target); self.add_impl(label, f) } fn add_impl(&mut self, label: Assist, f: impl FnOnce(&mut AssistBuilder)) -> Option<()> { -- cgit v1.2.3