diff options
Diffstat (limited to 'crates/assists/src/lib.rs')
-rw-r--r-- | crates/assists/src/lib.rs | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/crates/assists/src/lib.rs b/crates/assists/src/lib.rs index c589b08dc..14834480a 100644 --- a/crates/assists/src/lib.rs +++ b/crates/assists/src/lib.rs | |||
@@ -19,7 +19,7 @@ pub mod ast_transform; | |||
19 | 19 | ||
20 | use base_db::FileRange; | 20 | use base_db::FileRange; |
21 | use hir::Semantics; | 21 | use hir::Semantics; |
22 | use ide_db::{source_change::SourceChange, RootDatabase}; | 22 | use ide_db::{label::Label, source_change::SourceChange, RootDatabase}; |
23 | use syntax::TextRange; | 23 | use syntax::TextRange; |
24 | 24 | ||
25 | pub(crate) use crate::assist_context::{AssistContext, Assists}; | 25 | pub(crate) use crate::assist_context::{AssistContext, Assists}; |
@@ -68,7 +68,7 @@ pub struct GroupLabel(pub String); | |||
68 | pub struct Assist { | 68 | pub struct Assist { |
69 | pub id: AssistId, | 69 | pub id: AssistId, |
70 | /// Short description of the assist, as shown in the UI. | 70 | /// Short description of the assist, as shown in the UI. |
71 | label: String, | 71 | pub label: Label, |
72 | pub group: Option<GroupLabel>, | 72 | pub group: Option<GroupLabel>, |
73 | /// Target ranges are used to sort assists: the smaller the target range, | 73 | /// Target ranges are used to sort assists: the smaller the target range, |
74 | /// the more specific assist is, and so it should be sorted first. | 74 | /// the more specific assist is, and so it should be sorted first. |
@@ -82,11 +82,6 @@ pub struct ResolvedAssist { | |||
82 | } | 82 | } |
83 | 83 | ||
84 | impl Assist { | 84 | impl Assist { |
85 | fn new(id: AssistId, label: String, group: Option<GroupLabel>, target: TextRange) -> Assist { | ||
86 | assert!(label.starts_with(char::is_uppercase)); | ||
87 | Assist { id, label, group, target } | ||
88 | } | ||
89 | |||
90 | /// Return all the assists applicable at the given position. | 85 | /// Return all the assists applicable at the given position. |
91 | /// | 86 | /// |
92 | /// Assists are returned in the "unresolved" state, that is only labels are | 87 | /// Assists are returned in the "unresolved" state, that is only labels are |
@@ -118,10 +113,6 @@ impl Assist { | |||
118 | }); | 113 | }); |
119 | acc.finish_resolved() | 114 | acc.finish_resolved() |
120 | } | 115 | } |
121 | |||
122 | pub fn label(&self) -> &str { | ||
123 | self.label.as_str() | ||
124 | } | ||
125 | } | 116 | } |
126 | 117 | ||
127 | mod handlers { | 118 | mod handlers { |