aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_expand
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_expand
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_expand')
-rw-r--r--crates/ra_hir_expand/src/builtin_macro.rs2
-rw-r--r--crates/ra_hir_expand/src/test_db.rs8
2 files changed, 3 insertions, 7 deletions
diff --git a/crates/ra_hir_expand/src/builtin_macro.rs b/crates/ra_hir_expand/src/builtin_macro.rs
index 3bce8f673..4374d9eda 100644
--- a/crates/ra_hir_expand/src/builtin_macro.rs
+++ b/crates/ra_hir_expand/src/builtin_macro.rs
@@ -297,7 +297,7 @@ fn relative_file(db: &dyn AstDatabase, call_id: MacroCallId, path: &str) -> Opti
297 let call_site = call_id.as_file().original_file(db); 297 let call_site = call_id.as_file().original_file(db);
298 298
299 // Handle trivial case 299 // Handle trivial case
300 if let Some(res) = db.resolve_relative_path(call_site, &RelativePath::new(&path)) { 300 if let Some(res) = db.resolve_path(call_site, &RelativePath::new(&path)) {
301 // Prevent include itself 301 // Prevent include itself
302 return if res == call_site { None } else { Some(res) }; 302 return if res == call_site { None } else { Some(res) };
303 } 303 }
diff --git a/crates/ra_hir_expand/src/test_db.rs b/crates/ra_hir_expand/src/test_db.rs
index c1fb762de..60321fa0a 100644
--- a/crates/ra_hir_expand/src/test_db.rs
+++ b/crates/ra_hir_expand/src/test_db.rs
@@ -41,12 +41,8 @@ impl FileLoader for TestDB {
41 fn file_text(&self, file_id: FileId) -> Arc<String> { 41 fn file_text(&self, file_id: FileId) -> Arc<String> {
42 FileLoaderDelegate(self).file_text(file_id) 42 FileLoaderDelegate(self).file_text(file_id)
43 } 43 }
44 fn resolve_relative_path( 44 fn resolve_path(&self, anchor: FileId, relative_path: &RelativePath) -> Option<FileId> {
45 &self, 45 FileLoaderDelegate(self).resolve_path(anchor, relative_path)
46 anchor: FileId,
47 relative_path: &RelativePath,
48 ) -> Option<FileId> {
49 FileLoaderDelegate(self).resolve_relative_path(anchor, relative_path)
50 } 46 }
51 fn relevant_crates(&self, file_id: FileId) -> Arc<Vec<CrateId>> { 47 fn relevant_crates(&self, file_id: FileId) -> Arc<Vec<CrateId>> {
52 FileLoaderDelegate(self).relevant_crates(file_id) 48 FileLoaderDelegate(self).relevant_crates(file_id)