diff options
Diffstat (limited to 'crates/ra_lsp_server/src')
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 6d5622b15..af21254e4 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs | |||
@@ -9,7 +9,7 @@ use languageserver_types::{ | |||
9 | WorkspaceEdit, ParameterInformation, SignatureInformation, Hover, HoverContents, | 9 | WorkspaceEdit, ParameterInformation, SignatureInformation, Hover, HoverContents, |
10 | }; | 10 | }; |
11 | use ra_analysis::{FileId, FoldKind, Query, RunnableKind, FilePosition}; | 11 | use ra_analysis::{FileId, FoldKind, Query, RunnableKind, FilePosition}; |
12 | use ra_syntax::{TextUnit, text_utils::contains_offset_nonstrict}; | 12 | use ra_syntax::{TextUnit, text_utils::{contains_offset_nonstrict, intersect}}; |
13 | use rustc_hash::FxHashMap; | 13 | use rustc_hash::FxHashMap; |
14 | use serde_json::to_value; | 14 | use serde_json::to_value; |
15 | 15 | ||
@@ -618,7 +618,7 @@ pub fn handle_code_action( | |||
618 | .diagnostics(file_id)? | 618 | .diagnostics(file_id)? |
619 | .into_iter() | 619 | .into_iter() |
620 | .filter_map(|d| Some((d.range, d.fix?))) | 620 | .filter_map(|d| Some((d.range, d.fix?))) |
621 | .filter(|(range, _fix)| contains_offset_nonstrict(*range, range.start())) | 621 | .filter(|(diag_range, _fix)| intersect(*diag_range, range).is_some()) |
622 | .map(|(_range, fix)| fix); | 622 | .map(|(_range, fix)| fix); |
623 | 623 | ||
624 | let mut res = Vec::new(); | 624 | let mut res = Vec::new(); |