aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/db.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-24 09:41:32 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-24 09:41:32 +0000
commitcfb085ded8d61d7b744d0a83ecbb3da254f6ab9f (patch)
tree18b34194e0d01f5c186bc69f50879c568237dcf0 /crates/ra_hir/src/db.rs
parent6a0a4a564accb12b48e703245655e3e3a0637445 (diff)
parent9fe09db771aa3890ac8a0eeb1d9e6097060fad06 (diff)
Merge #624
624: encapsulate hir locations r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/db.rs')
-rw-r--r--crates/ra_hir/src/db.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/crates/ra_hir/src/db.rs b/crates/ra_hir/src/db.rs
index f383701d7..cc03da1e2 100644
--- a/crates/ra_hir/src/db.rs
+++ b/crates/ra_hir/src/db.rs
@@ -1,10 +1,10 @@
1use std::sync::Arc; 1use std::sync::Arc;
2 2
3use ra_syntax::{SyntaxNode, TreeArc, SourceFile}; 3use ra_syntax::{SyntaxNode, TreeArc, SourceFile};
4use ra_db::{SourceRootId, LocationIntener, SyntaxDatabase, salsa}; 4use ra_db::{SourceRootId, SyntaxDatabase, salsa};
5 5
6use crate::{ 6use crate::{
7 DefLoc, DefId, MacroCallLoc, MacroCallId, Name, HirFileId, 7 HirInterner, DefId, MacroCallId, Name, HirFileId,
8 SourceFileItems, SourceItemId, Crate, 8 SourceFileItems, SourceItemId, Crate,
9 query_definitions, 9 query_definitions,
10 FnSignature, FnScopes, 10 FnSignature, FnScopes,
@@ -18,11 +18,7 @@ use crate::{
18}; 18};
19 19
20#[salsa::query_group] 20#[salsa::query_group]
21pub trait HirDatabase: 21pub trait HirDatabase: SyntaxDatabase + AsRef<HirInterner> {
22 SyntaxDatabase
23 + AsRef<LocationIntener<DefLoc, DefId>>
24 + AsRef<LocationIntener<MacroCallLoc, MacroCallId>>
25{
26 #[salsa::invoke(HirFileId::hir_source_file)] 22 #[salsa::invoke(HirFileId::hir_source_file)]
27 fn hir_source_file(&self, file_id: HirFileId) -> TreeArc<SourceFile>; 23 fn hir_source_file(&self, file_id: HirFileId) -> TreeArc<SourceFile>;
28 24