diff options
Diffstat (limited to 'crates/ra_assists/src/lib.rs')
-rw-r--r-- | crates/ra_assists/src/lib.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_assists/src/lib.rs b/crates/ra_assists/src/lib.rs index c5df86600..5cec10088 100644 --- a/crates/ra_assists/src/lib.rs +++ b/crates/ra_assists/src/lib.rs | |||
@@ -17,13 +17,13 @@ mod doc_tests; | |||
17 | pub mod utils; | 17 | pub mod utils; |
18 | pub mod ast_transform; | 18 | pub mod ast_transform; |
19 | 19 | ||
20 | use hir::Semantics; | ||
20 | use ra_db::{FileId, FileRange}; | 21 | use ra_db::{FileId, FileRange}; |
21 | use ra_ide_db::RootDatabase; | 22 | use ra_ide_db::RootDatabase; |
22 | use ra_syntax::{TextRange, TextSize}; | 23 | use ra_syntax::{TextRange, TextSize}; |
23 | use ra_text_edit::TextEdit; | 24 | use ra_text_edit::TextEdit; |
24 | 25 | ||
25 | pub(crate) use crate::assist_ctx::{Assist, AssistCtx, AssistHandler}; | 26 | pub(crate) use crate::assist_ctx::{Assist, AssistCtx, AssistHandler}; |
26 | use hir::Semantics; | ||
27 | 27 | ||
28 | /// Unique identifier of the assist, should not be shown to the user | 28 | /// Unique identifier of the assist, should not be shown to the user |
29 | /// directly. | 29 | /// directly. |
@@ -32,19 +32,20 @@ pub struct AssistId(pub &'static str); | |||
32 | 32 | ||
33 | #[derive(Debug, Clone)] | 33 | #[derive(Debug, Clone)] |
34 | pub struct AssistLabel { | 34 | pub struct AssistLabel { |
35 | pub id: AssistId, | ||
35 | /// Short description of the assist, as shown in the UI. | 36 | /// Short description of the assist, as shown in the UI. |
36 | pub label: String, | 37 | pub label: String, |
37 | pub id: AssistId, | 38 | pub group: Option<GroupLabel>, |
38 | } | 39 | } |
39 | 40 | ||
40 | #[derive(Clone, Debug)] | 41 | #[derive(Clone, Debug)] |
41 | pub struct GroupLabel(pub String); | 42 | pub struct GroupLabel(pub String); |
42 | 43 | ||
43 | impl AssistLabel { | 44 | impl AssistLabel { |
44 | pub(crate) fn new(label: String, id: AssistId) -> AssistLabel { | 45 | pub(crate) fn new(id: AssistId, label: String, group: Option<GroupLabel>) -> AssistLabel { |
45 | // FIXME: make fields private, so that this invariant can't be broken | 46 | // FIXME: make fields private, so that this invariant can't be broken |
46 | assert!(label.starts_with(|c: char| c.is_uppercase())); | 47 | assert!(label.starts_with(|c: char| c.is_uppercase())); |
47 | AssistLabel { label, id } | 48 | AssistLabel { id, label, group } |
48 | } | 49 | } |
49 | } | 50 | } |
50 | 51 | ||
@@ -60,7 +61,6 @@ pub struct AssistAction { | |||
60 | #[derive(Debug, Clone)] | 61 | #[derive(Debug, Clone)] |
61 | pub struct ResolvedAssist { | 62 | pub struct ResolvedAssist { |
62 | pub label: AssistLabel, | 63 | pub label: AssistLabel, |
63 | pub group_label: Option<GroupLabel>, | ||
64 | pub action: AssistAction, | 64 | pub action: AssistAction, |
65 | } | 65 | } |
66 | 66 | ||