Auto merge of #14407 - Veykril:rename-fix, r=Veykril

fix: Fix renames of locals being broken in macro calls

Fixes https://github.com/rust-lang/rust-analyzer/issues/14379
This commit is contained in:
bors 2023-03-25 18:35:13 +00:00
commit d1c7984396
2 changed files with 20 additions and 7 deletions

View file

@ -977,6 +977,7 @@ impl<N: AstNode> InFile<N> {
self.value.syntax().descendants().filter_map(T::cast).map(move |n| self.with_value(n))
}
// FIXME: this should return `Option<InFileNotHirFile<N>>`
pub fn original_ast_node(self, db: &dyn db::ExpandDatabase) -> Option<InFile<N>> {
// This kind of upmapping can only be achieved in attribute expanded files,
// as we don't have node inputs otherwise and therefore can't find an `N` node in the input