aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_assists/src/lib.rs')
-rw-r--r--crates/ra_assists/src/lib.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/ra_assists/src/lib.rs b/crates/ra_assists/src/lib.rs
index 150b34ac7..95a530821 100644
--- a/crates/ra_assists/src/lib.rs
+++ b/crates/ra_assists/src/lib.rs
@@ -35,6 +35,7 @@ pub struct AssistLabel {
35 35
36#[derive(Debug, Clone)] 36#[derive(Debug, Clone)]
37pub struct AssistAction { 37pub struct AssistAction {
38 pub label: Option<String>,
38 pub edit: TextEdit, 39 pub edit: TextEdit,
39 pub cursor_position: Option<TextUnit>, 40 pub cursor_position: Option<TextUnit>,
40 pub target: Option<TextRange>, 41 pub target: Option<TextRange>,
@@ -64,7 +65,7 @@ where
64/// 65///
65/// Assists are returned in the "resolved" state, that is with edit fully 66/// Assists are returned in the "resolved" state, that is with edit fully
66/// computed. 67/// computed.
67pub fn assists<H>(db: &H, range: FileRange) -> Vec<(AssistLabel, AssistAction)> 68pub fn assists<H>(db: &H, range: FileRange) -> Vec<(AssistLabel, AssistAction, Vec<AssistAction>)>
68where 69where
69 H: HirDatabase + 'static, 70 H: HirDatabase + 'static,
70{ 71{
@@ -75,7 +76,9 @@ where
75 .iter() 76 .iter()
76 .filter_map(|f| f(ctx.clone())) 77 .filter_map(|f| f(ctx.clone()))
77 .map(|a| match a { 78 .map(|a| match a {
78 Assist::Resolved { label, action } => (label, action), 79 Assist::Resolved { label, action, alternative_actions } => {
80 (label, action, alternative_actions)
81 }
79 Assist::Unresolved { .. } => unreachable!(), 82 Assist::Unresolved { .. } => unreachable!(),
80 }) 83 })
81 .collect::<Vec<_>>(); 84 .collect::<Vec<_>>();