aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src/lib.rs')
-rw-r--r--crates/ra_ide/src/lib.rs10
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 {
119pub struct Fix { 119pub 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
124impl Fix { 126impl 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