From 95746a99b4003b15c8b9ee94044d1f7c1fb81ac9 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Sun, 12 Sep 2021 23:12:08 +0200 Subject: [PATCH] Use correct file syntax node for decl_access computation in find_all_refs --- crates/ide/src/references.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/ide/src/references.rs b/crates/ide/src/references.rs index 0d30dafd56f..8c3ad0fcedc 100644 --- a/crates/ide/src/references.rs +++ b/crates/ide/src/references.rs @@ -87,7 +87,10 @@ pub(crate) fn find_all_refs( } .map(|nav| { let decl_range = nav.focus_or_full_range(); - Declaration { nav, access: decl_access(&def, &syntax, decl_range) } + Declaration { + access: decl_access(&def, sema.parse(nav.file_id).syntax(), decl_range), + nav, + } }); if is_literal_search { retain_adt_literal_usages(&mut usages, def, sema);