aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_analysis')
-rw-r--r--crates/ra_analysis/src/descriptors.rs2
-rw-r--r--crates/ra_analysis/src/imp.rs2
-rw-r--r--crates/ra_analysis/src/job.rs2
-rw-r--r--crates/ra_analysis/tests/tests.rs4
4 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_analysis/src/descriptors.rs b/crates/ra_analysis/src/descriptors.rs
index dced99b07..3fca3e581 100644
--- a/crates/ra_analysis/src/descriptors.rs
+++ b/crates/ra_analysis/src/descriptors.rs
@@ -232,7 +232,7 @@ pub struct FnDescriptor {
232} 232}
233 233
234impl FnDescriptor { 234impl FnDescriptor {
235 pub fn new_opt(node: ast::FnDef) -> Option<Self> { 235 pub fn new(node: ast::FnDef) -> Option<Self> {
236 let name = node.name()?.text().to_string(); 236 let name = node.name()?.text().to_string();
237 237
238 // Strip the body out for the label. 238 // Strip the body out for the label.
diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs
index b4faf0b5b..2ed6694ba 100644
--- a/crates/ra_analysis/src/imp.rs
+++ b/crates/ra_analysis/src/imp.rs
@@ -362,7 +362,7 @@ impl AnalysisImpl {
362 for (_, fs) in file_symbols { 362 for (_, fs) in file_symbols {
363 if fs.kind == FN_DEF { 363 if fs.kind == FN_DEF {
364 if let Some(fn_def) = find_node_at_offset(syntax, fs.node_range.start()) { 364 if let Some(fn_def) = find_node_at_offset(syntax, fs.node_range.start()) {
365 if let Some(descriptor) = FnDescriptor::new_opt(fn_def) { 365 if let Some(descriptor) = FnDescriptor::new(fn_def) {
366 // If we have a calling expression let's find which argument we are on 366 // If we have a calling expression let's find which argument we are on
367 let mut current_parameter = None; 367 let mut current_parameter = None;
368 368
diff --git a/crates/ra_analysis/src/job.rs b/crates/ra_analysis/src/job.rs
index 57215c862..2871f9839 100644
--- a/crates/ra_analysis/src/job.rs
+++ b/crates/ra_analysis/src/job.rs
@@ -11,7 +11,7 @@ pub struct JobToken {
11} 11}
12 12
13impl JobHandle { 13impl JobHandle {
14 pub fn new_pair() -> (JobHandle, JobToken) { 14 pub fn new() -> (JobHandle, JobToken) {
15 let (sender_alive, receiver_alive) = bounded(0); 15 let (sender_alive, receiver_alive) = bounded(0);
16 let (sender_canceled, receiver_canceled) = bounded(0); 16 let (sender_canceled, receiver_canceled) = bounded(0);
17 let token = JobToken { 17 let token = JobToken {
diff --git a/crates/ra_analysis/tests/tests.rs b/crates/ra_analysis/tests/tests.rs
index 3302e1151..e0c637d65 100644
--- a/crates/ra_analysis/tests/tests.rs
+++ b/crates/ra_analysis/tests/tests.rs
@@ -62,7 +62,7 @@ fn get_signature(text: &str) -> (FnDescriptor, Option<usize>) {
62 let (offset, code) = extract_offset(text); 62 let (offset, code) = extract_offset(text);
63 let code = code.as_str(); 63 let code = code.as_str();
64 64
65 let (_handle, token) = JobHandle::new_pair(); 65 let (_handle, token) = JobHandle::new();
66 let snap = analysis(&[("/lib.rs", code)]); 66 let snap = analysis(&[("/lib.rs", code)]);
67 67
68 snap.resolve_callable(FileId(1), offset, &token).unwrap() 68 snap.resolve_callable(FileId(1), offset, &token).unwrap()
@@ -71,7 +71,7 @@ fn get_signature(text: &str) -> (FnDescriptor, Option<usize>) {
71#[test] 71#[test]
72fn test_resolve_module() { 72fn test_resolve_module() {
73 let snap = analysis(&[("/lib.rs", "mod foo;"), ("/foo.rs", "")]); 73 let snap = analysis(&[("/lib.rs", "mod foo;"), ("/foo.rs", "")]);
74 let (_handle, token) = JobHandle::new_pair(); 74 let (_handle, token) = JobHandle::new();
75 let symbols = snap.approximately_resolve_symbol(FileId(1), 4.into(), &token); 75 let symbols = snap.approximately_resolve_symbol(FileId(1), 4.into(), &token);
76 assert_eq_dbg( 76 assert_eq_dbg(
77 r#"[(FileId(2), FileSymbol { name: "foo", node_range: [0; 0), kind: MODULE })]"#, 77 r#"[(FileId(2), FileSymbol { name: "foo", node_range: [0; 0), kind: MODULE })]"#,