aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_hir/src/debug.rs6
-rw-r--r--crates/ra_hir/src/lib.rs7
-rw-r--r--crates/ra_hir_expand/src/lib.rs22
-rw-r--r--crates/ra_ide_api/Cargo.toml5
4 files changed, 16 insertions, 24 deletions
diff --git a/crates/ra_hir/src/debug.rs b/crates/ra_hir/src/debug.rs
index c3f890ed4..4f3e922c3 100644
--- a/crates/ra_hir/src/debug.rs
+++ b/crates/ra_hir/src/debug.rs
@@ -36,12 +36,6 @@ impl Module {
36 } 36 }
37} 37}
38 38
39// impl HirFileId {
40// pub fn debug(self, db: &impl HirDebugDatabase) -> impl fmt::Debug + '_ {
41// debug_fn(move |fmt| db.debug_hir_file_id(self, fmt))
42// }
43// }
44
45pub trait HirDebugHelper: HirDatabase { 39pub trait HirDebugHelper: HirDatabase {
46 fn crate_name(&self, _krate: CrateId) -> Option<String> { 40 fn crate_name(&self, _krate: CrateId) -> Option<String> {
47 None 41 None
diff --git a/crates/ra_hir/src/lib.rs b/crates/ra_hir/src/lib.rs
index 5762b9e52..0f2d233bb 100644
--- a/crates/ra_hir/src/lib.rs
+++ b/crates/ra_hir/src/lib.rs
@@ -59,12 +59,13 @@ pub mod from_source;
59#[cfg(test)] 59#[cfg(test)]
60mod marks; 60mod marks;
61 61
62use hir_expand::{ast_id_map::FileAstId, AstId}; 62use hir_expand::{
63 ast_id_map::{AstIdMap, FileAstId},
64 AstId,
65};
63 66
64use crate::{ids::MacroFileKind, name::AsName, resolve::Resolver}; 67use crate::{ids::MacroFileKind, name::AsName, resolve::Resolver};
65 68
66use hir_expand::ast_id_map::AstIdMap;
67
68pub use crate::{ 69pub use crate::{
69 adt::VariantDef, 70 adt::VariantDef,
70 either::Either, 71 either::Either,
diff --git a/crates/ra_hir_expand/src/lib.rs b/crates/ra_hir_expand/src/lib.rs
index 749227465..6b3538673 100644
--- a/crates/ra_hir_expand/src/lib.rs
+++ b/crates/ra_hir_expand/src/lib.rs
@@ -14,19 +14,6 @@ use ra_syntax::ast::{self, AstNode};
14 14
15use crate::{ast_id_map::FileAstId, db::AstDatabase}; 15use crate::{ast_id_map::FileAstId, db::AstDatabase};
16 16
17macro_rules! impl_intern_key {
18 ($name:ident) => {
19 impl salsa::InternKey for $name {
20 fn from_intern_id(v: salsa::InternId) -> Self {
21 $name(v)
22 }
23 fn as_intern_id(&self) -> salsa::InternId {
24 self.0
25 }
26 }
27 };
28}
29
30/// Input to the analyzer is a set of files, where each file is identified by 17/// Input to the analyzer is a set of files, where each file is identified by
31/// `FileId` and contains source code. However, another source of source code in 18/// `FileId` and contains source code. However, another source of source code in
32/// Rust are macros: each macro can be thought of as producing a "temporary 19/// Rust are macros: each macro can be thought of as producing a "temporary
@@ -101,7 +88,14 @@ pub enum MacroFileKind {
101/// `println!("Hello, {}", world)`. 88/// `println!("Hello, {}", world)`.
102#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] 89#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
103pub struct MacroCallId(salsa::InternId); 90pub struct MacroCallId(salsa::InternId);
104impl_intern_key!(MacroCallId); 91impl salsa::InternKey for MacroCallId {
92 fn from_intern_id(v: salsa::InternId) -> Self {
93 MacroCallId(v)
94 }
95 fn as_intern_id(&self) -> salsa::InternId {
96 self.0
97 }
98}
105 99
106#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] 100#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
107pub struct MacroDefId { 101pub struct MacroDefId {
diff --git a/crates/ra_ide_api/Cargo.toml b/crates/ra_ide_api/Cargo.toml
index f66f0a6ba..bf6ef12f3 100644
--- a/crates/ra_ide_api/Cargo.toml
+++ b/crates/ra_ide_api/Cargo.toml
@@ -27,10 +27,13 @@ ra_db = { path = "../ra_db" }
27ra_cfg = { path = "../ra_cfg" } 27ra_cfg = { path = "../ra_cfg" }
28ra_fmt = { path = "../ra_fmt" } 28ra_fmt = { path = "../ra_fmt" }
29ra_prof = { path = "../ra_prof" } 29ra_prof = { path = "../ra_prof" }
30hir = { path = "../ra_hir", package = "ra_hir" }
31test_utils = { path = "../test_utils" } 30test_utils = { path = "../test_utils" }
32ra_assists = { path = "../ra_assists" } 31ra_assists = { path = "../ra_assists" }
33 32
33# ra_ide_api should depend only on the top-level `hir` package. if you need
34# something from some `hir_xxx` subpackage, reexport the API via `hir`.
35hir = { path = "../ra_hir", package = "ra_hir" }
36
34[dev-dependencies] 37[dev-dependencies]
35insta = "0.12.0" 38insta = "0.12.0"
36 39