aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-08 18:04:08 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-08 18:04:08 +0000
commitc9e42fcf245be16958dca6571e4bccc6c29199df (patch)
treecaa02f8086ad15fb6f884e56bc6a0231b203215f /crates/ra_hir
parent1c25bf05d714680c048d250a5d39e8a4c25f0c31 (diff)
parent695294bbb974cdbac136e260029403e90a17d953 (diff)
Merge #468
468: decouple ra_editor from other stuff r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir')
-rw-r--r--crates/ra_hir/Cargo.toml1
-rw-r--r--crates/ra_hir/src/code_model_impl/function/scope.rs3
-rw-r--r--crates/ra_hir/src/mock.rs1
-rw-r--r--crates/ra_hir/src/source_binder.rs2
-rw-r--r--crates/ra_hir/src/ty.rs1
5 files changed, 3 insertions, 5 deletions
diff --git a/crates/ra_hir/Cargo.toml b/crates/ra_hir/Cargo.toml
index 245a21ce3..5a8fdbfc6 100644
--- a/crates/ra_hir/Cargo.toml
+++ b/crates/ra_hir/Cargo.toml
@@ -14,7 +14,6 @@ parking_lot = "0.7.0"
14ena = "0.11" 14ena = "0.11"
15ra_syntax = { path = "../ra_syntax" } 15ra_syntax = { path = "../ra_syntax" }
16ra_arena = { path = "../ra_arena" } 16ra_arena = { path = "../ra_arena" }
17ra_editor = { path = "../ra_editor" }
18ra_db = { path = "../ra_db" } 17ra_db = { path = "../ra_db" }
19test_utils = { path = "../test_utils" } 18test_utils = { path = "../test_utils" }
20 19
diff --git a/crates/ra_hir/src/code_model_impl/function/scope.rs b/crates/ra_hir/src/code_model_impl/function/scope.rs
index 699784f71..ebf6edc1b 100644
--- a/crates/ra_hir/src/code_model_impl/function/scope.rs
+++ b/crates/ra_hir/src/code_model_impl/function/scope.rs
@@ -308,8 +308,7 @@ pub struct ReferenceDescriptor {
308 308
309#[cfg(test)] 309#[cfg(test)]
310mod tests { 310mod tests {
311 use ra_editor::find_node_at_offset; 311 use ra_syntax::{SourceFile, algo::find_node_at_offset};
312 use ra_syntax::SourceFile;
313 use test_utils::{extract_offset, assert_eq_text}; 312 use test_utils::{extract_offset, assert_eq_text};
314 313
315 use crate::expr; 314 use crate::expr;
diff --git a/crates/ra_hir/src/mock.rs b/crates/ra_hir/src/mock.rs
index c9af38009..0fae7de82 100644
--- a/crates/ra_hir/src/mock.rs
+++ b/crates/ra_hir/src/mock.rs
@@ -215,7 +215,6 @@ salsa::database_storage! {
215 } 215 }
216 impl ra_db::SyntaxDatabase { 216 impl ra_db::SyntaxDatabase {
217 fn source_file() for ra_db::SourceFileQuery; 217 fn source_file() for ra_db::SourceFileQuery;
218 fn file_lines() for ra_db::FileLinesQuery;
219 } 218 }
220 impl db::HirDatabase { 219 impl db::HirDatabase {
221 fn hir_source_file() for db::HirSourceFileQuery; 220 fn hir_source_file() for db::HirSourceFileQuery;
diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs
index 59a803761..4b0400cd0 100644
--- a/crates/ra_hir/src/source_binder.rs
+++ b/crates/ra_hir/src/source_binder.rs
@@ -6,10 +6,10 @@
6/// So, this modules should not be used during hir construction, it exists 6/// So, this modules should not be used during hir construction, it exists
7/// purely for "IDE needs". 7/// purely for "IDE needs".
8use ra_db::{FileId, FilePosition, Cancelable}; 8use ra_db::{FileId, FilePosition, Cancelable};
9use ra_editor::find_node_at_offset;
10use ra_syntax::{ 9use ra_syntax::{
11 SmolStr, TextRange, SyntaxNode, 10 SmolStr, TextRange, SyntaxNode,
12 ast::{self, AstNode, NameOwner}, 11 ast::{self, AstNode, NameOwner},
12 algo::find_node_at_offset,
13}; 13};
14 14
15use crate::{ 15use crate::{
diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs
index 8adeedddb..90ba393ce 100644
--- a/crates/ra_hir/src/ty.rs
+++ b/crates/ra_hir/src/ty.rs
@@ -1049,6 +1049,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
1049} 1049}
1050 1050
1051pub fn infer(db: &impl HirDatabase, def_id: DefId) -> Cancelable<Arc<InferenceResult>> { 1051pub fn infer(db: &impl HirDatabase, def_id: DefId) -> Cancelable<Arc<InferenceResult>> {
1052 db.check_canceled()?;
1052 let function = Function::new(def_id); // TODO: consts also need inference 1053 let function = Function::new(def_id); // TODO: consts also need inference
1053 let body = function.body(db)?; 1054 let body = function.body(db)?;
1054 let scopes = db.fn_scopes(def_id)?; 1055 let scopes = db.fn_scopes(def_id)?;