diff options
author | Edwin Cheng <[email protected]> | 2020-03-10 14:00:31 +0000 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2020-03-10 17:06:01 +0000 |
commit | 22f064cca7651eaf2980fcfa27618d99c633a589 (patch) | |
tree | 34d52b29a5f7844b59a2c65079502689cd041b48 /crates/ra_hir_def/src | |
parent | 8153a0b3ef84b8ad2f26bba14a094752797a5ada (diff) |
Add resolve_extern_path in DB
Diffstat (limited to 'crates/ra_hir_def/src')
-rw-r--r-- | crates/ra_hir_def/src/test_db.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/crates/ra_hir_def/src/test_db.rs b/crates/ra_hir_def/src/test_db.rs index 1568820e9..0756916a8 100644 --- a/crates/ra_hir_def/src/test_db.rs +++ b/crates/ra_hir_def/src/test_db.rs | |||
@@ -6,7 +6,7 @@ use std::{ | |||
6 | }; | 6 | }; |
7 | 7 | ||
8 | use crate::db::DefDatabase; | 8 | use crate::db::DefDatabase; |
9 | use ra_db::{salsa, CrateId, FileId, FileLoader, FileLoaderDelegate, RelativePath}; | 9 | use ra_db::{salsa, CrateId, ExternSourceId, FileId, FileLoader, FileLoaderDelegate, RelativePath}; |
10 | 10 | ||
11 | #[salsa::database( | 11 | #[salsa::database( |
12 | ra_db::SourceDatabaseExtStorage, | 12 | ra_db::SourceDatabaseExtStorage, |
@@ -52,6 +52,14 @@ impl FileLoader for TestDB { | |||
52 | fn relevant_crates(&self, file_id: FileId) -> Arc<Vec<CrateId>> { | 52 | fn relevant_crates(&self, file_id: FileId) -> Arc<Vec<CrateId>> { |
53 | FileLoaderDelegate(self).relevant_crates(file_id) | 53 | FileLoaderDelegate(self).relevant_crates(file_id) |
54 | } | 54 | } |
55 | |||
56 | fn resolve_extern_path( | ||
57 | &self, | ||
58 | extern_id: ExternSourceId, | ||
59 | relative_path: &RelativePath, | ||
60 | ) -> Option<FileId> { | ||
61 | FileLoaderDelegate(self).resolve_extern_path(extern_id, relative_path) | ||
62 | } | ||
55 | } | 63 | } |
56 | 64 | ||
57 | impl TestDB { | 65 | impl TestDB { |