diff options
author | Aleksey Kladov <[email protected]> | 2020-06-05 14:07:30 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-06-05 14:07:30 +0100 |
commit | bba374bab2ee53643a899e7ea459b4ab27663bd0 (patch) | |
tree | 77610cd5b460dba0c350a5a9504b813bb3e8be98 /crates/ra_hir_expand | |
parent | e63c00f100e960f7b72997026b4b2cd3cd29774b (diff) |
More direct signature for resolve_path
Diffstat (limited to 'crates/ra_hir_expand')
-rw-r--r-- | crates/ra_hir_expand/src/builtin_macro.rs | 4 | ||||
-rw-r--r-- | crates/ra_hir_expand/src/test_db.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_hir_expand/src/builtin_macro.rs b/crates/ra_hir_expand/src/builtin_macro.rs index 4374d9eda..eec5fb8eb 100644 --- a/crates/ra_hir_expand/src/builtin_macro.rs +++ b/crates/ra_hir_expand/src/builtin_macro.rs | |||
@@ -8,7 +8,7 @@ use crate::{ | |||
8 | use crate::{quote, EagerMacroId, LazyMacroId, MacroCallId}; | 8 | use crate::{quote, EagerMacroId, LazyMacroId, MacroCallId}; |
9 | use either::Either; | 9 | use either::Either; |
10 | use mbe::parse_to_token_tree; | 10 | use mbe::parse_to_token_tree; |
11 | use ra_db::{FileId, RelativePath}; | 11 | use ra_db::FileId; |
12 | use ra_parser::FragmentKind; | 12 | use ra_parser::FragmentKind; |
13 | 13 | ||
14 | macro_rules! register_builtin { | 14 | macro_rules! register_builtin { |
@@ -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_path(call_site, &RelativePath::new(&path)) { | 300 | if let Some(res) = db.resolve_path(call_site, 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 60321fa0a..765a2f6d1 100644 --- a/crates/ra_hir_expand/src/test_db.rs +++ b/crates/ra_hir_expand/src/test_db.rs | |||
@@ -41,8 +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_path(&self, anchor: FileId, relative_path: &RelativePath) -> Option<FileId> { | 44 | fn resolve_path(&self, anchor: FileId, path: &str) -> Option<FileId> { |
45 | FileLoaderDelegate(self).resolve_path(anchor, relative_path) | 45 | FileLoaderDelegate(self).resolve_path(anchor, path) |
46 | } | 46 | } |
47 | fn relevant_crates(&self, file_id: FileId) -> Arc<Vec<CrateId>> { | 47 | fn relevant_crates(&self, file_id: FileId) -> Arc<Vec<CrateId>> { |
48 | FileLoaderDelegate(self).relevant_crates(file_id) | 48 | FileLoaderDelegate(self).relevant_crates(file_id) |