mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
More direct signature for resolve_path
This commit is contained in:
parent
e63c00f100
commit
bba374bab2
7 changed files with 24 additions and 19 deletions
|
@ -8,7 +8,7 @@ use crate::{
|
|||
use crate::{quote, EagerMacroId, LazyMacroId, MacroCallId};
|
||||
use either::Either;
|
||||
use mbe::parse_to_token_tree;
|
||||
use ra_db::{FileId, RelativePath};
|
||||
use ra_db::FileId;
|
||||
use ra_parser::FragmentKind;
|
||||
|
||||
macro_rules! register_builtin {
|
||||
|
@ -297,7 +297,7 @@ fn relative_file(db: &dyn AstDatabase, call_id: MacroCallId, path: &str) -> Opti
|
|||
let call_site = call_id.as_file().original_file(db);
|
||||
|
||||
// Handle trivial case
|
||||
if let Some(res) = db.resolve_path(call_site, &RelativePath::new(&path)) {
|
||||
if let Some(res) = db.resolve_path(call_site, path) {
|
||||
// Prevent include itself
|
||||
return if res == call_site { None } else { Some(res) };
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue