aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-05-13 17:39:06 +0100
committerAleksey Kladov <[email protected]>2019-05-13 17:39:06 +0100
commit549728bba87ed8f4375f27bb9a77223bf8f65452 (patch)
tree7d2711f243047a5e7ee74d7181905a36ae2c033d /crates/ra_ide_api
parent033a32f34944d7e07facd900a78db59b35e6698c (diff)
make AstId untyped
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r--crates/ra_ide_api/src/diagnostics.rs6
-rw-r--r--crates/ra_ide_api/src/display/navigation_target.rs2
-rw-r--r--crates/ra_ide_api/src/references.rs2
3 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_ide_api/src/diagnostics.rs b/crates/ra_ide_api/src/diagnostics.rs
index 855a3ff0f..e23d178b0 100644
--- a/crates/ra_ide_api/src/diagnostics.rs
+++ b/crates/ra_ide_api/src/diagnostics.rs
@@ -54,7 +54,7 @@ pub(crate) fn diagnostics(db: &RootDatabase, file_id: FileId) -> Vec<Diagnostic>
54 let file_id = d.file().original_file(db); 54 let file_id = d.file().original_file(db);
55 let source_file = db.parse(file_id); 55 let source_file = db.parse(file_id);
56 let syntax_node = d.syntax_node_ptr(); 56 let syntax_node = d.syntax_node_ptr();
57 let node = NamedFieldList::cast(syntax_node.to_node(&source_file)).unwrap(); 57 let node = NamedFieldList::cast(syntax_node.to_node(source_file.syntax())).unwrap();
58 let mut ast_editor = AstEditor::new(node); 58 let mut ast_editor = AstEditor::new(node);
59 for f in d.missed_fields.iter() { 59 for f in d.missed_fields.iter() {
60 ast_editor.append_field(&AstBuilder::<NamedField>::from_name(f)); 60 ast_editor.append_field(&AstBuilder::<NamedField>::from_name(f));
@@ -281,7 +281,7 @@ mod tests {
281 one: i32, 281 one: i32,
282 two: i64, 282 two: i64,
283 } 283 }
284 284
285 fn test_fn() { 285 fn test_fn() {
286 let one = 1; 286 let one = 1;
287 let s = TestStruct{ one, two: 2 }; 287 let s = TestStruct{ one, two: 2 };
@@ -298,7 +298,7 @@ mod tests {
298 one: i32, 298 one: i32,
299 two: i64, 299 two: i64,
300 } 300 }
301 301
302 fn test_fn() { 302 fn test_fn() {
303 let one = 1; 303 let one = 1;
304 let s = TestStruct{ ..a }; 304 let s = TestStruct{ ..a };
diff --git a/crates/ra_ide_api/src/display/navigation_target.rs b/crates/ra_ide_api/src/display/navigation_target.rs
index 765cf883b..7ea336c50 100644
--- a/crates/ra_ide_api/src/display/navigation_target.rs
+++ b/crates/ra_ide_api/src/display/navigation_target.rs
@@ -81,7 +81,7 @@ impl NavigationTarget {
81 ) -> NavigationTarget { 81 ) -> NavigationTarget {
82 let file = db.parse(file_id); 82 let file = db.parse(file_id);
83 let (name, full_range) = match pat { 83 let (name, full_range) = match pat {
84 Either::A(pat) => match pat.to_node(&file).kind() { 84 Either::A(pat) => match pat.to_node(file.syntax()).kind() {
85 ast::PatKind::BindPat(pat) => { 85 ast::PatKind::BindPat(pat) => {
86 return NavigationTarget::from_bind_pat(file_id, &pat) 86 return NavigationTarget::from_bind_pat(file_id, &pat)
87 } 87 }
diff --git a/crates/ra_ide_api/src/references.rs b/crates/ra_ide_api/src/references.rs
index 9f655d83c..d5c2b08ca 100644
--- a/crates/ra_ide_api/src/references.rs
+++ b/crates/ra_ide_api/src/references.rs
@@ -86,7 +86,7 @@ pub(crate) fn find_all_refs(
86 let analyzer = hir::SourceAnalyzer::new(db, position.file_id, name_ref.syntax(), None); 86 let analyzer = hir::SourceAnalyzer::new(db, position.file_id, name_ref.syntax(), None);
87 let resolved = analyzer.resolve_local_name(name_ref)?; 87 let resolved = analyzer.resolve_local_name(name_ref)?;
88 if let Either::A(ptr) = resolved.ptr() { 88 if let Either::A(ptr) = resolved.ptr() {
89 if let ast::PatKind::BindPat(binding) = ptr.to_node(source_file).kind() { 89 if let ast::PatKind::BindPat(binding) = ptr.to_node(source_file.syntax()).kind() {
90 return Some((binding, analyzer)); 90 return Some((binding, analyzer));
91 } 91 }
92 } 92 }