mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
feat: Support for GOTO def from *inside* files included with include! macro
This commit is contained in:
parent
a911652360
commit
b22e772cab
7 changed files with 163 additions and 12 deletions
|
@ -520,6 +520,24 @@ impl MacroCallLoc {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn include_file_id(
|
||||
&self,
|
||||
db: &dyn ExpandDatabase,
|
||||
macro_call_id: MacroCallId,
|
||||
) -> Option<FileId> {
|
||||
if self.def.is_include() {
|
||||
if let Some(eager) = &self.eager {
|
||||
if let Ok(it) =
|
||||
builtin_fn_macro::include_input_to_file_id(db, macro_call_id, &eager.arg)
|
||||
{
|
||||
return Some(it);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
impl MacroCallKind {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue