pub(crate) fn into_resolved(self) -> Option<ResolvedAssist> {
let label = self.label;
- let group_label = self.group_label;
- self.action.map(|action| ResolvedAssist { label, group_label, action })
+ self.action.map(|action| ResolvedAssist { label, action })
}
}
label: impl Into<String>,
f: impl FnOnce(&mut ActionBuilder),
) -> Option<Assist> {
- let label = AssistLabel::new(id, label.into());
+ let label = AssistLabel::new(id, label.into(), None);
let mut info = AssistInfo::new(label);
if self.should_compute_edit {
label: impl Into<String>,
f: impl FnOnce(&mut ActionBuilder),
) {
- let label = AssistLabel::new(id, label.into());
+ let label = AssistLabel::new(id, label.into(), Some(self.group.clone()));
let mut info = AssistInfo::new(label).with_group(self.group.clone());
if self.ctx.should_compute_edit {
pub id: AssistId,
/// Short description of the assist, as shown in the UI.
pub label: String,
+ pub group: Option<GroupLabel>,
}
#[derive(Clone, Debug)]
pub struct GroupLabel(pub String);
impl AssistLabel {
- pub(crate) fn new(id: AssistId, label: String) -> AssistLabel {
+ pub(crate) fn new(id: AssistId, label: String, group: Option<GroupLabel>) -> AssistLabel {
// FIXME: make fields private, so that this invariant can't be broken
assert!(label.starts_with(|c: char| c.is_uppercase()));
- AssistLabel { label, id }
+ AssistLabel { id, label, group }
}
}
#[derive(Debug, Clone)]
pub struct ResolvedAssist {
pub label: AssistLabel,
- pub group_label: Option<GroupLabel>,
pub action: AssistAction,
}