diff options
Diffstat (limited to 'crates/server/src')
-rw-r--r-- | crates/server/src/main_loop/handlers.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/server/src/main_loop/handlers.rs b/crates/server/src/main_loop/handlers.rs index 323d4e95e..3e02227d5 100644 --- a/crates/server/src/main_loop/handlers.rs +++ b/crates/server/src/main_loop/handlers.rs | |||
@@ -372,12 +372,12 @@ pub fn handle_code_action( | |||
372 | ) -> Result<Option<Vec<Command>>> { | 372 | ) -> Result<Option<Vec<Command>>> { |
373 | let file_id = params.text_document.try_conv_with(&world)?; | 373 | let file_id = params.text_document.try_conv_with(&world)?; |
374 | let line_index = world.analysis().file_line_index(file_id); | 374 | let line_index = world.analysis().file_line_index(file_id); |
375 | let offset = params.range.conv_with(&line_index).start(); | 375 | let range = params.range.conv_with(&line_index); |
376 | 376 | ||
377 | let assists = world.analysis().assists(file_id, offset).into_iter(); | 377 | let assists = world.analysis().assists(file_id, range).into_iter(); |
378 | let fixes = world.analysis().diagnostics(file_id).into_iter() | 378 | let fixes = world.analysis().diagnostics(file_id).into_iter() |
379 | .filter_map(|d| Some((d.range, d.fix?))) | 379 | .filter_map(|d| Some((d.range, d.fix?))) |
380 | .filter(|(range, _fix)| contains_offset_nonstrict(*range, offset)) | 380 | .filter(|(range, _fix)| contains_offset_nonstrict(*range, range.start())) |
381 | .map(|(_range, fix)| fix); | 381 | .map(|(_range, fix)| fix); |
382 | 382 | ||
383 | let mut res = Vec::new(); | 383 | let mut res = Vec::new(); |