diff options
Diffstat (limited to 'crates/ra_ide/src/lib.rs')
-rw-r--r-- | crates/ra_ide/src/lib.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/crates/ra_ide/src/lib.rs b/crates/ra_ide/src/lib.rs index 3822b9409..2cbd7e4f0 100644 --- a/crates/ra_ide/src/lib.rs +++ b/crates/ra_ide/src/lib.rs | |||
@@ -119,13 +119,19 @@ pub struct Diagnostic { | |||
119 | pub struct Fix { | 119 | pub struct Fix { |
120 | pub label: String, | 120 | pub label: String, |
121 | pub source_change: SourceChange, | 121 | pub source_change: SourceChange, |
122 | /// Allows to trigger the fix only when the caret is in the range given | ||
123 | pub fix_trigger_range: TextRange, | ||
122 | } | 124 | } |
123 | 125 | ||
124 | impl Fix { | 126 | impl Fix { |
125 | pub fn new(label: impl Into<String>, source_change: SourceChange) -> Self { | 127 | pub fn new( |
128 | label: impl Into<String>, | ||
129 | source_change: SourceChange, | ||
130 | fix_trigger_range: TextRange, | ||
131 | ) -> Self { | ||
126 | let label = label.into(); | 132 | let label = label.into(); |
127 | assert!(label.starts_with(char::is_uppercase) && !label.ends_with('.')); | 133 | assert!(label.starts_with(char::is_uppercase) && !label.ends_with('.')); |
128 | Self { label, source_change } | 134 | Self { label, source_change, fix_trigger_range } |
129 | } | 135 | } |
130 | } | 136 | } |
131 | 137 | ||