diff options
| author | bors <bors@rust-lang.org> | 2024-01-11 11:53:24 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-01-11 11:53:24 +0000 |
| commit | 9d8889cdfcc3aa0302353fc988ed21ff9bc9925c (patch) | |
| tree | bbab326d48c65b44d0fee49cde3812163e37bb7c /crates/hir-expand/src/lib.rs | |
| parent | 3e1ae6be2194939b0fd60a866fbff7d9320d320d (diff) | |
| parent | 215ede84979971e0d4dbae41c7be4c3f46d2728a (diff) | |
| download | rust-9d8889cdfcc3aa0302353fc988ed21ff9bc9925c.tar.gz rust-9d8889cdfcc3aa0302353fc988ed21ff9bc9925c.zip | |
Auto merge of #16348 - Veykril:nested-includes, r=Veykril
fix: Fix nested includes resolving from the wrong base file Fixes https://github.com/rust-lang/rust-analyzer/issues/16109
Diffstat (limited to 'crates/hir-expand/src/lib.rs')
| -rw-r--r-- | crates/hir-expand/src/lib.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/hir-expand/src/lib.rs b/crates/hir-expand/src/lib.rs index 6a122e0859c..ae7d17e49a9 100644 --- a/crates/hir-expand/src/lib.rs +++ b/crates/hir-expand/src/lib.rs @@ -318,6 +318,7 @@ pub trait MacroFileIdExt { fn expansion_level(self, db: &dyn ExpandDatabase) -> u32; /// If this is a macro call, returns the syntax node of the call. fn call_node(self, db: &dyn ExpandDatabase) -> InFile<SyntaxNode>; + fn parent(self, db: &dyn ExpandDatabase) -> HirFileId; fn expansion_info(self, db: &dyn ExpandDatabase) -> ExpansionInfo; @@ -353,6 +354,9 @@ impl MacroFileIdExt for MacroFileId { }; } } + fn parent(self, db: &dyn ExpandDatabase) -> HirFileId { + self.macro_call_id.lookup(db).kind.file_id() + } /// Return expansion information if it is a macro-expansion file fn expansion_info(self, db: &dyn ExpandDatabase) -> ExpansionInfo { |
