diff options
Diffstat (limited to 'crates/ra_assists/src/lib.rs')
-rw-r--r-- | crates/ra_assists/src/lib.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_assists/src/lib.rs b/crates/ra_assists/src/lib.rs index 011613762..a91975d8c 100644 --- a/crates/ra_assists/src/lib.rs +++ b/crates/ra_assists/src/lib.rs | |||
@@ -30,7 +30,7 @@ pub(crate) use crate::assist_context::{AssistContext, Assists}; | |||
30 | pub struct AssistId(pub &'static str); | 30 | pub struct AssistId(pub &'static str); |
31 | 31 | ||
32 | #[derive(Debug, Clone)] | 32 | #[derive(Debug, Clone)] |
33 | pub struct AssistLabel { | 33 | pub struct Assist { |
34 | pub id: AssistId, | 34 | pub id: AssistId, |
35 | /// Short description of the assist, as shown in the UI. | 35 | /// Short description of the assist, as shown in the UI. |
36 | pub label: String, | 36 | pub label: String, |
@@ -43,22 +43,22 @@ pub struct AssistLabel { | |||
43 | #[derive(Clone, Debug)] | 43 | #[derive(Clone, Debug)] |
44 | pub struct GroupLabel(pub String); | 44 | pub struct GroupLabel(pub String); |
45 | 45 | ||
46 | impl AssistLabel { | 46 | impl Assist { |
47 | pub(crate) fn new( | 47 | pub(crate) fn new( |
48 | id: AssistId, | 48 | id: AssistId, |
49 | label: String, | 49 | label: String, |
50 | group: Option<GroupLabel>, | 50 | group: Option<GroupLabel>, |
51 | target: TextRange, | 51 | target: TextRange, |
52 | ) -> AssistLabel { | 52 | ) -> Assist { |
53 | // FIXME: make fields private, so that this invariant can't be broken | 53 | // FIXME: make fields private, so that this invariant can't be broken |
54 | assert!(label.starts_with(|c: char| c.is_uppercase())); | 54 | assert!(label.starts_with(|c: char| c.is_uppercase())); |
55 | AssistLabel { id, label, group, target } | 55 | Assist { id, label, group, target } |
56 | } | 56 | } |
57 | } | 57 | } |
58 | 58 | ||
59 | #[derive(Debug, Clone)] | 59 | #[derive(Debug, Clone)] |
60 | pub struct ResolvedAssist { | 60 | pub struct ResolvedAssist { |
61 | pub label: AssistLabel, | 61 | pub assist: Assist, |
62 | pub source_change: SourceChange, | 62 | pub source_change: SourceChange, |
63 | } | 63 | } |
64 | 64 | ||
@@ -66,7 +66,7 @@ pub struct ResolvedAssist { | |||
66 | /// | 66 | /// |
67 | /// Assists are returned in the "unresolved" state, that is only labels are | 67 | /// Assists are returned in the "unresolved" state, that is only labels are |
68 | /// returned, without actual edits. | 68 | /// returned, without actual edits. |
69 | pub fn unresolved_assists(db: &RootDatabase, range: FileRange) -> Vec<AssistLabel> { | 69 | pub fn unresolved_assists(db: &RootDatabase, range: FileRange) -> Vec<Assist> { |
70 | let sema = Semantics::new(db); | 70 | let sema = Semantics::new(db); |
71 | let ctx = AssistContext::new(sema, range); | 71 | let ctx = AssistContext::new(sema, range); |
72 | let mut acc = Assists::new_unresolved(&ctx); | 72 | let mut acc = Assists::new_unresolved(&ctx); |