From bb64edf8babe617ca6219e53520ce87a2dd00769 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 6 Sep 2018 00:59:07 +0300 Subject: introduce variable --- crates/server/src/main_loop/handlers.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/server/src') 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( ) -> Result>> { let file_id = params.text_document.try_conv_with(&world)?; let line_index = world.analysis().file_line_index(file_id); - let offset = params.range.conv_with(&line_index).start(); + let range = params.range.conv_with(&line_index); - let assists = world.analysis().assists(file_id, offset).into_iter(); + let assists = world.analysis().assists(file_id, range).into_iter(); let fixes = world.analysis().diagnostics(file_id).into_iter() .filter_map(|d| Some((d.range, d.fix?))) - .filter(|(range, _fix)| contains_offset_nonstrict(*range, offset)) + .filter(|(range, _fix)| contains_offset_nonstrict(*range, range.start())) .map(|(_range, fix)| fix); let mut res = Vec::new(); -- cgit v1.2.3