From 702bdacb03b498f36ed9ccf4f37ca923affb1e9c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 8 Jan 2019 20:44:31 +0300 Subject: move node at offset to aglo already --- crates/ra_hir/src/code_model_impl/function/scope.rs | 3 +-- crates/ra_hir/src/source_binder.rs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'crates/ra_hir') 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 { #[cfg(test)] mod tests { - use ra_editor::find_node_at_offset; - use ra_syntax::SourceFile; + use ra_syntax::{SourceFile, algo::find_node_at_offset}; use test_utils::{extract_offset, assert_eq_text}; use crate::expr; 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 @@ /// So, this modules should not be used during hir construction, it exists /// purely for "IDE needs". use ra_db::{FileId, FilePosition, Cancelable}; -use ra_editor::find_node_at_offset; use ra_syntax::{ SmolStr, TextRange, SyntaxNode, ast::{self, AstNode, NameOwner}, + algo::find_node_at_offset, }; use crate::{ -- cgit v1.2.3 From 13301f284c63440d3354f74b51cb5a504d1e6eef Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 8 Jan 2019 20:45:26 +0300 Subject: ra_hir does not depend on ra_editor --- crates/ra_hir/Cargo.toml | 1 - 1 file changed, 1 deletion(-) (limited to 'crates/ra_hir') 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" ena = "0.11" ra_syntax = { path = "../ra_syntax" } ra_arena = { path = "../ra_arena" } -ra_editor = { path = "../ra_editor" } ra_db = { path = "../ra_db" } test_utils = { path = "../test_utils" } -- cgit v1.2.3 From 695294bbb974cdbac136e260029403e90a17d953 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 8 Jan 2019 21:00:51 +0300 Subject: ra_db is independent from editor --- crates/ra_hir/src/mock.rs | 1 - crates/ra_hir/src/ty.rs | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_hir') 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! { } impl ra_db::SyntaxDatabase { fn source_file() for ra_db::SourceFileQuery; - fn file_lines() for ra_db::FileLinesQuery; } impl db::HirDatabase { fn hir_source_file() for db::HirSourceFileQuery; 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> { } pub fn infer(db: &impl HirDatabase, def_id: DefId) -> Cancelable> { + db.check_canceled()?; let function = Function::new(def_id); // TODO: consts also need inference let body = function.body(db)?; let scopes = db.fn_scopes(def_id)?; -- cgit v1.2.3