aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-06-05 13:55:23 +0100
committerAleksey Kladov <[email protected]>2020-06-05 13:58:30 +0100
commite63c00f100e960f7b72997026b4b2cd3cd29774b (patch)
treef789502d1e45282980e1eb8bfa1f5e96f45636b9 /crates/ra_hir_def
parentf98d057218ca30d052da2a119fa0b3108ba3a091 (diff)
Rename resolve_relative_path -> resolve_path
For things like `concant!(env!("OUT_DIR"))`, we need to support abs paths
Diffstat (limited to 'crates/ra_hir_def')
-rw-r--r--crates/ra_hir_def/src/nameres/mod_resolution.rs2
-rw-r--r--crates/ra_hir_def/src/test_db.rs8
2 files changed, 3 insertions, 7 deletions
diff --git a/crates/ra_hir_def/src/nameres/mod_resolution.rs b/crates/ra_hir_def/src/nameres/mod_resolution.rs
index 386c5cade..7af922c21 100644
--- a/crates/ra_hir_def/src/nameres/mod_resolution.rs
+++ b/crates/ra_hir_def/src/nameres/mod_resolution.rs
@@ -61,7 +61,7 @@ impl ModDir {
61 }; 61 };
62 62
63 for candidate in candidate_files.iter() { 63 for candidate in candidate_files.iter() {
64 if let Some(file_id) = db.resolve_relative_path(file_id, candidate) { 64 if let Some(file_id) = db.resolve_path(file_id, candidate) {
65 let mut root_non_dir_owner = false; 65 let mut root_non_dir_owner = false;
66 let mut mod_path = RelativePathBuf::new(); 66 let mut mod_path = RelativePathBuf::new();
67 if !(candidate.ends_with("mod.rs") || attr_path.is_some()) { 67 if !(candidate.ends_with("mod.rs") || attr_path.is_some()) {
diff --git a/crates/ra_hir_def/src/test_db.rs b/crates/ra_hir_def/src/test_db.rs
index eb83dee79..d33b57c93 100644
--- a/crates/ra_hir_def/src/test_db.rs
+++ b/crates/ra_hir_def/src/test_db.rs
@@ -58,12 +58,8 @@ impl FileLoader for TestDB {
58 fn file_text(&self, file_id: FileId) -> Arc<String> { 58 fn file_text(&self, file_id: FileId) -> Arc<String> {
59 FileLoaderDelegate(self).file_text(file_id) 59 FileLoaderDelegate(self).file_text(file_id)
60 } 60 }
61 fn resolve_relative_path( 61 fn resolve_path(&self, anchor: FileId, relative_path: &RelativePath) -> Option<FileId> {
62 &self, 62 FileLoaderDelegate(self).resolve_path(anchor, relative_path)
63 anchor: FileId,
64 relative_path: &RelativePath,
65 ) -> Option<FileId> {
66 FileLoaderDelegate(self).resolve_relative_path(anchor, relative_path)
67 } 63 }
68 fn relevant_crates(&self, file_id: FileId) -> Arc<Vec<CrateId>> { 64 fn relevant_crates(&self, file_id: FileId) -> Arc<Vec<CrateId>> {
69 FileLoaderDelegate(self).relevant_crates(file_id) 65 FileLoaderDelegate(self).relevant_crates(file_id)