diff options
author | Aleksey Kladov <[email protected]> | 2019-10-29 13:19:08 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-10-29 13:19:08 +0000 |
commit | bca708ba4c5eb474448ef2f2882a66ec935f2fee (patch) | |
tree | 14d0a0de9eabc0197156594b032764f6171b2765 /crates | |
parent | 99b6ecfab061396613c5f459fae43ea17b5675b8 (diff) |
cleanup
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_hir/src/debug.rs | 6 | ||||
-rw-r--r-- | crates/ra_hir/src/lib.rs | 7 | ||||
-rw-r--r-- | crates/ra_hir_expand/src/lib.rs | 22 | ||||
-rw-r--r-- | crates/ra_ide_api/Cargo.toml | 5 |
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 | |||
45 | pub trait HirDebugHelper: HirDatabase { | 39 | pub 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)] |
60 | mod marks; | 60 | mod marks; |
61 | 61 | ||
62 | use hir_expand::{ast_id_map::FileAstId, AstId}; | 62 | use hir_expand::{ |
63 | ast_id_map::{AstIdMap, FileAstId}, | ||
64 | AstId, | ||
65 | }; | ||
63 | 66 | ||
64 | use crate::{ids::MacroFileKind, name::AsName, resolve::Resolver}; | 67 | use crate::{ids::MacroFileKind, name::AsName, resolve::Resolver}; |
65 | 68 | ||
66 | use hir_expand::ast_id_map::AstIdMap; | ||
67 | |||
68 | pub use crate::{ | 69 | pub 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 | ||
15 | use crate::{ast_id_map::FileAstId, db::AstDatabase}; | 15 | use crate::{ast_id_map::FileAstId, db::AstDatabase}; |
16 | 16 | ||
17 | macro_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)] |
103 | pub struct MacroCallId(salsa::InternId); | 90 | pub struct MacroCallId(salsa::InternId); |
104 | impl_intern_key!(MacroCallId); | 91 | impl 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)] |
107 | pub struct MacroDefId { | 101 | pub 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" } | |||
27 | ra_cfg = { path = "../ra_cfg" } | 27 | ra_cfg = { path = "../ra_cfg" } |
28 | ra_fmt = { path = "../ra_fmt" } | 28 | ra_fmt = { path = "../ra_fmt" } |
29 | ra_prof = { path = "../ra_prof" } | 29 | ra_prof = { path = "../ra_prof" } |
30 | hir = { path = "../ra_hir", package = "ra_hir" } | ||
31 | test_utils = { path = "../test_utils" } | 30 | test_utils = { path = "../test_utils" } |
32 | ra_assists = { path = "../ra_assists" } | 31 | ra_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`. | ||
35 | hir = { path = "../ra_hir", package = "ra_hir" } | ||
36 | |||
34 | [dev-dependencies] | 37 | [dev-dependencies] |
35 | insta = "0.12.0" | 38 | insta = "0.12.0" |
36 | 39 | ||