From f553837c1ca30a52bf5091689c21d3c3e3362395 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 8 Jan 2019 21:50:04 +0300 Subject: upstream text-utils to text_unit --- crates/ra_lsp_server/src/main_loop/handlers.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'crates/ra_lsp_server') diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index b9b42f1b3..b7777bfc3 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs @@ -11,8 +11,7 @@ use languageserver_types::{ use ra_analysis::{ FileId, FilePosition, FileRange, FoldKind, Query, RunnableKind, Severity, SourceChange, }; -use ra_syntax::{text_utils::intersect, TextUnit, AstNode}; -use ra_text_edit::text_utils::contains_offset_nonstrict; +use ra_syntax::{TextUnit, AstNode}; use rustc_hash::FxHashMap; use serde_json::to_value; use std::io::Write; @@ -248,7 +247,7 @@ pub fn handle_runnables( let mut res = Vec::new(); for runnable in world.analysis().runnables(file_id)? { if let Some(offset) = offset { - if !contains_offset_nonstrict(runnable.range, offset) { + if !runnable.range.contains_inclusive(offset) { continue; } } @@ -650,7 +649,7 @@ pub fn handle_code_action( .diagnostics(file_id)? .into_iter() .filter_map(|d| Some((d.range, d.fix?))) - .filter(|(diag_range, _fix)| intersect(*diag_range, range).is_some()) + .filter(|(diag_range, _fix)| diag_range.intersection(&range).is_some()) .map(|(_range, fix)| fix); let mut res = Vec::new(); -- cgit v1.2.3