diff options
author | Aleksey Kladov <[email protected]> | 2018-09-05 22:59:07 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-09-05 22:59:07 +0100 |
commit | bb64edf8babe617ca6219e53520ce87a2dd00769 (patch) | |
tree | ba9c8d5866cd7687a07223f91c1ccdf97cb234c3 /crates/server/src/main_loop | |
parent | 47e8b80e9b67d5012fbc860a7763975e99fdf28d (diff) |
introduce variable
Diffstat (limited to 'crates/server/src/main_loop')
-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(); |