diff options
Diffstat (limited to 'crates/libanalysis/src/imp.rs')
-rw-r--r-- | crates/libanalysis/src/imp.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/libanalysis/src/imp.rs b/crates/libanalysis/src/imp.rs index e3ccffbf0..47b0d79ff 100644 --- a/crates/libanalysis/src/imp.rs +++ b/crates/libanalysis/src/imp.rs | |||
@@ -256,12 +256,14 @@ impl AnalysisImpl { | |||
256 | res | 256 | res |
257 | } | 257 | } |
258 | 258 | ||
259 | pub fn assists(&self, file_id: FileId, offset: TextUnit) -> Vec<SourceChange> { | 259 | pub fn assists(&self, file_id: FileId, range: TextRange) -> Vec<SourceChange> { |
260 | let file = self.file_syntax(file_id); | 260 | let file = self.file_syntax(file_id); |
261 | let offset = range.start(); | ||
261 | let actions = vec![ | 262 | let actions = vec![ |
262 | ("flip comma", libeditor::flip_comma(&file, offset).map(|f| f())), | 263 | ("flip comma", libeditor::flip_comma(&file, offset).map(|f| f())), |
263 | ("add `#[derive]`", libeditor::add_derive(&file, offset).map(|f| f())), | 264 | ("add `#[derive]`", libeditor::add_derive(&file, offset).map(|f| f())), |
264 | ("add impl", libeditor::add_impl(&file, offset).map(|f| f())), | 265 | ("add impl", libeditor::add_impl(&file, offset).map(|f| f())), |
266 | ("introduce variable", libeditor::introduce_variable(&file, range).map(|f| f())), | ||
265 | ]; | 267 | ]; |
266 | actions.into_iter() | 268 | actions.into_iter() |
267 | .filter_map(|(name, local_edit)| { | 269 | .filter_map(|(name, local_edit)| { |