aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_lsp_server/src/main_loop/handlers.rs4
-rw-r--r--crates/ra_syntax/src/lexer/ptr.rs2
-rw-r--r--crates/tools/src/lib.rs2
3 files changed, 4 insertions, 4 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};
11use ra_analysis::{FileId, FoldKind, Query, RunnableKind, FilePosition}; 11use ra_analysis::{FileId, FoldKind, Query, RunnableKind, FilePosition};
12use ra_syntax::{TextUnit, text_utils::contains_offset_nonstrict}; 12use ra_syntax::{TextUnit, text_utils::{contains_offset_nonstrict, intersect}};
13use rustc_hash::FxHashMap; 13use rustc_hash::FxHashMap;
14use serde_json::to_value; 14use 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();
diff --git a/crates/ra_syntax/src/lexer/ptr.rs b/crates/ra_syntax/src/lexer/ptr.rs
index 7e4df51aa..0a473c991 100644
--- a/crates/ra_syntax/src/lexer/ptr.rs
+++ b/crates/ra_syntax/src/lexer/ptr.rs
@@ -28,7 +28,7 @@ impl<'s> Ptr<'s> {
28 } 28 }
29 29
30 /// Gets the nth character from the current. 30 /// Gets the nth character from the current.
31 /// For example, 0 will return the current token, 1 will return the next, etc. 31 /// For example, 0 will return the current character, 1 will return the next, etc.
32 pub fn nth(&self, n: u32) -> Option<char> { 32 pub fn nth(&self, n: u32) -> Option<char> {
33 self.chars().nth(n as usize) 33 self.chars().nth(n as usize)
34 } 34 }
diff --git a/crates/tools/src/lib.rs b/crates/tools/src/lib.rs
index 3013f4e36..4ff783c50 100644
--- a/crates/tools/src/lib.rs
+++ b/crates/tools/src/lib.rs
@@ -17,7 +17,7 @@ pub type Result<T> = ::std::result::Result<T, failure::Error>;
17pub const GRAMMAR: &str = "crates/ra_syntax/src/grammar.ron"; 17pub const GRAMMAR: &str = "crates/ra_syntax/src/grammar.ron";
18pub const SYNTAX_KINDS: &str = "crates/ra_syntax/src/syntax_kinds/generated.rs.tera"; 18pub const SYNTAX_KINDS: &str = "crates/ra_syntax/src/syntax_kinds/generated.rs.tera";
19pub const AST: &str = "crates/ra_syntax/src/ast/generated.rs.tera"; 19pub const AST: &str = "crates/ra_syntax/src/ast/generated.rs.tera";
20const TOOLCHAIN: &str = "beta-2018-11-24"; 20const TOOLCHAIN: &str = "1.31.0";
21 21
22#[derive(Debug)] 22#[derive(Debug)]
23pub struct Test { 23pub struct Test {